Skip to content

Commit c83606b

Browse files
committed
feat: initial setup for versioning
1 parent 91b1bfa commit c83606b

File tree

8 files changed

+68
-6
lines changed

8 files changed

+68
-6
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI
2+
on: push
3+
jobs:
4+
test:
5+
runs-on: ubuntu-22.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-node@v1
9+
with:
10+
node-version: '17'
11+
- run: npm ci
12+
- run: npm build
13+
- name: Release
14+
env:
15+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16+
run: npm run semantic-release

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.vscode
3+
.github
4+
.editorconfig
5+
web-dev-server.config.mjs
6+
demo
7+
src

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import '../dist/src/ce-product.js';
1919
import '../dist/src/ce-cart.js';
2020
import '../dist/src/ce-cart-toggle.js';
21+
import '../dist/src/ce-add-to-cart.js';
2122

2223
const title = 'Hello owc World!';
2324
render(

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "An SDK containing web components for integrating with plodovi",
44
"license": "MIT",
55
"author": "Plodovi",
6-
"version": "0.0.0",
6+
"version": "0.0.0-development",
77
"type": "module",
88
"main": "dist/src/index.js",
99
"module": "dist/src/index.js",
@@ -17,7 +17,8 @@
1717
"build": "tsc && npm run analyze -- --exclude dist",
1818
"prepublish": "tsc && npm run analyze -- --exclude dist",
1919
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
20-
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore"
20+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
21+
"semantic-release": "semantic-release"
2122
},
2223
"dependencies": {
2324
"lit": "2.0.2"
@@ -35,7 +36,8 @@
3536
"lint-staged": "10.5.4",
3637
"prettier": "2.4.1",
3738
"tslib": "2.3.1",
38-
"typescript": "4.5.2"
39+
"typescript": "4.5.2",
40+
"semantic-release": "^20.1.3"
3941
},
4042
"customElements": "custom-elements.json",
4143
"eslintConfig": {
@@ -67,5 +69,12 @@
6769
"arrowParens": "avoid",
6870
"tabWidth": 2,
6971
"useTabs": false
72+
},
73+
"repository": {
74+
"type": "git",
75+
"url": "https://github.com/plodovi/sdk.git"
76+
},
77+
"release": {
78+
"branches": ["main"]
7079
}
71-
}
80+
}

src/AddToCart.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { html, css, LitElement } from 'lit';
2+
import { property } from 'lit/decorators.js';
3+
4+
export class AddToCart extends LitElement {
5+
static styles = css`
6+
:host {
7+
display: block;
8+
padding: 25px;
9+
color: var(--plodovi-products-text-color, #000);
10+
}
11+
`;
12+
13+
@property({ type: Number }) counter = 5;
14+
15+
__increment() {
16+
this.counter += 1;
17+
}
18+
19+
render() {
20+
return html`
21+
<h2>${this.title} Nr. ${this.counter}!</h2>
22+
<button @click=${this.__increment}>increment</button>
23+
`;
24+
}
25+
}

src/ce-add-to-cart.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { AddToCart } from './AddToCart.js';
2+
3+
window.customElements.define('plodovi-add-to-cart', AddToCart);

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export { Products } from './Products.js';
22
export { Product } from './Product.js';
33
export { Cart } from './Cart.js';
44
export { CartToggle } from './CartToggle.js';
5+
export { AddToCart } from './AddToCart.js';
56
export { init } from './init.js';

0 commit comments

Comments
 (0)