Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Commit cd49027

Browse files
authored
Merge pull request #572 from smartprocure/feature/yarn-esbuild
ESM source, use yarn and esbuild
2 parents 0a67475 + d178cc6 commit cd49027

File tree

209 files changed

+18061
-54046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+18061
-54046
lines changed

.babelrc

Lines changed: 0 additions & 40 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:import/recommended",
5+
"plugin:react/recommended"
6+
],
7+
"ignorePatterns": ["dist", "node_modules", "!.storybook"],
8+
"parserOptions": {
9+
"ecmaVersion": "2022",
10+
"sourceType": "module",
11+
"ecmaFeatures": { "jsx": true }
12+
},
13+
"env": {
14+
"browser": true,
15+
"node": true,
16+
"jest": true,
17+
"es2022": true
18+
},
19+
"rules": {
20+
"import/extensions": [2, { "js": "always" }],
21+
"react/display-name": "off",
22+
"react/prop-types": "off"
23+
},
24+
"settings": {
25+
"react": {
26+
"version": "detect"
27+
}
28+
}
29+
}

.github/workflows/pull-request.yaml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
name: Pull Request
1+
name: Lint, and Danger
22

33
on: pull_request
44

55
jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
token: '${{ secrets.PAT_DECRAPIFIER }}'
12-
fetch-depth: 0
13-
- name: Use Node.js 16.x
14-
uses: actions/setup-node@v1
15-
with:
16-
node-version: 16.x
17-
- name: Cache Node.js modules
18-
uses: actions/cache@v2
19-
with:
20-
# npm cache files are stored in `~/.npm` on Linux/macOS
21-
path: ~/.npm
22-
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
23-
restore-keys: |
24-
${{ runner.OS }}-node-
25-
${{ runner.OS }}-
26-
- run: npm run ci
27-
- run: npm run build --if-present
28-
- run: npm run test:ci || touch FAIL_JOB
29-
- run: npm run lint:ci || touch FAIL_JOB
30-
- name: pre-danger
31-
run: git config user.email "decrapifier@govspend.com" && git config user.name "Decrapifier" && git checkout ${{github.head_ref}} && git config push.default upstream && git branch -u origin/${{github.head_ref}}
32-
- run: npm run danger
33-
env:
34-
DANGER_GITHUB_API_TOKEN: '${{ secrets.PAT_DECRAPIFIER }}'
35-
- name: check-if-lint-or-test-runs-failed
36-
run: 'if test -f "FAIL_JOB"; then exit 1; fi'
9+
- name: Checkout repo
10+
uses: actions/checkout@v3
11+
with:
12+
token: ${{ secrets.PAT_DECRAPIFIER }}
13+
fetch-depth: 0
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 16.x
19+
cache: 'yarn'
20+
21+
- name: Install dependencies
22+
run: yarn install --immutable
23+
24+
- name: Lint
25+
run: yarn run lint:ci || touch FAIL_JOB
26+
27+
- name: Setup Decrapifier user
28+
run: |
29+
git config user.email "decrapifier@govspend.com"
30+
git config user.name "Decrapifier"
31+
git config push.default upstream
32+
git checkout --track origin/${{github.head_ref}}
33+
34+
- name: Run danger
35+
run: yarn run danger ci || touch FAIL_JOB
36+
env:
37+
DANGER_GITHUB_API_TOKEN: ${{ secrets.PAT_DECRAPIFIER }}
38+
39+
- name: check-if-lint-or-runs-failed
40+
run: 'if test -f "FAIL_JOB"; then exit 1; fi'

.github/workflows/push-master.yaml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
1-
name: Push to master
1+
name: Release
22

33
on:
44
push:
55
branches:
66
- master
7+
78
jobs:
89
build:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v2
12-
- name: Use Node.js 16.x
13-
uses: actions/setup-node@v1
14-
with:
15-
node-version: 16.x
16-
- run: npm run ci
17-
- run: npm run build --if-present
18-
- run: npm test
19-
- name: Publish to npm
20-
run: |
21-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
22-
npm publish
23-
env:
24-
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}'
25-
- name: Update package to grey-vest
26-
run: npm run update-pkg
27-
- name: Publish to npm
28-
run: |
29-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
30-
npm publish
31-
env:
32-
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}'
12+
- name: Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 16.x
19+
cache: 'yarn'
20+
21+
- name: Install dependencies
22+
run: yarn install --immutable
23+
24+
- name: Publish to npm
25+
run: |
26+
echo -e "npmRegistryServer: \"https://registry.npmjs.org/\"\nnpmAuthToken: \"$NPM_TOKEN\"" >> ./.yarnrc.yml
27+
yarn npm publish --access public
28+
env:
29+
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}'
30+
31+
- name: Update package to grey-vest
32+
run: yarn run update-pkg
33+
34+
- name: Publish to npm
35+
run: |
36+
echo -e "npmRegistryServer: \"https://registry.npmjs.org/\"\nnpmAuthToken: \"$NPM_TOKEN\"" >> ./.yarnrc.yml
37+
yarn npm publish --access public
38+
env:
39+
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}'

.gitignore

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,20 @@ typings/
5757
# dotenv environment variables file
5858
.env
5959

60-
# jest cpverage
61-
coverage/
62-
jest_0/
63-
6460
# ignore distribution folder
65-
dist/
61+
dist/*
6662

6763
# ignore storybook related folders
6864
storybook-static/
6965

7066
test-results.json
71-
72-
.idea/
67+
lint-results.json
68+
69+
# yarn stuff
70+
# see https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
71+
.yarn/*
72+
!.yarn/patches
73+
!.yarn/plugins
74+
!.yarn/releases
75+
!.yarn/sdks
76+
!.yarn/versions

.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/addons.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import '@storybook/addon-actions/register'
2-
import '@storybook/addon-docs/register'
1+
import '@storybook/addon-actions/register.js'
2+
import '@storybook/addon-docs/register.js'
File renamed without changes.

.yarn/releases/yarn-3.3.1.cjs

Lines changed: 823 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+
yarnPath: .yarn/releases/yarn-3.3.1.cjs

CHANGELOG.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 2.54.9
2+
* Use yarn
3+
* Use eslint to build source
4+
* Convert package to ESM
5+
16
### 2.54.8
27
* FilterList - Add `resultsPath` similar to how it is used in TagsQuerySearchBar to indicate if we need to trigger tree update
38

__mocks__/fileMock.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

__mocks__/styleMock.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dangerfile.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
let { danger, markdown, fail, message, warn } = require('danger')
2+
3+
let fs = require('fs')
4+
let duti = require('duti')
5+
6+
let readJson = path => {
7+
try {
8+
return JSON.parse(fs.readFileSync(path, { encoding: 'utf8' }))
9+
} catch (e) {
10+
//
11+
}
12+
}
13+
14+
let args = {
15+
danger,
16+
fail,
17+
message,
18+
warn,
19+
markdown,
20+
lintResults: readJson('./lint-results.json'),
21+
config: {
22+
prNetChangeThreshold: 500,
23+
personalityNetChangeThreshold: 500,
24+
recommendedPrReviewers: 1,
25+
rootFolder: 'src',
26+
},
27+
}
28+
29+
// Danger can do a run on a local repo via `danger local`, in which case
30+
// `danger.github` will not be defined:
31+
// - `danger local -h`
32+
// - https://danger.systems/js/tutorials/fast-feedback.html
33+
if (danger.github) {
34+
duti.prAssignee(args)
35+
duti.netNegativePR(args)
36+
duti.bigPr(args)
37+
duti.noPrDescription(args)
38+
duti.requestedReviewers(args)
39+
duti.emptyChangelog(args)
40+
duti.versionBump(args)
41+
duti.autoFix(args)
42+
}
43+
44+
duti.hasLintWarnings(args)
45+
duti.hasLintErrors(args)

0 commit comments

Comments
 (0)