Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6c8d611
fix: resolve most peer deps warnings in utils package
adamstankiewicz Apr 5, 2022
c0e6df1
fix: address peer dependency issues
adamstankiewicz Apr 5, 2022
3fb052c
fix: moar updates
adamstankiewicz Apr 6, 2022
ebab6bb
build: update ci.yml github action workflow
adamstankiewicz Apr 6, 2022
d73fa11
build: use node 16 to install deps
adamstankiewicz Apr 6, 2022
5a8cbf8
build: use node matrix in ci
adamstankiewicz Apr 6, 2022
95c879e
build: adds NPM workspaces to package.json
adamstankiewicz Apr 6, 2022
036ae9e
chore: upgrade @edx/frontend-platform devDeps
adamstankiewicz Apr 6, 2022
5317170
fix: update package-lock.json
adamstankiewicz Apr 6, 2022
3c68baf
fix: regenerate package-lock.json files
adamstankiewicz Apr 6, 2022
ef00ec9
build: remove workspaces from package.json
adamstankiewicz Apr 6, 2022
8763515
chore: move prop types to devDeps
adamstankiewicz Apr 6, 2022
3680827
chore: move prop-types back to deps due to eslint error
adamstankiewicz Apr 6, 2022
e8d7c89
build: use npm i vs npm ci
adamstankiewicz Apr 6, 2022
8a8dcf9
fix: push up local changes
adamstankiewicz Apr 13, 2022
851a12f
fix: add extendJestConfig helper function
adamstankiewicz Apr 13, 2022
80c581e
fix: make things work
adamstankiewicz Apr 13, 2022
77941a0
build: only run CI in Node 16
adamstankiewicz Apr 13, 2022
8b9be68
build: run CI workflow on pull_request actions
adamstankiewicz Apr 13, 2022
9e05565
build: only install npm packages at root with workspaces
adamstankiewicz Apr 13, 2022
3710f45
build: only install npm packages at root with workspaces pt2
adamstankiewicz Apr 13, 2022
b20474a
build: update how branch name is retrieved in version dry run
adamstankiewicz Apr 13, 2022
7bd6dce
build: only install npm packages at root with workspaces pt2 again
adamstankiewicz Apr 13, 2022
8200d01
build: try to fix detached head issue
adamstankiewicz Apr 13, 2022
3d5a36e
build: try to fix detached head issue pt2
adamstankiewicz Apr 13, 2022
6198016
build: remove eslint-import-resolver-alias
adamstankiewicz Apr 13, 2022
3c517b3
build: run workspaces command using npm
adamstankiewicz Apr 14, 2022
ea3cfb3
build: update npm scripts to use npm workspaces and update readme
adamstankiewicz Apr 14, 2022
53f4fa1
feat: drop support for Node 12 and add support for Node 16
adamstankiewicz Apr 14, 2022
08b7563
build: attempt to fetch tags in checkout workflow step
adamstankiewicz Apr 14, 2022
465f67f
build: move back to pulling tags as separate step
adamstankiewicz Apr 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/bump-all-major.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
# lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not authenticated
- name: Check NPM authentication
run: |
Expand All @@ -35,7 +35,7 @@ jobs:
run: npm run test
- name: Coverage Report
uses: codecov/codecov-action@v1
- name:
- name: Force publish major versions
run: lerna version major --force-publish --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74 changes: 35 additions & 39 deletions .github/workflows/ci.yml
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/*
Copy link
Contributor

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?

Copy link
Member Author

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 run in the same sequence that has a uses. I attempted to move the run directive 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.

- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 16
Copy link
Member Author

@adamstankiewicz adamstankiewicz Apr 13, 2022

Choose a reason for hiding this comment

The 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 npm v7+, so we will only run against Node 16.

# 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By changing the on from "push" to "pull_request" ensures this workflow is only run when necessary, but in doing so, the checkout is in a detached HEAD state, so we need to force switch to an attached branch for the version dry-run command to work.

2 changes: 1 addition & 1 deletion .github/workflows/publish-from-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
# lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not authenticated
- name: Check NPM authentication
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
# lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not authenticated
- name: Check NPM authentication
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
16
21 changes: 21 additions & 0 deletions common/extendESLintConfig.js
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;
10 changes: 10 additions & 0 deletions common/extendJestConfig.js
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;
Loading