Skip to content

Migrate to pnpm and changesets #3079

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

Merged
merged 44 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bb6445e
Use corepack
jakebailey Apr 25, 2024
adee580
Some progress
jakebailey Apr 25, 2024
4954dbf
wow
jakebailey Apr 25, 2024
9636979
ok more
jakebailey Apr 25, 2024
a2463fe
glob
jakebailey Apr 25, 2024
e831aee
Drop script entirely
jakebailey Apr 25, 2024
c4fced4
node-fetch
jakebailey Apr 25, 2024
b0a8f14
Make it work on windows
jakebailey Apr 25, 2024
0ceb303
Lift chalk
jakebailey Apr 25, 2024
3055710
Lift remark stuff
jakebailey Apr 25, 2024
6a8f731
Merge branch 'v2' into pnpm
jakebailey May 15, 2024
89d87b3
Bump pnpm
jakebailey May 15, 2024
1cffc83
Add changesets
jakebailey May 15, 2024
b0c58f8
hoist some deps I guess
jakebailey May 15, 2024
cf6e5f2
preact dev dep
jakebailey May 15, 2024
ab96eec
Glossary
jakebailey May 15, 2024
8d69d42
monaco
jakebailey May 15, 2024
6d57eff
Hack resolution
jakebailey May 15, 2024
ff8a995
More deps
jakebailey May 15, 2024
45c1cd0
empty
jakebailey May 16, 2024
a8d8942
empty
jakebailey May 16, 2024
95df3b3
Force transitive deps on vfs/twoslash to monorepo
jakebailey May 16, 2024
f01c160
CI updates
jakebailey May 16, 2024
4fd81b4
Check changesets
jakebailey May 16, 2024
e166391
Changeset bump
jakebailey May 16, 2024
d50fb28
Bump pnpm because node-gyp
jakebailey May 16, 2024
066921d
Check changesets separately so it doesn't block preview deploy
jakebailey May 16, 2024
c22e1cd
Don't upload in all jobs
jakebailey May 16, 2024
57cf713
Deal with slashes on windows for now
jakebailey May 16, 2024
ca4aeed
Fix sorting of filename
jakebailey May 16, 2024
d4b7113
Force cloning to not change newlines
jakebailey May 16, 2024
99bcc7e
Normalize slashes for attribution
jakebailey May 17, 2024
4bf3efa
more file sorting
jakebailey May 17, 2024
8e2cd15
Remove noops, not needed in pnpm
jakebailey May 17, 2024
01c1e7d
Fix prod deploy
jakebailey May 17, 2024
6d6e606
Update changesets
jakebailey May 17, 2024
5ffd5ad
Some dep cleanup
jakebailey May 17, 2024
04f9cc1
jest
jakebailey May 17, 2024
a46eb21
Document changesets
jakebailey May 17, 2024
2982b1d
Merge branch 'v2' into pnpm
jakebailey May 20, 2024
cfa4562
Bump changeset
jakebailey May 20, 2024
ae4d496
Bump pnpm
jakebailey May 20, 2024
7784208
move changesets to CI yaml now that the required task exits
jakebailey May 20, 2024
b39d16e
Fix some diffs found in package outputs
jakebailey May 21, 2024
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "v2",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"tag": false,
"version": false
}
}
9 changes: 9 additions & 0 deletions .changeset/fuzzy-wolves-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"create-typescript-playground-plugin": patch
"@typescript/vfs": patch
"@typescript/twoslash": patch
"@typescript/sandbox": patch
"@typescript/ata": patch
---

Initial bump for changesets
7 changes: 2 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

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

# The javascript-node image includes a non-root node user with sudo access. Use
# the "remoteUser" property in devcontainer.json to use it. On Linux, the container
Expand All @@ -21,7 +21,4 @@ RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
&& chmod -R $USER_UID:$USER_GID /home/$USERNAME \
&& chmod -R $USER_UID:root /usr/local/share/nvm /usr/local/share/npm-global; \
fi \
#
# Install tslint, typescript. eslint is installed by javascript image
&& sudo -u ${USERNAME} npm install -g tslint typescript yarn
fi
3 changes: 0 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@
},

"forwardPorts": [8000],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo yarn install && sudo yarn bootstrap && yarn start"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
86 changes: 52 additions & 34 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,55 @@ on:
branches:
- v2

# Ensure scripts are run with pipefail. See:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
defaults:
run:
shell: bash

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest

runs-on: ${{ matrix.os }}

steps:
# Check out, and set up the node/ruby infra
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "18.x"
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

# Install, should be basically instant if cached
- run: yarn install
env:
YARN_CHECKSUM_BEHAVIOR: ignore

# Verify dependencies are hooked up right
- run: node test/verifyPackageVersions.js
- run: pnpm install

# Grab localizations
- run: yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
- run: pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1

# Build the packages
- run: yarn bootstrap
- run: yarn build
- run: pnpm bootstrap
- run: pnpm build

# Verify it compiles
- run: yarn build-site
- run: pnpm build-site

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

# Run all the package's tests
- run: yarn test
env:
CI: true
- run: pnpm test

# danger for PR builds
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
run: "yarn danger ci"
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id && matrix.os == 'ubuntu-latest'
run: "pnpm danger ci"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -69,30 +76,41 @@ jobs:
name: missing.patch
path: missing.patch

windows:
runs-on: windows-latest

changesets:
name: changesets
runs-on: ubuntu-latest
steps:
# Check out, and set up the node infra
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "18.x"
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- run: pnpm install

- name: Check for missing changesets
run: |
PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)

# Get local dependencies
- run: yarn install
env:
YARN_CHECKSUM_BEHAVIOR: ignore
# If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit
if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then
echo "This PR is a versioning PR, exiting"
exit 0
fi

- run: yarn bootstrap
- run: yarn build
# git switch -c changesets-temp
# git checkout origin/v2 -- <ignored files>
pnpm changeset status --since=origin/v2

required:
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- tests
- windows
- changesets

steps:
- name: Check required jobs
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/deploy-prod-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,22 @@ jobs:
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "18.x"
cache: yarn

- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

# Builds the modules, and boostraps the other modules
- name: Build website
run: |
yarn install
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
yarn bootstrap
yarn workspace typescriptlang-org setup-playground-cache-bust
yarn build
env:
YARN_CHECKSUM_BEHAVIOR: ignore
pnpm install
pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
pnpm bootstrap
pnpm run --filter=typescriptlang-org setup-playground-cache-bust
pnpm build

- name: Makes the site
run: |
yarn build-site
pnpm build-site
cp -r packages/typescriptlang-org/public site
env:
YARN_CHECKSUM_BEHAVIOR: ignore

- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,43 @@ on:
branches: [v2]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest

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

- name: Prepare website v2
run: |
yarn install
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
yarn bootstrap
yarn workspace typescriptlang-org setup-playground-cache-bust
yarn build
env:
YARN_CHECKSUM_BEHAVIOR: ignore
pnpm install
pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
pnpm bootstrap
pnpm run --filter=typescriptlang-org setup-playground-cache-bust
pnpm build

- name: Build website v2
run: |
yarn build-site
pnpm build-site
cp -r packages/typescriptlang-org/public site

# Deploy
- name: Deploy npm Packages
run: |
yarn pleb publish
- uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
with:
publish: pnpm ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shell-emulator=true
1 change: 0 additions & 1 deletion .yarn/.gitattributes

This file was deleted.

Loading