0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

chore: yarn -> pnpm

This commit is contained in:
Gao Sun 2021-07-29 17:46:28 +08:00
parent 52f64b73ab
commit 4eb8d93d56
No known key found for this signature in database
GPG key ID: 0F0EFA2E36639F31
16 changed files with 16116 additions and 15740 deletions

View file

@ -15,26 +15,31 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# https://github.com/actions/cache/blob/main/examples.md#node---yarn - uses: actions/setup-node@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} node-version: '14'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.0.2
run_install: true
- name: Install packages - name: Install packages
run: yarn run: pnpm i
- name: Lint - name: Lint
working-directory: packages/core working-directory: packages/core
run: yarn lint run: pnpm lint
- name: Build - name: Build
working-directory: packages/core working-directory: packages/core
run: yarn build run: pnpm build

View file

@ -15,26 +15,25 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# https://github.com/actions/cache/blob/main/examples.md#node---yarn - uses: actions/setup-node@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} node-version: '14'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# https://github.com/actions/cache/blob/main/examples.md#node---npm
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-node-
- name: Install packages - name: Install packages
run: yarn run: npm ci
- name: Lint - name: Lint
working-directory: packages/phrases working-directory: packages/phrases
run: yarn lint run: npm run lint
- name: Build - name: Build
working-directory: packages/phrases working-directory: packages/phrases
run: yarn build run: npm run build

View file

@ -15,26 +15,25 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# https://github.com/actions/cache/blob/main/examples.md#node---yarn - uses: actions/setup-node@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} node-version: '14'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# https://github.com/actions/cache/blob/main/examples.md#node---npm
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-node-
- name: Install packages - name: Install packages
run: yarn run: npm ci
- name: Lint - name: Lint
working-directory: packages/schemas working-directory: packages/schemas
run: yarn lint run: npm run lint
- name: Build - name: Build
working-directory: packages/schemas working-directory: packages/schemas
run: yarn build run: npm run build

View file

@ -15,26 +15,25 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# https://github.com/actions/cache/blob/main/examples.md#node---yarn - uses: actions/setup-node@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} node-version: '14'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# https://github.com/actions/cache/blob/main/examples.md#node---npm
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-node-
- name: Install packages - name: Install packages
run: yarn run: npm ci
- name: Lint - name: Lint
working-directory: packages/ui working-directory: packages/ui
run: yarn lint && yarn stylelint run: npm run lint && npm run stylelint
- name: Build - name: Build
working-directory: packages/ui working-directory: packages/ui
run: yarn build run: npm run build

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
yarn lerna run --concurrency 1 --stream precommit --since HEAD --exclude-dependents pnpm -- lerna run --concurrency 1 --stream precommit --since HEAD --exclude-dependents

View file

@ -1,5 +1,5 @@
{ {
"version": "0.1.0", "version": "0.1.0",
"npmClient": "yarn", "npmClient": "pnpm",
"useWorkspaces": true "useWorkspaces": true
} }

View file

@ -20,6 +20,6 @@
}, },
"engines": { "engines": {
"node": ">=14.15.0", "node": ">=14.15.0",
"yarn": "^1.22.10" "pnpm": ">=6"
} }
} }

View file

@ -7,7 +7,7 @@ The core backend service.
Copy proper `.env` to project root. (TBD: design the config process) Copy proper `.env` to project root. (TBD: design the config process)
```bash ```bash
yarn && yarn dev pnpm i && pnpm dev
``` ```
## OpenAPI Doc ## OpenAPI Doc

View file

@ -13,7 +13,7 @@
"dev": "rm -rf build/ && tsc-watch --preserveWatchOutput --onSuccess \"node ./build/index.js\"" "dev": "rm -rf build/ && tsc-watch --preserveWatchOutput --onSuccess \"node ./build/index.js\""
}, },
"dependencies": { "dependencies": {
"@logto/essentials": "^1.1.0-rc.1", "@logto/essentials": "^1.1.0-rc.2",
"@logto/phrases": "^0.1.0", "@logto/phrases": "^0.1.0",
"@logto/schemas": "^0.1.0", "@logto/schemas": "^0.1.0",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
@ -22,6 +22,7 @@
"formidable": "^1.2.2", "formidable": "^1.2.2",
"got": "^11.8.2", "got": "^11.8.2",
"i18next": "^20.3.5", "i18next": "^20.3.5",
"jose": "^3.14.3",
"koa": "^2.13.1", "koa": "^2.13.1",
"koa-body": "^4.2.0", "koa-body": "^4.2.0",
"koa-logger": "^3.2.1", "koa-logger": "^3.2.1",
@ -55,8 +56,7 @@
"typescript": "^4.3.5" "typescript": "^4.3.5"
}, },
"engines": { "engines": {
"node": ">=14.15.0", "node": ">=14.15.0"
"yarn": "^1.22.10"
}, },
"_moduleAliases": { "_moduleAliases": {
"@": "./build" "@": "./build"

View file

@ -10,9 +10,6 @@
"files": [ "files": [
"lib" "lib"
], ],
"publishConfig": {
"registry": "https://registry.yarnpkg.com"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/logto-io/logto.git" "url": "git+https://github.com/logto-io/logto.git"
@ -20,7 +17,7 @@
"scripts": { "scripts": {
"build": "rm -rf lib/ && tsc", "build": "rm -rf lib/ && tsc",
"lint": "eslint --format pretty \"src/**\"", "lint": "eslint --format pretty \"src/**\"",
"prepack": "yarn build" "prepack": "pnpm build"
}, },
"bugs": { "bugs": {
"url": "https://github.com/logto-io/logto/issues" "url": "https://github.com/logto-io/logto/issues"

View file

@ -11,17 +11,16 @@
"private": true, "private": true,
"scripts": { "scripts": {
"generate": "ts-node src/gen/index.ts && eslint --format pretty \"src/db-entries/**\" --fix", "generate": "ts-node src/gen/index.ts && eslint --format pretty \"src/db-entries/**\" --fix",
"build": "yarn generate && rm -rf lib/ && tsc --p tsconfig.build.json", "build": "pnpm generate && rm -rf lib/ && tsc --p tsconfig.build.json",
"lint": "eslint --format pretty \"src/**\"", "lint": "eslint --format pretty \"src/**\"",
"prepack": "yarn build" "prepack": "pnpm build"
}, },
"engines": { "engines": {
"node": ">=14.15.0", "node": ">=14.15.0"
"yarn": "^1.22.10"
}, },
"devDependencies": { "devDependencies": {
"@logto/eslint-config": "^0.1.0-rc.14", "@logto/eslint-config": "^0.1.0-rc.14",
"@logto/essentials": "^1.1.0-rc.1", "@logto/essentials": "^1.1.0-rc.2",
"@logto/ts-config": "^0.1.0-rc.14", "@logto/ts-config": "^0.1.0-rc.14",
"@types/lodash.uniq": "^4.5.6", "@types/lodash.uniq": "^4.5.6",
"@types/node": "14", "@types/node": "14",

View file

@ -7,7 +7,7 @@
"precommit": "lint-staged", "precommit": "lint-staged",
"dev:tsc": "tsc -b -w --preserveWatchOutput", "dev:tsc": "tsc -b -w --preserveWatchOutput",
"dev:razzle": "razzle start", "dev:razzle": "razzle start",
"dev": "PORT=5000 concurrently -c \"blue,cyan\" \"yarn:dev:tsc\" -k \"yarn:dev:razzle\"", "dev": "PORT=5000 concurrently -c \"blue,cyan\" \"pnpm:dev:tsc\" -k \"pnpm:dev:razzle\"",
"start": "NODE_ENV=production node build/server.js", "start": "NODE_ENV=production node build/server.js",
"build": "tsc -b && razzle build --noninteractive", "build": "tsc -b && razzle build --noninteractive",
"lint": "eslint --format pretty --ext .ts --ext .tsx src", "lint": "eslint --format pretty --ext .ts --ext .tsx src",

View file

@ -1,21 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="<%= process.env.PUBLIC_PATH %>favicon.ico" /> <link rel="icon" href="<%= process.env.PUBLIC_PATH %>favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<%= htmlWebpackPlugin.tags.headTags %> <%= htmlWebpackPlugin.tags.headTags %>
<!-- <!--
Notice the use of <%= process.env.PUBLIC_PATH %> in the tags above. Notice the use of <%= process.env.PUBLIC_PATH %> in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML. Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "<%= process.env.PUBLIC_PATH %>/favicon.ico" will Unlike "/favicon.ico" or "favicon.ico", "<%= process.env.PUBLIC_PATH %>/favicon.ico" will
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `pnpm build`.
--> -->
<title>React App</title> <title>React App</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
@ -24,9 +26,10 @@
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file. You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag. The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`. To begin the development, run `pnpm start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `pnpm build`.
--> -->
<%= htmlWebpackPlugin.tags.bodyTags %> <%= htmlWebpackPlugin.tags.bodyTags %>
</body> </body>
</html> </html>

16038
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

2
pnpm-workspace.yaml Normal file
View file

@ -0,0 +1,2 @@
packages:
- 'packages/*'

15665
yarn.lock

File diff suppressed because it is too large Load diff