Skip to content
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

WIP: use pnpm for package and workspace management #8132

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 21 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ commands:
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
- run:
name: Publish packages
command: npm run publish-packages
command: pnpm --filter="...[${SINCE:-origin/master}]" run publish-packages

set_since:
steps:
Expand All @@ -43,23 +43,21 @@ jobs:
template-preset: 'aws-push-artifacts'
- run:
name: Install dependencies
command: |
npm ci
npm run bootstrap:ci
command: pnpm install --frozen-lockfile
- run:
name: Check for prettier violations
command: |
git fetch origin master # circleci doesn't fetch master by default
./.circleci/prettier-check.sh
- run:
name: Lint
command: npm run lint
command: pnpm --filter="...[${SINCE:-origin/master}]" run lint
- run:
name: Verify project configurations
command: npm run verify-config
command: pnpm --filter="...[${SINCE:-origin/master}]" run verify-config
- run:
name: Test
command: npm run test
command: pnpm --filter="...[${SINCE:-origin/master}]" run test
- store_artifacts:
path: /tmp/artifacts

Expand All @@ -73,14 +71,12 @@ jobs:
- set_since
- run:
name: Install dependencies
command: |
npm ci
npm run bootstrap:ci
command: pnpm install --frozen-lockfile
- run:
name: Build
command: |
NODE_ENV='production' \
npm run build
pnpm --filter="...[${SINCE:-origin/master}]" run build

build-deploy-staging:
docker:
Expand All @@ -93,9 +89,7 @@ jobs:
- set_since
- run:
name: Bootstrap
command: |
npm ci
npm run bootstrap:ci
command: pnpm install --frozen-lockfile
- run:
name: Install awscli
command: |
Expand All @@ -108,15 +102,15 @@ jobs:
REACT_APP_BACKEND_BASE_URL=$BACKEND_BASE_URL_TEST \
REACT_APP_SLACK_CLIENT_ID=$SLACK_CLIENT_ID_TEST \
NODE_ENV='staging' \
npm run build
pnpm --filter="...[${SINCE:-origin/master}]" run build
- run:
name: Deploy apps to staging
command: |
STATIC_S3_BASE="s3://cf-apps-static-dev/apps-test-$CIRCLE_SHA1" \
STATIC_JIRA_S3_BASE="s3://cf-apps-static-dev/apps-test-$CIRCLE_SHA1/jira" \
REACT_APP_BACKEND_BASE_URL=$BACKEND_BASE_URL_TEST \
REACT_APP_SLACK_CLIENT_ID=$SLACK_CLIENT_ID_TEST \
STAGE='test' npm run deploy:test
STAGE='test' pnpm --filter="...[${SINCE:-origin/master}]" run deploy:test
- run:
name: Invalidate Slack staging cloudfront distribution
command: aws cloudfront create-invalidation --distribution-id $SLACK_TEST_CLOUDFRONT_DIST_ID --paths "/*"
Expand All @@ -132,9 +126,7 @@ jobs:
- set_since
- run:
name: Bootstrap
command: |
npm ci
npm run bootstrap:ci
command: pnpm install --frozen-lockfile
- run:
name: Install awscli
command: |
Expand All @@ -147,7 +139,7 @@ jobs:
REACT_APP_BACKEND_BASE_URL=$APP_SLACK_BACKEND_BASE_URL_PROD \
REACT_APP_SLACK_CLIENT_ID=$SLACK_CLIENT_ID_PROD \
NODE_ENV='production' \
npm run build
pnpm --filter="...[${SINCE:-origin/master}]" run build
- publish
- run:
name: Deploy apps to prod
Expand All @@ -156,13 +148,13 @@ jobs:
STATIC_JIRA_S3_BASE="s3://cf-apps-jira" \
REACT_APP_BACKEND_BASE_URL=$APP_SLACK_BACKEND_BASE_URL_PROD \
REACT_APP_SLACK_CLIENT_ID=$SLACK_CLIENT_ID_PROD \
STAGE='prd' npm run deploy
STAGE='prd' pnpm --filter="...[${SINCE:-origin/master}]" run deploy
- run:
name: Post Deploy
command: npm run post-deploy
command: pnpm --filter="...[${SINCE:-origin/master}]" run post-deploy
- run:
name: Sentry Release
command: npm run sentry-release
command: pnpm --filter="...[${SINCE:-origin/master}]" run sentry-release
- run:
name: Invalidate Slack cloudfront distribution
command: aws cloudfront create-invalidation --distribution-id $SLACK_PRD_CLOUDFRONT_DIST_ID --paths "/*"
Expand All @@ -174,13 +166,13 @@ jobs:
- checkout
- run:
name: Install dependencies
command: cd examples/typescript && npm ci
command: pnpm i --frozen-lockfile
- run:
name: Build
command: cd examples/typescript && npm run build
command: pnpm --filter="...[${SINCE:-origin/master}]" --filter="examples/typescript" run build
- run:
name: Test
command: cd examples/typescript && npm run test
command: pnpm --filter="...[${SINCE:-origin/master}]" --filter="examples/typescript" run test

test-js-example:
docker:
Expand All @@ -189,13 +181,13 @@ jobs:
- checkout
- run:
name: Install dependencies
command: cd examples/javascript && npm ci
command: pnpm i --frozen-lockfile
- run:
name: Build
command: cd examples/javascript && npm run build
command: pnpm --filter="...[${SINCE:-origin/master}]" --filter="examples/javascript" run build
- run:
name: Test
command: cd examples/javascript && npm run test
command: pnpm --filter="...[${SINCE:-origin/master}]" --filter="examples/javascript" run test

workflows:
version: 2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ tags
**/.coverage/**
lerna-debug.log
.eslintcache
.tool-versions
.tool-versions
.nx
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict = true
@contentful:registry=https://registry.npmjs.org
Loading
Loading