edu-webcomponents 1.11.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
- name: Build and Publish Storybook to GitHub Pages
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'main'
7
-
8
- permissions:
9
- contents: read
10
- pages: write
11
- id-token: write
12
-
13
- jobs:
14
- deploy:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: '18.x'
22
-
23
- - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
24
- with:
25
- install_command: npm install
26
- build_command: npm run build-storybook
27
- path: storybook-static
1
+ name: Build and Publish Storybook to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - 'main'
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ deploy:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: '18.x'
22
+
23
+ - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
24
+ with:
25
+ install_command: npm install
26
+ build_command: npm run build-storybook
27
+ path: storybook-static
28
28
  checkout: false
@@ -1,21 +1,21 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- id-token: write
11
- steps:
12
- - uses: actions/checkout@v4
13
- - uses: actions/setup-node@v4
14
- with:
15
- node-version: '20.x'
16
- registry-url: 'https://registry.npmjs.org'
17
- - run: npm install -g npm
18
- - run: npm ci
19
- - run: npm publish --provenance --access public
20
- env:
21
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1
+ name: Publish Package to npmjs
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: '20.x'
16
+ registry-url: 'https://registry.npmjs.org'
17
+ - run: npm install -g npm
18
+ - run: npm ci
19
+ - run: npm publish --provenance --access public
20
+ env:
21
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,19 +1,19 @@
1
- on:
2
- push:
3
- branches:
4
- - main
5
-
6
- jobs:
7
- release-on-merge:
8
- runs-on: ubuntu-latest
9
- permissions:
10
- contents: write
11
- env:
12
- GITHUB_TOKEN: ${{ secrets.RELEASE }}
13
- steps:
14
- - name: release
15
- uses: dexwritescode/release-on-merge-action@v1
16
- with:
17
- version-increment-strategy: minor
18
- initial-version: '1.6.0'
19
- tag-prefix: v
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+
6
+ jobs:
7
+ release-on-merge:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ contents: write
11
+ env:
12
+ GITHUB_TOKEN: ${{ secrets.RELEASE }}
13
+ steps:
14
+ - name: release
15
+ uses: dexwritescode/release-on-merge-action@v1
16
+ with:
17
+ version-increment-strategy: minor
18
+ initial-version: '1.6.0'
19
+ tag-prefix: v
package/.ncurc.js CHANGED
@@ -1,17 +1,17 @@
1
- /** Upgrade major version zero to the next minor version, and everything else to latest.
2
- @param dependencyName The name of the dependency.
3
- @param parsedVersion A parsed Semver object of the upgraded version.
4
- (See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
5
- @returns One of the valid target values (specified in the table above).
6
- */
7
- module.exports = {
8
- target: (
9
- dependencyName,
10
- [{ semver, version, operator, major, minor, patch, release, build }],
11
- ) => {
12
- if (dependencyName === 'lit') {
13
- return 'minor';
14
- }
15
- return 'latest';
16
- },
17
- };
1
+ /** Upgrade major version zero to the next minor version, and everything else to latest.
2
+ @param dependencyName The name of the dependency.
3
+ @param parsedVersion A parsed Semver object of the upgraded version.
4
+ (See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
5
+ @returns One of the valid target values (specified in the table above).
6
+ */
7
+ module.exports = {
8
+ target: (
9
+ dependencyName,
10
+ [{ semver, version, operator, major, minor, patch, release, build }],
11
+ ) => {
12
+ if (dependencyName === 'lit') {
13
+ return 'minor';
14
+ }
15
+ return 'latest';
16
+ },
17
+ };
package/CHANGELOG.md CHANGED
@@ -1,37 +1,46 @@
1
- # Change Log
2
-
3
- ## 1.0.0 - 2024-05-25
4
- - (Initial commit) run npm init @open-wc and select these options: Scaffold a new project, scaffold a Web Component, add Linting (eslint & prettier) and Testing (web-test-runner), do not use typescript, use edu-webcomponents as tag name
5
-
6
- ## 1.1.0 - 2024-05-26
7
- - Setup Husky
8
-
9
- ## 1.2.0 - 2024-05-27
10
- - Setup the repository to be a library of web components
11
-
12
- ## 1.3.0 - 2024-05-28
13
- - Setup Storybook
14
-
15
- ## 1.4.0 - 2024-05-30
16
- - Setup GitHub Actions to publish Storybook built artifacts in GitHub Pages
17
-
18
- ## 1.5.0 - 2024-05-30
19
- - Add docs to enable the deployment of GitHub Actions artifacts into GitHub Pages
20
-
21
- ## 1.6.0 - 2024-06-01
22
- - Setup GitHub Actions to tag and release after merge into main
23
-
24
- ## 1.7.0 - 2024-06-02
25
- - Setup GitHub Actions to publish packages in npm registry
26
-
27
- ## 1.8.0 - 2024-06-15
28
- - Setup [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) to manage updates of dependencies of package.json
29
-
30
- ## 1.9.0 - 2024-06-16
31
- - Update dependencies
32
-
33
- ## 1.10.0 - 2024-06-17
34
- - Add keywords to the repository
35
-
36
- ## 1.11.0 - 2024-06-19
37
- - Add provenance to packages in npm registry
1
+ # Change Log
2
+
3
+ ## 1.0.0 - 2024-05-25
4
+ - (Initial commit) run npm init @open-wc and select these options: Scaffold a new project, scaffold a Web Component, add Linting (eslint & prettier) and Testing (web-test-runner), do not use typescript, use edu-webcomponents as tag name
5
+
6
+ ## 1.1.0 - 2024-05-26
7
+ - Setup Husky
8
+
9
+ ## 1.2.0 - 2024-05-27
10
+ - Setup the repository to be a library of web components
11
+
12
+ ## 1.3.0 - 2024-05-28
13
+ - Setup Storybook
14
+
15
+ ## 1.4.0 - 2024-05-30
16
+ - Setup GitHub Actions to publish Storybook built artifacts in GitHub Pages
17
+
18
+ ## 1.5.0 - 2024-05-30
19
+ - Add docs to enable the deployment of GitHub Actions artifacts into GitHub Pages
20
+
21
+ ## 1.6.0 - 2024-06-01
22
+ - Setup GitHub Actions to tag and release after merge into main
23
+
24
+ ## 1.7.0 - 2024-06-02
25
+ - Setup GitHub Actions to publish packages in npm registry
26
+
27
+ ## 1.8.0 - 2024-06-15
28
+ - Setup [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) to manage updates of dependencies of package.json
29
+
30
+ ## 1.9.0 - 2024-06-16
31
+ - Update dependencies
32
+
33
+ ## 1.10.0 - 2024-06-17
34
+ - Add keywords to the repository
35
+
36
+ ## 1.11.0 - 2024-06-19
37
+ - Add provenance to packages in npm registry
38
+
39
+ ## 1.12.0 - 2024-06-20
40
+ - Update dependencies
41
+
42
+ ## 1.13.0 - 2024-06-20
43
+ - Fix provenance when publishing packages to npm registry
44
+
45
+ ## 1.14.0 - 2024-06-21
46
+ - Update docs of publishing packages to npm registry with provenance
package/README.md CHANGED
@@ -1,62 +1,62 @@
1
- # Edu web components library
2
-
3
- This web components library follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm i edu-webcomponents
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <script type="module">
15
- import 'edu-webcomponents/index.js';
16
- </script>
17
-
18
- <webcomponent-tagname></webcomponent-tagname>
19
- ```
20
-
21
- ## Linting and formatting
22
-
23
- To scan the project for linting and formatting errors, run
24
-
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
34
-
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
48
-
49
-
50
- ## Tooling configs
51
-
52
- For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
53
-
54
- If you customize the configuration a lot, you can consider moving them to individual files.
55
-
56
- ## Local Demo with `web-dev-server`
57
-
58
- ```bash
59
- npm start
60
- ```
61
-
62
- To run a local development server that serves the basic demo located in `demo/index.html`
1
+ # Edu web components library
2
+
3
+ This web components library follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i edu-webcomponents
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import 'edu-webcomponents/index.js';
16
+ </script>
17
+
18
+ <webcomponent-tagname></webcomponent-tagname>
19
+ ```
20
+
21
+ ## Linting and formatting
22
+
23
+ To scan the project for linting and formatting errors, run
24
+
25
+ ```bash
26
+ npm run lint
27
+ ```
28
+
29
+ To automatically fix linting and formatting errors, run
30
+
31
+ ```bash
32
+ npm run format
33
+ ```
34
+
35
+ ## Testing with Web Test Runner
36
+
37
+ To execute a single test run:
38
+
39
+ ```bash
40
+ npm run test
41
+ ```
42
+
43
+ To run the tests in interactive watch mode run:
44
+
45
+ ```bash
46
+ npm run test:watch
47
+ ```
48
+
49
+
50
+ ## Tooling configs
51
+
52
+ For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
53
+
54
+ If you customize the configuration a lot, you can consider moving them to individual files.
55
+
56
+ ## Local Demo with `web-dev-server`
57
+
58
+ ```bash
59
+ npm start
60
+ ```
61
+
62
+ To run a local development server that serves the basic demo located in `demo/index.html`
package/demo/index.html CHANGED
@@ -1,29 +1,29 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '../index.js';
17
-
18
- const textButton = 'This is a button';
19
- render(
20
- html`
21
- <h1>Edu web components library</h1>
22
- <edu-button .text=${textButton}>
23
- </edu-button>
24
- `,
25
- document.querySelector('#demo')
26
- );
27
- </script>
28
- </body>
29
- </html>
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <div id="demo"></div>
13
+
14
+ <script type="module">
15
+ import { html, render } from 'lit';
16
+ import '../index.js';
17
+
18
+ const textButton = 'This is a button';
19
+ render(
20
+ html`
21
+ <h1>Edu web components library</h1>
22
+ <edu-button .text=${textButton}>
23
+ </edu-button>
24
+ `,
25
+ document.querySelector('#demo')
26
+ );
27
+ </script>
28
+ </body>
29
+ </html>
@@ -1,4 +1,4 @@
1
- # Deploy Storybook build to GitHub Pages by using GitHub Actions
2
- - Select "GitHub Actions" option as source below "Build and deployment" in your repository's Settings (see Pages in menu)
3
- - Use this workflow: https://storybook.js.org/docs/sharing/publish-storybook#github-pages
4
- - After that, deployment should work when running the ad hoc job
1
+ # Deploy Storybook build to GitHub Pages by using GitHub Actions
2
+ - Select "GitHub Actions" option as source below "Build and deployment" in your repository's Settings (see Pages in menu)
3
+ - Use this workflow: https://storybook.js.org/docs/sharing/publish-storybook#github-pages
4
+ - After that, deployment should work when running the ad hoc job
@@ -1,12 +1,12 @@
1
- # Husky docs
2
-
3
- ## Setup
4
-
5
- ### Required
6
- - Node.js package: https://www.npmjs.com/package/husky
7
- - Version: 9.0.11
8
-
9
- ### How to
10
- - Documentation followed: https://github.com/typicode/husky/blob/main/docs/get-started.md
11
- - Run this command to setup: npx husky init
12
- - Delete content in .husky/pre-commit and write: npm run format
1
+ # Husky docs
2
+
3
+ ## Setup
4
+
5
+ ### Required
6
+ - Node.js package: https://www.npmjs.com/package/husky
7
+ - Version: 9.0.11
8
+
9
+ ### How to
10
+ - Documentation followed: https://github.com/typicode/husky/blob/main/docs/get-started.md
11
+ - Run this command to setup: npx husky init
12
+ - Delete content in .husky/pre-commit and write: npm run format
@@ -1,11 +1,11 @@
1
- # npm-check-updates
2
- npm-check-updates is to manage updates of dependencies of package.json.
3
-
4
- Follow docs in npm registry to install and use: [npm-check-updates](https://www.npmjs.com/package/npm-check-updates).
5
-
6
- Useful commands:
7
- - check: ncu
8
- - check and upgrade: ncu -u
9
-
10
- Config file .ncurc.js:
1
+ # npm-check-updates
2
+ npm-check-updates is to manage updates of dependencies of package.json.
3
+
4
+ Follow docs in npm registry to install and use: [npm-check-updates](https://www.npmjs.com/package/npm-check-updates).
5
+
6
+ Useful commands:
7
+ - check: ncu
8
+ - check and upgrade: ncu -u
9
+
10
+ Config file .ncurc.js:
11
11
  - Hook into npm-check-updates commands to manage, e.g. filtering.
@@ -1,5 +1,46 @@
1
- # Publish packages to npm registry by using GitHub Actions
2
- - Have an account in npm.com and create a PAT with write permissions
3
- - Add PAT created to GitHub secrets
4
- - Use workflow from [here](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry)
5
-
1
+ # Publish packages to npm registry by using GitHub Actions
2
+ - Have an account in npm.com and create a PAT with write permissions
3
+ - Add PAT created to GitHub secrets
4
+ - Use workflow from [here](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry)
5
+
6
+ ## Provenance
7
+
8
+ ### What is is?
9
+
10
+ You can generate provenance statements for the packages you publish. This allows you to publicly establish where a package was built and who published a package, which can increase supply-chain security for your packages.
11
+
12
+ More info: [https://docs.npmjs.com/generating-provenance-statements](https://docs.npmjs.com/generating-provenance-statements).
13
+
14
+ ### How to
15
+ Add permissions and provenance flag to the workflow job that publishes packages to npm registry, as you can see here:
16
+ ```
17
+ name: Publish Package to npmjs
18
+ on:
19
+ release:
20
+ types: [published]
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ contents: read
26
+ id-token: write
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-node@v4
30
+ with:
31
+ node-version: '20.x'
32
+ registry-url: 'https://registry.npmjs.org'
33
+ - run: npm install -g npm
34
+ - run: npm ci
35
+ - run: npm publish --provenance --access public
36
+ env:
37
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38
+ ```
39
+
40
+ Add repository object with type and url properties to the package.json, as you can see here:
41
+ ```
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
45
+ },
46
+ ```
@@ -1,4 +1,4 @@
1
- # Release and tag to GitHub by using GitHub Actions
2
- Use workflow from [here](https://github.com/marketplace/actions/release-on-merge-action) and:
3
- - Add corresponding inputs
4
- - Create the needed token and add it to GitHub secrets
1
+ # Release and tag to GitHub by using GitHub Actions
2
+ Use workflow from [here](https://github.com/marketplace/actions/release-on-merge-action) and:
3
+ - Add corresponding inputs
4
+ - Create the needed token and add it to GitHub secrets
package/package.json CHANGED
@@ -1,69 +1,73 @@
1
- {
2
- "name": "edu-webcomponents",
3
- "description": "Webcomponent edu-webcomponents following open-wc recommendations",
4
- "keywords": [
5
- "web components library",
6
- "web components catalog",
7
- "webcomponents library",
8
- "webcomponents catalog",
9
- "web components",
10
- "webcomponents"
11
- ],
12
- "license": "MIT",
13
- "author": "edu-webcomponents",
14
- "version": "1.11.0",
15
- "type": "module",
16
- "main": "index.js",
17
- "module": "index.js",
18
- "exports": {
19
- ".": "./index.js"
20
- },
21
- "scripts": {
22
- "analyze": "cem analyze --litelement",
23
- "start": "web-dev-server",
24
- "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
25
- "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
26
- "test": "web-test-runner --coverage",
27
- "test:watch": "web-test-runner --watch",
28
- "prepare": "husky",
29
- "storybook": "storybook dev -p 6006",
30
- "build-storybook": "storybook build"
31
- },
32
- "dependencies": {
33
- "lit": "^2.8.0"
34
- },
35
- "devDependencies": {
36
- "@chromatic-com/storybook": "^1.5.0",
37
- "@custom-elements-manifest/analyzer": "^0.10.2",
38
- "@open-wc/eslint-config": "^9.2.2",
39
- "@open-wc/testing": "^3.2.2",
40
- "@storybook/addon-essentials": "^8.1.9",
41
- "@storybook/addon-links": "^8.1.9",
42
- "@storybook/addon-webpack5-compiler-swc": "^1.0.3",
43
- "@storybook/blocks": "^8.1.9",
44
- "@storybook/test": "^8.1.9",
45
- "@storybook/web-components": "^8.1.9",
46
- "@storybook/web-components-webpack5": "^8.1.9",
47
- "@web/dev-server": "^0.4.5",
48
- "@web/test-runner": "^0.18.2",
49
- "eslint": "^8.57.0",
50
- "eslint-config-prettier": "^8.10.0",
51
- "eslint-plugin-storybook": "^0.8.0",
52
- "husky": "^9.0.11",
53
- "lint-staged": "^10.5.4",
54
- "prettier": "^2.8.8",
55
- "storybook": "^8.1.9"
56
- },
57
- "customElements": "custom-elements.json",
58
- "eslintConfig": {
59
- "extends": [
60
- "@open-wc",
61
- "prettier",
62
- "plugin:storybook/recommended"
63
- ]
64
- },
65
- "prettier": {
66
- "singleQuote": true,
67
- "arrowParens": "avoid"
68
- }
69
- }
1
+ {
2
+ "name": "edu-webcomponents",
3
+ "description": "Webcomponent edu-webcomponents following open-wc recommendations",
4
+ "keywords": [
5
+ "web components library",
6
+ "web components catalog",
7
+ "webcomponents library",
8
+ "webcomponents catalog",
9
+ "web components",
10
+ "webcomponents"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "edu-webcomponents",
14
+ "version": "1.14.0",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
18
+ },
19
+ "type": "module",
20
+ "main": "index.js",
21
+ "module": "index.js",
22
+ "exports": {
23
+ ".": "./index.js"
24
+ },
25
+ "scripts": {
26
+ "analyze": "cem analyze --litelement",
27
+ "start": "web-dev-server",
28
+ "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
29
+ "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
30
+ "test": "web-test-runner --coverage",
31
+ "test:watch": "web-test-runner --watch",
32
+ "prepare": "husky",
33
+ "storybook": "storybook dev -p 6006",
34
+ "build-storybook": "storybook build"
35
+ },
36
+ "dependencies": {
37
+ "lit": "^2.8.0"
38
+ },
39
+ "devDependencies": {
40
+ "@chromatic-com/storybook": "^1.5.0",
41
+ "@custom-elements-manifest/analyzer": "^0.10.2",
42
+ "@open-wc/eslint-config": "^9.2.2",
43
+ "@open-wc/testing": "^3.2.2",
44
+ "@storybook/addon-essentials": "^8.1.10",
45
+ "@storybook/addon-links": "^8.1.10",
46
+ "@storybook/addon-webpack5-compiler-swc": "^1.0.4",
47
+ "@storybook/blocks": "^8.1.10",
48
+ "@storybook/test": "^8.1.10",
49
+ "@storybook/web-components": "^8.1.10",
50
+ "@storybook/web-components-webpack5": "^8.1.10",
51
+ "@web/dev-server": "^0.4.5",
52
+ "@web/test-runner": "^0.18.2",
53
+ "eslint": "^8.57.0",
54
+ "eslint-config-prettier": "^8.10.0",
55
+ "eslint-plugin-storybook": "^0.8.0",
56
+ "husky": "^9.0.11",
57
+ "lint-staged": "^10.5.4",
58
+ "prettier": "^2.8.8",
59
+ "storybook": "^8.1.10"
60
+ },
61
+ "customElements": "custom-elements.json",
62
+ "eslintConfig": {
63
+ "extends": [
64
+ "@open-wc",
65
+ "prettier",
66
+ "plugin:storybook/recommended"
67
+ ]
68
+ },
69
+ "prettier": {
70
+ "singleQuote": true,
71
+ "arrowParens": "avoid"
72
+ }
73
+ }