Skip to content

Commit 46eba14

Browse files
authored
Migrate to pnpm and changesets (#3079)
1 parent f4074d9 commit 46eba14

File tree

79 files changed

+23909
-28041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+23909
-28041
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "v2",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"privatePackages": {
12+
"tag": false,
13+
"version": false
14+
}
15+
}

.changeset/fuzzy-wolves-lie.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"create-typescript-playground-plugin": patch
3+
"@typescript/vfs": patch
4+
"@typescript/twoslash": patch
5+
"@typescript/sandbox": patch
6+
"@typescript/ata": patch
7+
---
8+
9+
Initial bump for changesets

.devcontainer/Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:14
6+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:20
77

88
# The javascript-node image includes a non-root node user with sudo access. Use
99
# the "remoteUser" property in devcontainer.json to use it. On Linux, the container
@@ -21,7 +21,4 @@ RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
2121
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
2222
&& chmod -R $USER_UID:$USER_GID /home/$USERNAME \
2323
&& chmod -R $USER_UID:root /usr/local/share/nvm /usr/local/share/npm-global; \
24-
fi \
25-
#
26-
# Install tslint, typescript. eslint is installed by javascript image
27-
&& sudo -u ${USERNAME} npm install -g tslint typescript yarn
24+
fi

.devcontainer/devcontainer.json

-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@
88
},
99

1010
"forwardPorts": [8000],
11-
12-
// Use 'postCreateCommand' to run commands after the container is created.
13-
"postCreateCommand": "sudo yarn install && sudo yarn bootstrap && yarn start"
1411
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -text

.github/workflows/CI.yml

+52-34
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,55 @@ on:
44
branches:
55
- v2
66

7+
# Ensure scripts are run with pipefail. See:
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
9+
defaults:
10+
run:
11+
shell: bash
12+
713
jobs:
814
tests:
9-
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- ubuntu-latest
20+
- windows-latest
21+
- macos-latest
22+
23+
runs-on: ${{ matrix.os }}
24+
1025
steps:
11-
# Check out, and set up the node/ruby infra
1226
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
1327
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
1428
with:
1529
node-version: "18.x"
30+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
1631

17-
# Install, should be basically instant if cached
18-
- run: yarn install
19-
env:
20-
YARN_CHECKSUM_BEHAVIOR: ignore
21-
22-
# Verify dependencies are hooked up right
23-
- run: node test/verifyPackageVersions.js
32+
- run: pnpm install
2433

2534
# Grab localizations
26-
- run: yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
35+
- run: pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
2736

2837
# Build the packages
29-
- run: yarn bootstrap
30-
- run: yarn build
38+
- run: pnpm bootstrap
39+
- run: pnpm build
3140

3241
# Verify it compiles
33-
- run: yarn build-site
42+
- run: pnpm build-site
3443

3544
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
36-
if: github.event_name == 'pull_request'
45+
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
3746
with:
3847
name: site
3948
path: packages/typescriptlang-org/public
4049

4150
# Run all the package's tests
42-
- run: yarn test
43-
env:
44-
CI: true
51+
- run: pnpm test
4552

4653
# danger for PR builds
47-
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
48-
run: "yarn danger ci"
54+
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id && matrix.os == 'ubuntu-latest'
55+
run: "pnpm danger ci"
4956
env:
5057
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5158

@@ -69,30 +76,41 @@ jobs:
6976
name: missing.patch
7077
path: missing.patch
7178

72-
windows:
73-
runs-on: windows-latest
74-
79+
changesets:
80+
name: changesets
81+
runs-on: ubuntu-latest
7582
steps:
76-
# Check out, and set up the node infra
77-
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
78-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
79-
with:
80-
node-version: "18.x"
83+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
84+
with:
85+
fetch-depth: 0
86+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
87+
with:
88+
node-version: 'lts/*'
89+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
90+
91+
- run: pnpm install
92+
93+
- name: Check for missing changesets
94+
run: |
95+
PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
96+
MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
8197
82-
# Get local dependencies
83-
- run: yarn install
84-
env:
85-
YARN_CHECKSUM_BEHAVIOR: ignore
98+
# If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit
99+
if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then
100+
echo "This PR is a versioning PR, exiting"
101+
exit 0
102+
fi
86103
87-
- run: yarn bootstrap
88-
- run: yarn build
104+
# git switch -c changesets-temp
105+
# git checkout origin/v2 -- <ignored files>
106+
pnpm changeset status --since=origin/v2
89107
90108
required:
91109
runs-on: ubuntu-latest
92110
if: ${{ always() }}
93111
needs:
94112
- tests
95-
- windows
113+
- changesets
96114

97115
steps:
98116
- name: Check required jobs

.github/workflows/deploy-prod-static.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,22 @@ jobs:
3333
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
3434
with:
3535
node-version: "18.x"
36-
cache: yarn
36+
37+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
3738

3839
# Builds the modules, and boostraps the other modules
3940
- name: Build website
4041
run: |
41-
yarn install
42-
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
43-
yarn bootstrap
44-
yarn workspace typescriptlang-org setup-playground-cache-bust
45-
yarn build
46-
env:
47-
YARN_CHECKSUM_BEHAVIOR: ignore
42+
pnpm install
43+
pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
44+
pnpm bootstrap
45+
pnpm run --filter=typescriptlang-org setup-playground-cache-bust
46+
pnpm build
4847
4948
- name: Makes the site
5049
run: |
51-
yarn build-site
50+
pnpm build-site
5251
cp -r packages/typescriptlang-org/public site
53-
env:
54-
YARN_CHECKSUM_BEHAVIOR: ignore
5552
5653
- name: Setup Pages
5754
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

.github/workflows/publish-packages.yml

+19-16
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,43 @@ on:
55
branches: [v2]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
814
jobs:
915
build:
1016
runs-on: ubuntu-latest
1117

1218
steps:
13-
# Check out, and set up the node/ruby infra
1419
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
1520
with:
16-
# Fetch the full history, to build attribution.json
1721
fetch-depth: 0
22+
filter: blob:none
1823
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
1924
with:
2025
node-version: "18.x"
2126
registry-url: "https://registry.npmjs.org/"
22-
cache: yarn
27+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
2328

2429
- name: Prepare website v2
2530
run: |
26-
yarn install
27-
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
28-
yarn bootstrap
29-
yarn workspace typescriptlang-org setup-playground-cache-bust
30-
yarn build
31-
env:
32-
YARN_CHECKSUM_BEHAVIOR: ignore
31+
pnpm install
32+
pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
33+
pnpm bootstrap
34+
pnpm run --filter=typescriptlang-org setup-playground-cache-bust
35+
pnpm build
3336
3437
- name: Build website v2
3538
run: |
36-
yarn build-site
39+
pnpm build-site
3740
cp -r packages/typescriptlang-org/public site
3841
39-
# Deploy
40-
- name: Deploy npm Packages
41-
run: |
42-
yarn pleb publish
42+
- uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
43+
with:
44+
publish: pnpm ci:publish
4345
env:
44-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shell-emulator=true

.yarn/.gitattributes

-1
This file was deleted.

0 commit comments

Comments
 (0)