edu-webcomponents 1.17.0 → 1.19.7
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.
- package/.github/workflows/deploy-storybook-build-to-github-pages.yaml +27 -27
- package/.github/workflows/{release-packages-to-github.yaml → release-and-publish.yaml} +50 -36
- package/CHANGELOG.md +102 -66
- package/README.md +62 -62
- package/demo/index.html +29 -29
- package/docs/deploy-storybook-build-to-github-pages-docs.md +4 -4
- package/docs/husky-docs.md +12 -12
- package/docs/npm-check-updates-docs.md +10 -10
- package/docs/publish-packages-to-npm-registry-docs.md +46 -46
- package/docs/release-packages-to-github-docs.md +3 -4
- package/index.js +3 -1
- package/package.json +72 -72
- package/src/EduButton.js +61 -57
- package/src/EduProgressBar.js +78 -0
- package/src/EduTooltip.js +126 -0
- package/src/stories/EduProgressBar.stories.js +102 -0
- package/src/stories/EduTooltip.stories.js +68 -0
- package/src/stylesConstants.js +15 -0
- package/test/EduProgressBar.test.js +173 -0
- package/test/EduTooltip.test.js +119 -0
- package/.github/workflows/publish-packages-to-npm-registry.yaml +0 -21
|
@@ -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,36 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- name:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
name: Release and Publish to npmjs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release-and-publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Node
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
|
+
|
|
24
|
+
- name: Get version from package.json
|
|
25
|
+
id: version
|
|
26
|
+
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
|
27
|
+
|
|
28
|
+
- name: Set up Git
|
|
29
|
+
run: |
|
|
30
|
+
git config user.name "github-actions"
|
|
31
|
+
git config user.email "github-actions@github.com"
|
|
32
|
+
|
|
33
|
+
- name: Create tag
|
|
34
|
+
run: |
|
|
35
|
+
git tag v${{ steps.version.outputs.version }}
|
|
36
|
+
git push origin v${{ steps.version.outputs.version }}
|
|
37
|
+
|
|
38
|
+
- name: Create GitHub Release using gh
|
|
39
|
+
run: |
|
|
40
|
+
gh release create v${{ steps.version.outputs.version }} \
|
|
41
|
+
--title "v${{ steps.version.outputs.version }}" \
|
|
42
|
+
--notes "Release v${{ steps.version.outputs.version }}"
|
|
43
|
+
env:
|
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
|
|
46
|
+
- run: npm install -g npm
|
|
47
|
+
- run: npm ci
|
|
48
|
+
- run: npm publish --provenance --access public
|
|
49
|
+
env:
|
|
50
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,67 +1,103 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
## 1.
|
|
4
|
-
-
|
|
5
|
-
|
|
6
|
-
## 1.
|
|
7
|
-
- Fix
|
|
8
|
-
|
|
9
|
-
## 1.
|
|
10
|
-
- Fix
|
|
11
|
-
|
|
12
|
-
## 1.
|
|
13
|
-
- Fix
|
|
14
|
-
|
|
15
|
-
## 1.
|
|
16
|
-
- Fix
|
|
17
|
-
|
|
18
|
-
## 1.
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
## 1.
|
|
22
|
-
- Improve
|
|
23
|
-
|
|
24
|
-
## 1.
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
## 1.
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
## 1.
|
|
31
|
-
- Update
|
|
32
|
-
|
|
33
|
-
## 1.
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
## 1.
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
## 1.
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
## 1.
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
## 1.
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
## 1.
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
## 1.
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
## 1.
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
## 1.
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
## 1.
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
## 1.
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
## 1.
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 1.19.7 - 2025-08-09
|
|
4
|
+
- Fix versioning order in npm registry
|
|
5
|
+
|
|
6
|
+
## 1.19.6 - 2025-08-09
|
|
7
|
+
- Fix released package in GitHub is not published in npm registry
|
|
8
|
+
|
|
9
|
+
## 1.19.5 - 2025-08-09
|
|
10
|
+
- Fix released package in GitHub is not published in npm registry
|
|
11
|
+
|
|
12
|
+
## 1.19.4 - 2025-08-09
|
|
13
|
+
- Fix released package in GitHub is not published in npm registry
|
|
14
|
+
|
|
15
|
+
## 1.19.3 - 2025-08-09
|
|
16
|
+
- Fix released package in GitHub is not published in npm registry
|
|
17
|
+
|
|
18
|
+
## 1.19.2 - 2025-08-08
|
|
19
|
+
- Make EduTooltip have bottom position as default when the prop is not set or is set with invalid value
|
|
20
|
+
|
|
21
|
+
## 1.19.1 - 2025-08-07
|
|
22
|
+
- Improve docs for stories of EduProgressBar
|
|
23
|
+
|
|
24
|
+
## 1.19.0 - 2025-08-06
|
|
25
|
+
- Add EduProgressBar web component
|
|
26
|
+
|
|
27
|
+
## 1.18.0 - 2025-08-05
|
|
28
|
+
- Add EduTooltip web component
|
|
29
|
+
|
|
30
|
+
## 1.17.3 - 2025-08-04
|
|
31
|
+
- Update docs
|
|
32
|
+
|
|
33
|
+
## 1.17.2 - 2025-08-03
|
|
34
|
+
- Make values of colors of EduButton not defined in the component, but as constants accessible by the entire web components catalog
|
|
35
|
+
|
|
36
|
+
## 1.17.1 - 2025-08-02
|
|
37
|
+
- Format code
|
|
38
|
+
|
|
39
|
+
## 1.17.0 - 2025-08-02
|
|
40
|
+
- Make releasing and tagging use the version from package.json
|
|
41
|
+
|
|
42
|
+
## 1.16.1 - 2025-08-02
|
|
43
|
+
- Fix versioning of release
|
|
44
|
+
|
|
45
|
+
## 1.15.4 - 2025-08-02
|
|
46
|
+
- Fix versioning of release
|
|
47
|
+
|
|
48
|
+
## 1.15.3 - 2025-08-02
|
|
49
|
+
- Fix EduButton is always disabled
|
|
50
|
+
|
|
51
|
+
## 1.15.2 - 2025-08-02
|
|
52
|
+
- Fix EduButton is always disabled
|
|
53
|
+
|
|
54
|
+
## 1.15.1 - 2025-08-02
|
|
55
|
+
- Fix EduButton is always disabled
|
|
56
|
+
|
|
57
|
+
## 1.15.0 - 2025-08-02
|
|
58
|
+
- Improve EduButton component by adding aria-label and type attributes, disabled state and styles
|
|
59
|
+
|
|
60
|
+
## 1.14.0 - 2024-06-21
|
|
61
|
+
- Update docs of publishing packages to npm registry with provenance
|
|
62
|
+
|
|
63
|
+
## 1.13.0 - 2024-06-20
|
|
64
|
+
- Fix provenance when publishing packages to npm registry
|
|
65
|
+
|
|
66
|
+
## 1.12.0 - 2024-06-20
|
|
67
|
+
- Update dependencies
|
|
68
|
+
|
|
69
|
+
## 1.11.0 - 2024-06-19
|
|
70
|
+
- Add provenance to packages in npm registry
|
|
71
|
+
|
|
72
|
+
## 1.10.0 - 2024-06-17
|
|
73
|
+
- Add keywords to the repository
|
|
74
|
+
|
|
75
|
+
## 1.9.0 - 2024-06-16
|
|
76
|
+
- Update dependencies
|
|
77
|
+
|
|
78
|
+
## 1.8.0 - 2024-06-15
|
|
79
|
+
- Setup [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) to manage updates of dependencies of package.json
|
|
80
|
+
|
|
81
|
+
## 1.7.0 - 2024-06-02
|
|
82
|
+
- Setup GitHub Actions to publish packages in npm registry
|
|
83
|
+
|
|
84
|
+
## 1.6.0 - 2024-06-01
|
|
85
|
+
- Setup GitHub Actions to tag and release after merge into main
|
|
86
|
+
|
|
87
|
+
## 1.5.0 - 2024-05-30
|
|
88
|
+
- Add docs to enable the deployment of GitHub Actions artifacts into GitHub Pages
|
|
89
|
+
|
|
90
|
+
## 1.4.0 - 2024-05-30
|
|
91
|
+
- Setup GitHub Actions to publish Storybook built artifacts in GitHub Pages
|
|
92
|
+
|
|
93
|
+
## 1.3.0 - 2024-05-28
|
|
94
|
+
- Setup Storybook
|
|
95
|
+
|
|
96
|
+
## 1.2.0 - 2024-05-27
|
|
97
|
+
- Setup the repository to be a library of web components
|
|
98
|
+
|
|
99
|
+
## 1.1.0 - 2024-05-26
|
|
100
|
+
- Setup Husky
|
|
101
|
+
|
|
102
|
+
## 1.0.0 - 2024-05-25
|
|
67
103
|
- (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
|
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
|
package/docs/husky-docs.md
CHANGED
|
@@ -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,46 +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
|
-
|
|
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
|
+
# 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,3 @@
|
|
|
1
|
-
# Release and tag to GitHub by using GitHub Actions
|
|
2
|
-
Use workflow
|
|
3
|
-
-
|
|
4
|
-
- Create the needed token and add it to GitHub secrets
|
|
1
|
+
# Release and tag to GitHub by using GitHub Actions
|
|
2
|
+
Use workflow located in .github/workflows/release-packages-to-github.yaml:
|
|
3
|
+
- Create the needed token and add it to GitHub secrets
|
package/index.js
CHANGED