Skip to content

Commit cbfd968

Browse files
authored
fix: remove npm workspaces and use lerna to bootstrap monorepo (#1111)
1 parent 8b27a45 commit cbfd968

20 files changed

+17775
-8216
lines changed

.github/workflows/1_2_b_bump_extension_only.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
node-version: '16'
2929
cache: 'npm'
3030
- name: Install Dependencies
31-
run: npm install
31+
run: npm install && npm run bootstrap
3232
- name: Extract branch name # needed because github.ref will contain sth like refs/heads/2.6.x, so pushing to that will fail
3333
shell: bash
3434
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
@@ -53,7 +53,7 @@ jobs:
5353
run: |
5454
node scripts/update_package_json_files.js dev ${{ steps.update.outputs.next_extension_version }} ""
5555
- name: Install Dependencies
56-
run: npm install
56+
run: npm install && npm run bootstrap
5757
- name: Commit and Push
5858
run: |
5959
sh scripts/commit_and_push.sh "bump extension version in package.json to ${{ steps.update.outputs.next_extension_version }}." ${{ steps.setup_branch.outputs.new_branch }}

.github/workflows/1_2_c_promote_patch_to_stable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
node-version: '16'
2323
cache: 'npm'
2424
- name: Install Dependencies
25-
run: npm install
25+
run: npm install && npm run bootstrap
2626
- name: Checkout main
2727
run: git fetch && git checkout main
2828
- name: Setup Git
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
node scripts/update_package_json_files.js latest ${{ steps.update.outputs.next_extension_version }} ""
4545
- name: Install Dependencies
46-
run: npm install
46+
run: npm install && npm run bootstrap
4747
- name: Commit and Push
4848
run: |
4949
sh scripts/commit_and_push.sh "bump extension version in package.json to ${{ steps.update.outputs.next_extension_version }}."

.github/workflows/2_bump_versions.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
node-version: '16'
2727
cache: 'npm'
2828
- name: Install Dependencies
29-
run: npm install
29+
run: npm install && npm run bootstrap
3030
- name: Setup Git
3131
run: |
3232
sh scripts/set_git_credentials.sh
@@ -62,7 +62,7 @@ jobs:
6262
run: |
6363
node scripts/update_package_json_files.js ${{ github.event.inputs.npm_channel }} ${{ steps.update.outputs.next_extension_version }} ${{ github.event.inputs.version }}
6464
- name: Install Dependencies to update lock file
65-
run: npm install
65+
run: npm install && npm run bootstrap
6666
- name: Push to branch
6767
run: |
6868
sh scripts/commit_and_push.sh "bump extension version to ${{ steps.update.outputs.next_extension_version }} in package.json" ${{ steps.setup_branch.outputs.branch}} ${{ steps.setup_branch.outputs.new_branch }}

.github/workflows/3_LS_tests_publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
node-version: '16'
3737
cache: 'npm'
3838
- name: Install Dependencies
39-
run: npm install
39+
run: npm install && npm run bootstrap
4040
- name: Build Language Server
41-
run: npm run build --workspace @prisma/language-server
41+
run: npx lerna run build --scope @prisma/language-server
4242
- name: Run Language Server tests
43-
run: npm run test --workspace @prisma/language-server
43+
run: npx lerna run test --scope @prisma/language-server
4444

4545
bump:
4646
name: Bump Language Server version
@@ -64,11 +64,11 @@ jobs:
6464
echo ${{github.event.inputs.branch}}
6565
echo ${{github.event.inputs.trigger_reason}}
6666
- name: Install Dependencies
67-
run: npm install
67+
run: npm install && npm run bootstrap
6868
- name: Build Language Server
69-
run: npm run build --workspace @prisma/language-server
69+
run: npx lerna run build --scope @prisma/language-server
7070
- name: Publish Language Server to npm
71-
run: npm publish --workspace @prisma/language-server --tag ${{ github.event.inputs.npm_channel }} --access public
71+
run: npx lerna exec npm publish --scope @prisma/language-server --tag ${{ github.event.inputs.npm_channel }} --access public
7272
env:
7373
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7474

.github/workflows/4_bump_LS_in_extension.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
echo ${{github.event.inputs.branch}}
4141
echo ${{github.event.inputs.trigger_reason}}
4242
- name: Install Dependencies
43-
run: npm install
43+
run: npm install && npm run bootstrap
4444
- name: Bump LS version in extension
4545
run: |
4646
node scripts/update_package_json_files.js ${{ github.event.inputs.extension_version }}
4747
- name: Install Dependencies
48-
run: npm install
48+
run: npm install && npm run bootstrap
4949
- name: Setup Git
5050
run: |
5151
sh scripts/set_git_credentials.sh

.github/workflows/5_e2e_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
node-version: '16'
3838
- name: Install Dependencies
39-
run: npm install
39+
run: npm install && npm run bootstrap
4040
- name: Compile
4141
run: npm run compile
4242
- name: Headless e2e tests

.github/workflows/6_build.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/setup-node@v3
3939
with:
4040
node-version: '16'
41-
# cache: 'npm'
41+
cache: 'npm'
4242
- name: Print inputs
4343
run: |
4444
echo ${{github.event.inputs.npm_channel}}
@@ -48,15 +48,11 @@ jobs:
4848
4949
# Build the extension
5050
- name: Install Dependencies
51-
run: npm install
51+
run: npm install && npm run bootstrap
5252
- name: Build all packages
5353
run: npm run compile
5454
- name: Replace Readme for marketplace
5555
run: node scripts/change_readme.js ${{ github.event.inputs.npm_channel }}
56-
- name: Delete node_modules because of npm workspaces and vsce incompatibility
57-
run: rm -rf node_modules
58-
- name: Install dependencies in ./packages/vscode
59-
run: cd packages/vscode && npm install
6056
- name: Build vsix
6157
run: cd packages/vscode && npm run package --
6258

.github/workflows/7_publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
echo ${{github.event.inputs.tag_name}}
4343
echo ${{github.event.inputs.trigger_reason}}
4444
- name: Install Dependencies
45-
run: npm install
45+
run: npm install && npm run bootstrap
4646

4747
# Download Asset from GH release and publish to VSCode marketplace
4848
- uses: dsaltares/fetch-gh-release-asset@master
@@ -93,7 +93,7 @@ jobs:
9393
run: |
9494
echo ${{github.event.inputs.trigger_reason}}
9595
- name: Install Dependencies
96-
run: npm install
96+
run: npm install && npm run bootstrap
9797

9898
# Download Asset from GH release and publish to open-vsx
9999
- uses: dsaltares/fetch-gh-release-asset@master

.github/workflows/PR_build_extension.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636

3737
# Build the extension
3838
- name: Install Dependencies
39-
run: npm install
39+
run: npm install && npm run bootstrap
4040
- name: Build all packages
4141
run: npm run compile
42-
- run: rm -rf node_modules
43-
- run: cd packages/vscode && npm install
42+
- name: Replace Readme for marketplace
43+
run: node scripts/change_readme.js dev
4444
- name: Build vsix
4545
run: cd packages/vscode && npm run package -- --out=prisma.vsix
4646

.github/workflows/continuous-integration.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
node-version: '16'
2828
cache: 'npm'
2929
- name: Install Dependencies
30-
run: npm install
30+
run: npm install && npm run bootstrap
3131
- name: Build all packages
3232
run: npm run compile
3333
- name: Run Language Server tests
34-
run: npm run test --workspace @prisma/language-server
34+
run: npx lerna run test --scope @prisma/language-server
3535
- name: Run VS Code extension tests in headless mode
3636
uses: GabrielBB/[email protected]
3737
with:

.github/workflows/e2e_published_vsix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
node-version: '16'
3535
cache: 'npm'
3636
- name: Install Dependencies
37-
run: npm install
37+
run: npm install && npm run bootstrap
3838
- name: Install extension via CLI
3939
id: install
4040
run: |

lerna.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"packages": ["packages/*"],
3+
"version": "0.0.0"
4+
}

0 commit comments

Comments
 (0)