Skip to content

Commit

Permalink
chore: use univer-cli instead of build.ts (#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai authored Nov 15, 2024
1 parent 8366613 commit 9ccdf2a
Show file tree
Hide file tree
Showing 191 changed files with 768 additions and 2,073 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ auto-install-peers=true
git-checks=false
strict-peer-dependencies=false
package-manager-strict=false
symlink=true
20 changes: 20 additions & 0 deletions common/shared/bin/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env -S npx tsx
/* eslint-disable header/header */

import type { IBuildOptions } from '../vite';
import process from 'node:process';
import { build } from '../vite';

const argvs = process.argv.slice(2);

const [command, ...args] = argvs;

if (command === 'build') {
const options: IBuildOptions = {};

if (args.includes('--skipUMD')) {
options.skipUMD = true;
}

build(options);
}
14 changes: 9 additions & 5 deletions common/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@
"./vite": "./vite/index.ts",
"./vitest": "./vitest/index.js"
},
"main": "bin/index.js",
"bin": {
"univer-cli": "bin/index.ts"
},
"dependencies": {
"@typescript-eslint/parser": "^8.13.0",
"@typescript-eslint/parser": "^8.14.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-vue": "^5.1.4",
"@vitest/coverage-istanbul": "^2.1.4",
"@vitejs/plugin-vue": "^5.2.0",
"@vitest/coverage-istanbul": "^2.1.5",
"fs-extra": "^11.2.0",
"happy-dom": "15.0.0",
"javascript-obfuscator": "^4.1.1",
"vite": "^5.4.10",
"vite": "^5.4.11",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-external": "^4.3.1",
"vitest": "^2.1.4"
"vitest": "^2.1.5"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4"
Expand Down
2 changes: 1 addition & 1 deletion common/shared/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async function buildUMD(sharedConfig: InlineConfig, options: IBuildExecuterOptio
}));
}

interface IBuildOptions {
export interface IBuildOptions {
/**
* Skip UMD build
* @default false
Expand Down
2 changes: 1 addition & 1 deletion examples-node/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/
src/locales.ts
locales.ts
Empty file removed examples-node/src/locales.ts
Empty file.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@types/react": "^18.3.11",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@univerjs-infra/shared": "workspace:*",
"detect-port": "^1.6.1",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@storybook/react": "8.3.5",
"@types/node": "^22.8.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@univerjs-infra/shared": "workspace:*",
"@univerjs/design": "workspace:*",
"@vitejs/plugin-react": "^4.3.3",
Expand Down
19 changes: 0 additions & 19 deletions packages-experimental/action-recorder/build.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages-experimental/action-recorder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -81,8 +81,8 @@
"react": "18.3.1",
"rxjs": "^7.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/action-recorder/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
21 changes: 0 additions & 21 deletions packages-experimental/debugger/build.ts

This file was deleted.

10 changes: 4 additions & 6 deletions packages-experimental/debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"scripts": {
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build --skipUMD"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -66,20 +66,18 @@
"@univerjs/sheets-drawing-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
"@univerjs/watermark": "workspace:*",
"@vitejs/plugin-react": "4.3.3",
"clsx": "^2.1.1"
},
"optionalDependencies": {
"vue": ">=3.0.0"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"@vitejs/plugin-vue": "^5.1.3",
"rxjs": "^7.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4",
"vue": "^3.5.3"
"vite": "^5.4.11",
"vitest": "^2.1.5",
"vue": "^3.5.12"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/debugger/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
19 changes: 0 additions & 19 deletions packages-experimental/uni-docs-ui/build.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages-experimental/uni-docs-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build"
},
"peerDependencies": {
"rxjs": ">=7.0.0"
Expand All @@ -74,8 +74,8 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/uni-docs-ui/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
19 changes: 0 additions & 19 deletions packages-experimental/uni-formula-ui/build.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages-experimental/uni-formula-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -85,8 +85,8 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/uni-formula-ui/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
19 changes: 0 additions & 19 deletions packages-experimental/uni-formula/build.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages-experimental/uni-formula/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build"
},
"dependencies": {
"@univerjs/core": "workspace:*",
Expand All @@ -64,8 +64,8 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/uni-formula/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
19 changes: 0 additions & 19 deletions packages-experimental/uni-sheets-ui/build.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages-experimental/uni-sheets-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"lint:types": "tsc --noEmit",
"build": "tsx build.ts"
"build": "univer-cli build"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -76,8 +76,8 @@
"@univerjs-infra/shared": "workspace:*",
"rxjs": "^7.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"space": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages-experimental/uni-sheets-ui/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"include": ["vitest.config.ts", "build.ts"]
"include": ["vitest.config.ts"]
}
19 changes: 0 additions & 19 deletions packages-experimental/uni-slides-ui/build.ts

This file was deleted.

Loading

0 comments on commit 9ccdf2a

Please sign in to comment.