-
Notifications
You must be signed in to change notification settings - Fork 10
Node 16 upgrade and peer dependency cleanup #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
6c8d611
c0e6df1
3fb052c
ebab6bb
d73fa11
5a8cbf8
95c879e
036ae9e
5317170
3c68baf
ef00ec9
8763515
3680827
e8d7c89
8a8dcf9
851a12f
80c581e
77941a0
8b9be68
9e05565
3710f45
b20474a
7bd6dce
8200d01
3d5a36e
6198016
3c517b3
ea3cfb3
53f4fa1
08b7563
465f67f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,42 @@ | ||
| name: CI | ||
|
|
||
| on: [push] | ||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
| tests: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| # pulls all commits (needed for lerna / semantic release to correctly version) | ||
| fetch-depth: 0 | ||
| # pulls all tags (needed for lerna / semantic release to correctly version) | ||
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
| - name: Setup Nodejs | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12 | ||
| # lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not | ||
| # authenticated, even though this build does _not_ attempt to publish, as an extra check before merge | ||
| # that Lerna is set to publish. | ||
| - name: Check NPM authentication | ||
| run: | | ||
| echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc | ||
| npm whoami | ||
| - name: Install and Setup Dependencies | ||
| run: | | ||
| npm install | ||
| lerna bootstrap --include-dependencies --include-dependents --since origin/master | ||
| # build must come before running linting and tests for the `dist` directory to exist. | ||
| - name: Build | ||
| run: lerna run build --include-dependencies --include-dependents --since origin/master --parallel | ||
| - name: Lint | ||
| run: lerna run lint --include-dependencies --include-dependents --since origin/master --parallel | ||
| - name: Test | ||
| run: lerna run test --include-dependencies --include-dependents --since origin/master --parallel | ||
| - name: Coverage Report | ||
| uses: codecov/codecov-action@v1 | ||
| - name: Extract branch name | ||
| shell: bash | ||
| run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
| id: extract_branch | ||
| - name: Preview Updated Versions (dry run) | ||
| run: lerna version --allow-branch ${{ steps.extract_branch.outputs.branch }} --no-git-tag-version --no-changelog --no-push --yes | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| # pulls all commits (needed for lerna / semantic release to correctly version) | ||
| fetch-depth: 0 | ||
| # pulls all tags (needed for lerna / semantic release to correctly version) | ||
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
| - name: Setup Nodejs | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 16 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This repository is now relying on NPM workspaces. As such, it is not compatible with Node 12 or Node 14, as NPM workspaces require |
||
| # lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not | ||
| # authenticated, even though this build does _not_ attempt to publish, as an extra check before merge | ||
| # that Lerna is set to publish. | ||
| - name: Check NPM authentication | ||
| run: | | ||
| echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc | ||
| npm whoami | ||
| - name: Install and Setup Dependencies | ||
| run: npm run setup | ||
| # build must come before running linting and tests for the `dist` directory to exist. | ||
| - name: Build | ||
| run: lerna run build | ||
| - name: Lint | ||
| run: lerna run lint | ||
| - name: Test | ||
| run: lerna run test | ||
| - name: Coverage Report | ||
| uses: codecov/codecov-action@v2 | ||
| - name: Preview Updated Versions (dry run) | ||
| run: | | ||
| git switch -c "actual-branch-not-detached-head" | ||
| lerna version --allow-branch actual-branch-not-detached-head --no-git-tag-version --no-changelog --no-push --yes | ||
|
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By changing the |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 12 | ||
| 16 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| const path = require('path'); | ||
|
|
||
| const extendESLintConfig = (config) => { | ||
| const importNoUnresolved = config.rules['import/no-unresolved']; | ||
| if (importNoUnresolved ) { | ||
| const originalIgnore = importNoUnresolved[1].ignore; | ||
| if (!originalIgnore.includes('@edx/frontend-enterprise-*')) { | ||
| importNoUnresolved[1].ignore = [...originalIgnore, '@edx/frontend-enterprise-*']; | ||
| } | ||
| } | ||
| config.settings = { | ||
| ...config.settings, | ||
| 'import/resolver': { | ||
| alias: [ | ||
| ['@edx/frontend-enterprise-utils', '../utils/src'], | ||
| ], | ||
| }, | ||
| }; | ||
| }; | ||
|
|
||
| module.exports = extendESLintConfig; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const extendJestConfig = (config) => { | ||
| const modulePathsToIgnore = ['<rootDir>/dist']; | ||
| config.modulePathIgnorePatterns = config.modulePathIgnorePatterns ? [...config.modulePathIgnorePatterns, ...modulePathsToIgnore] : modulePathsToIgnore; | ||
| config.moduleNameMapper = { | ||
| ...config.moduleNameMapper, | ||
| '@edx/frontend-enterprise-(.*)': '<rootDir>/../$1/src', | ||
| }; | ||
| }; | ||
|
|
||
| module.exports = extendJestConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious as to why this run directive is the start of it's own sequence and not part of the "Checkout" sequence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can combine
runin the same sequence that has auses. I attempted to move therundirective in the "Checkout" sequence but the CI workflow wasn't running due to an incorrect configuration. I moved it back to its standalone step, but gave it a name, too.