From 4066d06f93c5f8661c024bc1d891153e07ab5193 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 21 Apr 2023 17:06:21 +0100 Subject: [PATCH] lite: standalone? --- .github/pull_request_template.md | 13 ++++++ .github/workflows/checks.yml | 61 ++++++++++++++++++++++++++++ .github/workflows/publish-canary.yml | 36 ++++++++++++++++ .github/workflows/publish-manual.yml | 35 ++++++++++++++++ .github/workflows/publish-new.yml | 43 ++++++++++++++++++++ .husky/post-checkout | 4 ++ .husky/pre-commit | 6 +++ public-yarn.lock | 40 ++---------------- 8 files changed, 201 insertions(+), 37 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/checks.yml create mode 100644 .github/workflows/publish-canary.yml create mode 100644 .github/workflows/publish-manual.yml create mode 100644 .github/workflows/publish-new.yml create mode 100755 .husky/post-checkout create mode 100755 .husky/pre-commit diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..9f981726d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +Describe what your pull request does. Link to any relevant linear issues. If appropriate, add GIFs or images showing the before and after. + +### Test Plan + +1. Add a step-by-step description of how to test your PR here. +2. + +- [ ] Unit Tests +- [ ] Webdriver tests + +### Release Note + +- Add a brief release note for your PR here. diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 000000000..802dd07f9 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,61 @@ +name: Checks + +on: + pull_request: + merge_group: + push: + branches: [main, lite] + +env: + CI: 1 + PRINT_GITHUB_ANNOTATIONS: 1 + +jobs: + build: + name: 'Build and run checks' + timeout-minutes: 15 + runs-on: ubuntu-latest-16-cores # TODO: this should probably run on multiple OSes + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Enable corepack + run: corepack enable + + - name: Install dependencies + run: yarn + + - name: Typecheck + run: yarn build:types + + - name: Check scripts + run: yarn check-scripts + + - name: Lint + run: yarn lint + + - name: Check API declarations and docs work as intended + run: yarn api:check + + - name: Pack public packages + run: yarn lazy pack-tarball + + - name: Build all projects + # the sed pipe makes sure that github annotations come through without + # turbo's prefix + run: "yarn build | sed -E 's/^@[a-zA-Z-]+\\/[a-z-]+:[a-z-]+: ::/::/'" + + - name: Test + run: yarn test + + - name: Check translations + run: yarn check-translations diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml new file mode 100644 index 000000000..81b1038a2 --- /dev/null +++ b/.github/workflows/publish-canary.yml @@ -0,0 +1,36 @@ +name: Publish Canary Packages + +on: + push: + branches: [main] + +jobs: + deploy: + name: 'Publish Canary Packages' + environment: npm deploy + timeout-minutes: 15 + runs-on: ubuntu-latest-16-cores + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Enable corepack + run: corepack enable + + - name: Install dependencies + run: yarn + + - name: Publish Canary Packages + run: yarn tsx ./scripts/publish-canary.ts + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-manual.yml b/.github/workflows/publish-manual.yml new file mode 100644 index 000000000..2055d56ff --- /dev/null +++ b/.github/workflows/publish-manual.yml @@ -0,0 +1,35 @@ +name: (Re)Publish public packages manually +# This only attempts to publish the public packages to npm. +# It does not bump the version, it does not update the changelogs, it does not create a github release. + +# Package publishing is manually triggered on github actions dashboard +on: workflow_dispatch + +jobs: + deploy: + name: '(Re)Publish public packages manually' + environment: npm deploy + timeout-minutes: 15 + runs-on: ubuntu-latest-16-cores + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Enable corepack + run: corepack enable + + - name: Install dependencies + run: yarn + + - name: Publish + run: yarn tsx ./scripts/publish-manual.ts + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-new.yml b/.github/workflows/publish-new.yml new file mode 100644 index 000000000..f6b6bcb86 --- /dev/null +++ b/.github/workflows/publish-new.yml @@ -0,0 +1,43 @@ +name: Publish new version of public packages +# This bumps the version, updates the changelogs, publishes a GitHub release, and publishes the packages to npm. + +# Package publishing is manually triggered on github actions dashboard +on: workflow_dispatch + +env: + YARN_RC_FILENAME: .yarnrc-private.yml + +jobs: + deploy: + name: 'Publish new version of public packages' + environment: npm deploy + timeout-minutes: 15 + runs-on: ubuntu-latest-16-cores + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + + - name: Prepare repository + # Fetch full git history and tags for auto + run: git fetch --unshallow --tags + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Enable corepack + run: corepack enable + + - name: Install dependencies + run: yarn + + - name: Publish + run: yarn tsx ./scripts/publish-new.ts + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.husky/post-checkout b/.husky/post-checkout new file mode 100755 index 000000000..2cbb3d818 --- /dev/null +++ b/.husky/post-checkout @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +rm -rf *.tsbuildinfo */*.tsbuildinfo */*/*.tsbuildinfo */*/*/*.tsbuildinfo */*/*/*/*.tsbuildinfo \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..02ffda72d --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lazy run build:api +git add packages/*/api-report.md +yarn lint-staged diff --git a/public-yarn.lock b/public-yarn.lock index d20c717fa..bc1191b05 100644 --- a/public-yarn.lock +++ b/public-yarn.lock @@ -4277,7 +4277,7 @@ __metadata: "@swc/core": ^1.2.204 "@swc/jest": ^0.2.21 "@tldraw/utils": "workspace:*" - lazyrepo: 0.0.0-alpha.17 + lazyrepo: 0.0.0-alpha.20 ts-node-dev: ^1.1.8 languageName: unknown linkType: soft @@ -5093,15 +5093,6 @@ __metadata: languageName: node linkType: hard -"@types/node-forge@npm:^1.3.1": - version: 1.3.2 - resolution: "@types/node-forge@npm:1.3.2" - dependencies: - "@types/node": "*" - checksum: f532326a616e946e5f6733d1461e7b8d31911bbdfbc480a6337c422053d79c1e22a0776d114a325439e26ae382a640f939d0abf156e24a3c3ca5079d04aa73f6 - languageName: node - linkType: hard - "@types/node@npm:*, @types/node@npm:^18.13.0": version: 18.15.12 resolution: "@types/node@npm:18.15.12" @@ -9444,8 +9435,8 @@ __metadata: concurrently: ^7.4.0 esbuild: ^0.16.7 ip: ^1.1.8 - kleur: ^4.1.5 - lazyrepo: 0.0.0-alpha.12 + lazyrepo: 0.0.0-alpha.20 + node-forge: ^1.3.1 react: ^18.2.0 react-dom: ^18.2.0 react-router-dom: ^6.9.0 @@ -12473,31 +12464,6 @@ __metadata: languageName: node linkType: hard -"lazyrepo@npm:0.0.0-alpha.17": - version: 0.0.0-alpha.17 - resolution: "lazyrepo@npm:0.0.0-alpha.17" - dependencies: - "@sindresorhus/slugify": ^2.2.0 - cac: ^6.7.14 - cross-spawn: ^7.0.3 - esbuild: ^0.17.15 - fast-glob: ^3.2.12 - fast-json-stable-stringify: ^2.1.0 - micromatch: ^4.0.5 - picocolors: ^1.0.0 - slice-ansi: ^6.0.0 - source-map-support: ^0.5.21 - strip-ansi: ^7.0.1 - ts-dedent: ^2.2.0 - yaml: ^2.2.1 - zod: ^3.21.4 - zod-validation-error: ^1.3.0 - bin: - lazy: bin.js - checksum: c900bd0e9f0c1b59ce55fc7a5d90c8ea6be19e1ea77b7bb0c35faf3258074617d0c26bec5ff688cd7b54f4bc1de9c46927524d5d34ece0b57ab292f965547add - languageName: node - linkType: hard - "lazyrepo@npm:0.0.0-alpha.20": version: 0.0.0-alpha.20 resolution: "lazyrepo@npm:0.0.0-alpha.20"