From 70888327a36f39b3c882635265865e29efb8ab28 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Wed, 19 Jul 2023 22:07:18 +0530 Subject: [PATCH] fix: use subdirectory for @excalidraw/excalidraw size limit (#6787) * fix: use subdirectory for @excalidraw/excalidraw size limit * fix * update yml * update path * fix * fix * better --- .github/workflows/size-limit.yml | 8 +++++++- package.json | 13 ++----------- scripts/buildPackageExcalidraw.js | 16 ---------------- src/packages/excalidraw/package.json | 13 +++++++++++-- 4 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 scripts/buildPackageExcalidraw.js diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 119cc8c3..8ced8ee0 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -15,10 +15,16 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.x + - name: Install + run: yarn --frozen-lockfile + - name: Install in src/packages/excalidraw + run: yarn --frozen-lockfile + working-directory: src/packages/excalidraw env: CI: true - uses: andresz1/size-limit-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - build_script: size + build_script: build:umd skip_step: install + directory: src/packages/excalidraw diff --git a/package.json b/package.json index 44251d31..a2fece25 100644 --- a/package.json +++ b/package.json @@ -145,15 +145,6 @@ "test:coverage": "react-scripts test --passWithNoTests --coverage --watchAll", "autorelease": "node scripts/autorelease.js", "prerelease": "node scripts/prerelease.js", - "release": "node scripts/release.js", - "size": "node scripts/buildPackageExcalidraw.js && size-limit" - }, - "size-limit": [ - { - "path": [ - "src/packages/excalidraw/dist/excalidraw.development.js", - "src/packages/excalidraw/dist/excalidraw.production.min.js" - ] - } - ] + "release": "node scripts/release.js" + } } diff --git a/scripts/buildPackageExcalidraw.js b/scripts/buildPackageExcalidraw.js deleted file mode 100644 index 4e323411..00000000 --- a/scripts/buildPackageExcalidraw.js +++ /dev/null @@ -1,16 +0,0 @@ -const { execSync } = require("child_process"); - -const excalidrawDir = `${__dirname}/../src/packages/excalidraw`; - -const build = () => { - try { - execSync(`yarn --frozen-lockfile`); - execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir }); - execSync(`yarn run build:umd`, { cwd: excalidrawDir }); - } catch (err) { - console.error(err); - process.exit(1); - } -}; - -build(); diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json index 27ce245e..c1998bf8 100644 --- a/src/packages/excalidraw/package.json +++ b/src/packages/excalidraw/package.json @@ -80,6 +80,15 @@ "pack": "yarn build:umd && yarn pack", "start": "webpack serve --config webpack.dev-server.config.js", "install:deps": "yarn install --frozen-lockfile && yarn --cwd ../../../", - "build:example": "EXAMPLE=true webpack --config webpack.dev-server.config.js && yarn gen:types" - } + "build:example": "EXAMPLE=true webpack --config webpack.dev-server.config.js && yarn gen:types", + "size": "yarn build:umd && size-limit" + }, + "size-limit": [ + { + "path": "dist/excalidraw.development.js" + }, + { + "path": "dist/excalidraw.production.min.js" + } + ] }