From 9306d9fcdcd187666a7789ec01a6c13f09b03489 Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Tue, 14 May 2024 20:36:35 +0100 Subject: [PATCH 1/3] chore: configure dockview-react package --- .codesandbox/ci.json | 1 + .github/workflows/deploy-docs.yml | 2 ++ .github/workflows/publish.yml | 6 ++++++ packages/dockview-react/package.json | 8 ++++---- packages/dockview-react/scripts/copy-css.js | 13 +++++++++++++ scripts/set-experimental-versions.js | 2 +- tsconfig.json | 6 ++++++ 7 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 packages/dockview-react/scripts/copy-css.js diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index 23c5a9b2c..60af87ecb 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -2,6 +2,7 @@ "packages": [ "packages/dockview-core", "packages/dockview-vue", + "packages/dockview-react", "packages/dockview" ], "sandboxes": [ diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index b8f24b0d3..8bb8caa39 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -28,6 +28,8 @@ jobs: working-directory: packages/dockview - run: npm run build working-directory: packages/dockview-vue + - run: npm run build + working-directory: packages/dockview-react - run: npm run build working-directory: packages/docs - run: npm run docs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 090304bdf..0540de266 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,6 +38,9 @@ jobs: - name: Publish dockview-vue run: npm publish --provenance working-directory: packages/dockview-vue + - name: Publish dockview-react + run: npm publish --provenance + working-directory: packages/dockview-react publish-experimental: if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest @@ -70,3 +73,6 @@ jobs: - name: Publish dockview-vue run: npm publish --provenance --tag experimental working-directory: packages/dockview-vue + - name: Publish dockview-react + run: npm publish --provenance --tag experimental + working-directory: packages/dockview-react diff --git a/packages/dockview-react/package.json b/packages/dockview-react/package.json index 93c2b4f0c..decb6e7b0 100644 --- a/packages/dockview-react/package.json +++ b/packages/dockview-react/package.json @@ -44,16 +44,16 @@ "build": "npm run build:package && npm run build:bundles", "build:bundles": "rollup -c", "build:cjs": "cross-env ../../node_modules/.bin/tsc --build ./tsconfig.json --verbose --extendedDiagnostics", - "build:css": "gulp sass", + "build:css": "node scripts/copy-css.js", "build:esm": "cross-env ../../node_modules/.bin/tsc --build ./tsconfig.esm.json --verbose --extendedDiagnostics", "build:package": "npm run build:cjs && npm run build:esm && npm run build:css", "clean": "rimraf dist/ .build/ .rollup.cache/", "prepublishOnly": "npm run rebuild && npm run test", "rebuild": "npm run clean && npm run build", - "test": "cross-env ../../node_modules/.bin/jest --selectProjects dockview", - "test:cov": "cross-env ../../node_modules/.bin/jest --selectProjects dockview --coverage" + "test": "cross-env ../../node_modules/.bin/jest --selectProjects dockview-react", + "test:cov": "cross-env ../../node_modules/.bin/jest --selectProjects dockview-react --coverage" }, "dependencies": { "dockview": "^1.13.1" } -} +} \ No newline at end of file diff --git a/packages/dockview-react/scripts/copy-css.js b/packages/dockview-react/scripts/copy-css.js new file mode 100644 index 000000000..2a3b11c43 --- /dev/null +++ b/packages/dockview-react/scripts/copy-css.js @@ -0,0 +1,13 @@ +const path = require('path'); +const fs = require('fs'); + +const outDir = path.join(__dirname, '../dist/styles'); + +if (!fs.existsSync(outDir)) { + fs.mkdirSync(outDir); +} + +fs.copyFileSync( + path.join(__dirname, '../../dockview-core/dist/styles/dockview.css'), + path.join(outDir, 'dockview.css') +); diff --git a/scripts/set-experimental-versions.js b/scripts/set-experimental-versions.js index 1c14cb38d..16212f867 100644 --- a/scripts/set-experimental-versions.js +++ b/scripts/set-experimental-versions.js @@ -50,7 +50,7 @@ fs.writeFileSync( // dockview -const depPackages = ['dockview', 'dockview-vue']; +const depPackages = ['dockview', 'dockview-vue', 'dockview-react']; for (const depPackage of depPackages) { const dockviewPath = path.join( diff --git a/tsconfig.json b/tsconfig.json index d22e10685..b154c4998 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,12 @@ }, { "path": "./packages/dockview-vue" + }, + { + "path": "./packages/dockview-react" + }, + { + "path": "./packages/dockview-angular" } ] } From 3fcbf6515ecda9798420f2d2b872f6a8ef9b82ec Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Tue, 14 May 2024 20:37:45 +0100 Subject: [PATCH 2/3] chore: configure dockview-vue package --- packages/dockview-vue/package.json | 3 ++- packages/dockview-vue/scripts/copy-css.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/dockview-vue/scripts/copy-css.js diff --git a/packages/dockview-vue/package.json b/packages/dockview-vue/package.json index bfbdce884..3ef44ef00 100644 --- a/packages/dockview-vue/package.json +++ b/packages/dockview-vue/package.json @@ -43,7 +43,8 @@ "scripts": { "build:js": "vite build", "build:types": "vue-tsc --project tsconfig.build-types.json --declaration --emitDeclarationOnly --outDir dist/types", - "build": "npm run build:js && npm run build:types", + "build:css": "node scripts/copy-css.js", + "build": "npm run build:js && npm run build:types && npm run build:css", "clean": "rimraf dist/ .build/ .rollup.cache/", "prepublishOnly": "npm run rebuild && npm run test", "rebuild": "npm run clean && npm run build", diff --git a/packages/dockview-vue/scripts/copy-css.js b/packages/dockview-vue/scripts/copy-css.js new file mode 100644 index 000000000..2a3b11c43 --- /dev/null +++ b/packages/dockview-vue/scripts/copy-css.js @@ -0,0 +1,13 @@ +const path = require('path'); +const fs = require('fs'); + +const outDir = path.join(__dirname, '../dist/styles'); + +if (!fs.existsSync(outDir)) { + fs.mkdirSync(outDir); +} + +fs.copyFileSync( + path.join(__dirname, '../../dockview-core/dist/styles/dockview.css'), + path.join(outDir, 'dockview.css') +); From e3eb851ab778501c75940d1f13f2edfc58912ff9 Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Tue, 14 May 2024 20:42:33 +0100 Subject: [PATCH 3/3] chore: configure dockview-react package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9f51a541..3d17caa64 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "packages/*" ], "scripts": { - "build": "lerna run build --scope '{dockview-core,dockview,dockview-vue}'", + "build": "lerna run build --scope '{dockview-core,dockview,dockview-vue,dockview-react}'", "clean": "lerna run clean", "docs": "typedoc", "generate-docs": "node scripts/docs.mjs",