Skip to content

Commit

Permalink
Use pnpm (#8398)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
Co-authored-by: Josh Calder <josh.calder@thinkmill.com.au>
  • Loading branch information
3 people authored Mar 23, 2023
1 parent 1af39b9 commit 1501892
Show file tree
Hide file tree
Showing 94 changed files with 16,952 additions and 15,364 deletions.
9 changes: 2 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@

"settings": {},

"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"gamunu.vscode-yarn",
"prisma.prisma"
],
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "prisma.prisma"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

"postCreateCommand": "yarn install",
"postCreateCommand": "pnpm install",

"remoteUser": "node"
}
5 changes: 3 additions & 2 deletions .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ runs:
# preferably lts/*, but we hit API limits when querying that
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
cache: pnpm

- run: yarn --frozen-lockfile
# limited to 1 child process, preventing Prisma postinstall races
- run: pnpm install --child-concurrency 1
shell: bash
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
6 changes: 3 additions & 3 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: version packages
run: yarn changeset version --snapshot ${{ inputs.tag }}
run: pnpm changeset version --snapshot ${{ inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.KEYSTONE_RELEASE_BOT_GITHUB_TOKEN }}

Expand All @@ -31,10 +31,10 @@ jobs:
git config --global user.email 'automation+keystonejs@thinkmill.com.au'
git commit -a -m 'rc'
- run: yarn build
- run: pnpm build

- name: npm publish, git tag
run: yarn changeset publish --tag ${{ inputs.tag }}
run: pnpm changeset publish --tag ${{ inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/tests_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Unit tests
run: yarn jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
env:
TEST_ADAPTER: postgresql
DATABASE_URL: postgres://testuser:testpass@localhost:5432/test_db
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Unit tests
run: yarn jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
env:
TEST_ADAPTER: sqlite

Expand All @@ -77,7 +77,7 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Unit tests
run: yarn jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand --shard=${{ matrix.index }}/9 api-tests --testPathIgnorePatterns=tests/api-tests/fields/crud
env:
TEST_ADAPTER: mysql
DATABASE_URL: mysql://root:testpass@localhost:3306/test_db
Expand All @@ -102,7 +102,7 @@ jobs:
run: bash ./.github/workflows/s3-bucket.sh

- name: Unit tests
run: yarn jest --ci --runInBand tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand tests/api-tests/fields/crud
env:
S3_ENDPOINT: http://127.0.0.1:9000/
S3_FORCE_PATH_STYLE: true
Expand All @@ -125,7 +125,7 @@ jobs:
run: bash ./.github/workflows/s3-bucket.sh

- name: Unit tests
run: yarn jest --ci --runInBand tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand tests/api-tests/fields/crud
env:
S3_ENDPOINT: http://127.0.0.1:9000/
S3_FORCE_PATH_STYLE: true
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
run: bash ./.github/workflows/s3-bucket.sh

- name: Unit tests
run: yarn jest --ci --runInBand tests/api-tests/fields/crud
run: pnpm jest --ci --runInBand tests/api-tests/fields/crud
env:
S3_ENDPOINT: http://127.0.0.1:9000/
S3_FORCE_PATH_STYLE: true
Expand All @@ -175,7 +175,7 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Example unit tests
run: cd examples/testing; yarn test
run: cd examples/testing; pnpm test

examples_smoke_tests:
name: Smoke Tests For Examples
Expand Down Expand Up @@ -210,13 +210,13 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Install Dependencies of Browsers
run: yarn playwright install-deps chromium
run: cd tests/examples-smoke-tests && pnpm playwright install-deps chromium

- name: Install Browsers
run: yarn playwright install chromium
run: cd tests/examples-smoke-tests && pnpm playwright install chromium

- name: Unit tests
run: yarn jest --ci --runInBand tests/examples-smoke-tests/${{ matrix.test }}
run: pnpm jest --ci --runInBand tests/examples-smoke-tests/${{ matrix.test }}

admin_ui_integration_tests:
name: Integration tests for Admin UI
Expand All @@ -240,10 +240,10 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Install Dependencies of Browsers
run: yarn playwright install-deps chromium
run: cd tests/admin-ui-tests && pnpm playwright install-deps chromium

- name: Install Browsers
run: yarn playwright install chromium
run: cd tests/admin-ui-tests && pnpm playwright install chromium

- name: Unit tests
run: yarn jest --ci --runInBand tests/admin-ui-tests/${{ matrix.test }}
run: pnpm jest --ci --runInBand tests/admin-ui-tests/${{ matrix.test }}
12 changes: 6 additions & 6 deletions .github/workflows/tests_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Prettier
run: yarn lint:prettier
run: pnpm lint:prettier

- name: TypeScript
run: yarn lint:types
run: pnpm lint:types

- name: ESLint
run: yarn lint:eslint
run: pnpm lint:eslint

- name: Preconstruct
run: yarn build
run: pnpm build

- name: Prisma Filters
run: yarn lint:filters
run: pnpm lint:filters

unit_tests:
name: Package Unit Tests
Expand All @@ -42,4 +42,4 @@ jobs:
- uses: ./.github/actions/ci-setup

- name: Unit tests
run: yarn jest --ci --runInBand --testPathIgnorePatterns=admin-ui-tests --testPathIgnorePatterns=api-tests --testPathIgnorePatterns=examples-smoke-tests --testPathIgnorePatterns=examples/testing
run: pnpm jest --ci --runInBand --testPathIgnorePatterns=admin-ui-tests --testPathIgnorePatterns=api-tests --testPathIgnorePatterns=examples-smoke-tests --testPathIgnorePatterns=examples/testing
122 changes: 5 additions & 117 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,126 +1,14 @@
# Next.js build dir
.next

# Keystone build dir
.keystone

# ts-gql generated files
__generated__

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
dist/
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# ESlint reports
reports/
# sqlite databases
*.db

# jest_ci output
junit.xml
# ts-gql
__generated__

# OS
.DS_Store
.idea

# Editor
*.sublime-project
*.sublime-workspace
*.vscode

package-lock.json

dist/

# Used by the image field type tests as a storage target
tmp_test_images/
tmp_test_files/

# Created by https://www.gitignore.io/api/vim
# Edit at https://www.gitignore.io/?templates=vim

### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

# End of https://www.gitignore.io/api/vim

projects/
temp/

# SQLite databases
*.db
*.db-journal

# Generated files from build process
robots.txt
sitemap.xml
7 changes: 1 addition & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,5 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
],
plugins: ['@babel/plugin-transform-runtime'],
};
5 changes: 3 additions & 2 deletions design-system/packages/core/src/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { theme } from './themes/default';
export const ThemeContext = createContext<{
theme: Theme;
}>({
theme: theme,
theme,
});

export const ThemeProvider = ({ theme, children }: { theme: Theme; children: ReactNode }) => {
return <ThemeContext.Provider value={{ theme }}>{children}</ThemeContext.Provider>;
};

export const useTheme = () => {
// TODO: return type required by pnpm :(
export const useTheme = (): Theme => {
const { theme } = useContext(ThemeContext);
return theme;
};
1 change: 1 addition & 0 deletions design-system/packages/fields/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"date-fns": "^2.26.0",
"react": "^18.2.0",
"react-day-picker": "^8.0.4",
"react-dom": "^18.2.0",
"react-focus-lock": "^2.7.1",
"react-select": "^5.2.1"
},
Expand Down
8 changes: 4 additions & 4 deletions design-system/packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,10 @@
"build": "node build-icons.js"
},
"devDependencies": {
"@svgr/core": "^5.5.0",
"@svgr/plugin-jsx": "^6.0.0",
"@svgr/plugin-prettier": "^5.5.0",
"@svgr/plugin-svgo": "^6.0.0",
"@svgr/core": "^6.5.1",
"@svgr/plugin-jsx": "^6.5.1",
"@svgr/plugin-prettier": "^6.5.1",
"@svgr/plugin-svgo": "^6.5.1",
"@types/react": "^18.0.9",
"chalk": "^4.1.2",
"feather-icons": "^4.28.0",
Expand Down
4 changes: 3 additions & 1 deletion design-system/packages/modals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
"./package.json": "./package.json"
},
"devDependencies": {
"@types/react": "^18.0.9"
"@types/react": "^18.0.9",
"@types/react-transition-group": "4.4.5"
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@keystone-ui/button": "^7.0.2",
"@keystone-ui/core": "^5.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-focus-lock": "^2.7.1",
"react-remove-scroll": "^2.4.3",
"react-transition-group": "^4.4.2"
Expand Down
6 changes: 4 additions & 2 deletions design-system/packages/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"./package.json": "./package.json"
},
"peerDependencies": {
"react": "^18.2.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"react": "^18.2.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"@babel/runtime": "^7.16.3",
Expand Down
Loading

0 comments on commit 1501892

Please sign in to comment.