Skip to content

Commit 230048e

Browse files
authored
set up trusted publishing (#90)
1 parent 64aa4b0 commit 230048e

File tree

8 files changed

+5316
-7627
lines changed

8 files changed

+5316
-7627
lines changed

.babelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"@babel/preset-react"
55
],
66
"plugins": [
7-
"@babel/plugin-proposal-class-properties",
8-
"@babel/plugin-proposal-export-namespace-from",
9-
"@babel/plugin-proposal-object-rest-spread",
7+
"@babel/plugin-transform-class-properties",
8+
"@babel/plugin-transform-export-namespace-from",
9+
"@babel/plugin-transform-object-rest-spread",
1010
"@babel/plugin-proposal-throw-expressions",
1111
"@babel/plugin-syntax-dynamic-import",
1212
"@babel/plugin-transform-runtime",

.github/workflows/build-website.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@ name: Build Metronome
22

33
on:
44
push:
5-
branches: [ main, v1.1.x ]
5+
branches: [main, v1.1.x]
66
pull_request:
7-
branches: [ main, v1.1.x ]
7+
branches: [main, v1.1.x]
88

99
jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Checkout 🛎️
15-
uses: actions/checkout@master
16-
17-
- name: Setup Node 🔧
18-
uses: actions/setup-node@v3
19-
with:
20-
node-version: '10'
21-
22-
- name: Run lint
23-
run: |
24-
yarn
25-
make lint
14+
- name: Checkout 🛎️
15+
uses: actions/checkout@master
16+
17+
- name: Setup Node 🔧
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '20'
21+
22+
- name: Run lint
23+
run: |
24+
yarn
25+
make lint
2626
2727
build:
2828
runs-on: ubuntu-latest
2929

3030
steps:
31-
- name: Checkout 🛎️
32-
uses: actions/checkout@master
33-
34-
- name: Setup Node 🔧
35-
uses: actions/setup-node@v3
36-
with:
37-
node-version: '10'
38-
39-
- name: Install and Build 🔧
40-
run: |
41-
yarn install
42-
yarn build
43-
44-
- name: Deploy 🚀
45-
if: github.ref == 'refs/heads/main'
46-
uses: JamesIves/[email protected]
47-
with:
48-
branch: gh-pages # The branch the action should deploy to. It should be any branch other than `main`
49-
folder: dist # The folder the action should deploy.
31+
- name: Checkout 🛎️
32+
uses: actions/checkout@master
33+
34+
- name: Setup Node 🔧
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: '20'
38+
39+
- name: Install and Build 🔧
40+
run: |
41+
yarn install
42+
yarn build
43+
44+
- name: Deploy 🚀
45+
if: github.ref == 'refs/heads/main'
46+
uses: JamesIves/[email protected]
47+
with:
48+
branch: gh-pages # The branch the action should deploy to. It should be any branch other than `main`
49+
folder: dist # The folder the action should deploy.

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# for more info: https://docs.npmjs.com/trusted-publishers#prefer-trusted-publishing-over-tokens
2+
name: Publish Package
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: read
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Update npm
25+
run: npm install -g npm@latest
26+
- run: npm publish

components/form/button-group/ButtonGroup.es6.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react'
2+
import PropTypes from 'prop-types'
23
import classnames from 'classnames'
34

45
function ButtonGroup ({ vertical, className, children }) {
@@ -12,4 +13,10 @@ function ButtonGroup ({ vertical, className, children }) {
1213
)
1314
}
1415

16+
ButtonGroup.propTypes = {
17+
vertical: PropTypes.bool,
18+
className: PropTypes.string,
19+
children: PropTypes.node
20+
}
21+
1522
export default ButtonGroup

components/form/checkbox/Checkbox.es6.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import classnames from 'classnames'
34

45
import { Checkmark } from '../../Icons.es6.js'
@@ -34,6 +35,16 @@ function Checkbox ({ disabled, checked, indeterminate, label, name, onChange, ha
3435
)
3536
}
3637

38+
Checkbox.propTypes = {
39+
disabled: PropTypes.bool,
40+
checked: PropTypes.bool,
41+
indeterminate: PropTypes.bool,
42+
label: PropTypes.string,
43+
name: PropTypes.string,
44+
onChange: PropTypes.func,
45+
hasError: PropTypes.bool
46+
}
47+
3748
Checkbox.defaultProps = {
3849
label: '',
3950
name: '',

components/form/checkbox/CheckboxSelect.es6.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import { isEqual } from 'lodash'
34

45
import Checkbox from '../checkbox/Checkbox.es6.js'
@@ -47,6 +48,16 @@ function CheckboxSelect ({ checked, disabled, label, onChange, onSelectChange,
4748
)
4849
}
4950

51+
CheckboxSelect.propTypes = {
52+
checked: PropTypes.bool,
53+
disabled: PropTypes.bool,
54+
label: PropTypes.string,
55+
onChange: PropTypes.func,
56+
onSelectChange: PropTypes.func,
57+
selectOptions: PropTypes.array,
58+
selectedOption: PropTypes.object
59+
}
60+
5061
CheckboxSelect.defaultProps = {
5162
checked: false,
5263
disabled: false,

package.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
{
22
"name": "@b12/metronome",
3-
"version": "1.1.32",
3+
"version": "1.1.33",
44
"description": "",
55
"main": "index.es6.js",
6+
"repository": {
7+
"url": "https://github.com/b12io/metronome"
8+
},
69
"scripts": {
710
"test": "jest",
8-
"start": "webpack-dev-server --mode development",
9-
"build": "webpack --mode production",
10-
"styleguide": "styleguidist server",
11-
"styleguide:build": "styleguidist build",
11+
"start": "NODE_OPTIONS=--openssl-legacy-provider webpack-dev-server --mode development",
12+
"build": "NODE_OPTIONS=--openssl-legacy-provider webpack --mode production",
13+
"styleguide": "NODE_OPTIONS=--openssl-legacy-provider styleguidist server",
14+
"styleguide:build": "NODE_OPTIONS=--openssl-legacy-provider styleguidist build",
1215
"prettier": "prettier --ignore-path .prettierignore --config .prettierrc.json --ignore-unknown --write",
1316
"lint-fix": "eslint --config .eslintrc.js --fix"
1417
},
1518
"author": "B12 <[email protected]> (https://b12.io/)",
1619
"license": "Apache-2.0",
1720
"engines": {
18-
"npm": ">=3.0.0"
21+
"node": ">=20.0.0",
22+
"npm": ">=11.5.1"
1923
},
2024
"jest": {
2125
"collectCoverage": false,
@@ -43,9 +47,9 @@
4347
"@babel/cli": "7.2.0",
4448
"@babel/core": "7.2.0",
4549
"@babel/node": "7.2.0",
46-
"@babel/plugin-proposal-class-properties": "7.2.1",
47-
"@babel/plugin-proposal-export-namespace-from": "7.2.0",
48-
"@babel/plugin-proposal-object-rest-spread": "7.2.0",
50+
"@babel/plugin-transform-class-properties": "7.24.7",
51+
"@babel/plugin-transform-export-namespace-from": "7.24.7",
52+
"@babel/plugin-transform-object-rest-spread": "7.24.7",
4953
"@babel/plugin-proposal-throw-expressions": "7.2.0",
5054
"@babel/plugin-syntax-dynamic-import": "7.2.0",
5155
"@babel/plugin-transform-runtime": "7.2.0",
@@ -79,7 +83,7 @@
7983
"file-loader": "1.1.11",
8084
"html-webpack-plugin": "3.2.0",
8185
"jest": "24.1.0",
82-
"node-sass": "4.13.1",
86+
"sass": "1.77.8",
8387
"popper.js": "1.14.3",
8488
"prettier": "2.7.1",
8589
"prop-types": "15.6.2",
@@ -88,12 +92,12 @@
8892
"react-styleguidist": "10.6.1",
8993
"react-syntax-highlighter": "7.0.4",
9094
"react-test-renderer": "16.3.2",
91-
"sass-loader": "7.0.1",
95+
"sass-loader": "10.5.2",
9296
"style-loader": "0.21.0",
9397
"uuid": "3.2.1",
94-
"webpack": "4.6.0",
95-
"webpack-cli": "2.0.15",
96-
"webpack-dev-server": "3.1.3"
98+
"webpack": "4.46.0",
99+
"webpack-cli": "3.3.12",
100+
"webpack-dev-server": "3.11.3"
97101
},
98102
"dependencies": {
99103
"bootstrap": "4.6.1",

0 commit comments

Comments
 (0)