Skip to content

Commit

Permalink
feat: update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Aug 17, 2024
1 parent 45268ef commit f90af3d
Show file tree
Hide file tree
Showing 12 changed files with 1,075 additions and 3,065 deletions.
39 changes: 8 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,26 @@
"release": "release-it"
},
"dependencies": {
"@inquirer/prompts": "^5.0.4",
"@univerjs/core": "^0.1.11",
"@univerjs/design": "^0.1.11",
"@univerjs/docs": "^0.1.11",
"@univerjs/docs-ui": "^0.1.11",
"@univerjs/engine-formula": "^0.1.11",
"@univerjs/engine-numfmt": "^0.1.11",
"@univerjs/engine-render": "^0.1.11",
"@univerjs/facade": "^0.1.11",
"@univerjs/find-replace": "^0.1.11",
"@univerjs/network": "^0.1.11",
"@univerjs/rpc": "^0.1.11",
"@univerjs/sheets": "^0.1.11",
"@univerjs/sheets-formula": "^0.1.11",
"@univerjs/sheets-numfmt": "^0.1.11",
"@univerjs/sheets-ui": "^0.1.11",
"@univerjs/sheets-zen-editor": "^0.1.11",
"@univerjs/ui": "^0.1.11",
"@univerjs/uniscript": "^0.1.11",
"@wendellhu/redi": "^0.15.2",
"clsx": "^2.1.1",
"@inquirer/prompts": "^5.3.8",
"commander": "^12.1.0",
"consola": "^3.2.3",
"ejs": "^3.1.10",
"fs-extra": "^11.2.0",
"os-locale": "^6.0.2",
"react": "18.2.0",
"react-dom": "^18.3.1",
"rxjs": "^7.8.1"
"os-locale": "^6.0.2"
},
"devDependencies": {
"@antfu/eslint-config": "^2.18.1",
"@antfu/eslint-config": "^2.26.0",
"@release-it/conventional-changelog": "^8.0.1",
"@types/ejs": "^3.1.5",
"@types/fs-extra": "^11.0.4",
"esbuild": "^0.21.3",
"esbuild": "^0.23.1",
"esbuild-plugin-clean": "^1.0.1",
"eslint": "^8.57.0",
"lint-staged": "^15.2.2",
"eslint": "^9.9.0",
"lint-staged": "^15.2.9",
"minimist": "^1.2.8",
"release-it": "^17.2.1",
"release-it": "^17.6.0",
"simple-git-hooks": "^2.11.1",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
Expand Down
3,892 changes: 1,042 additions & 2,850 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

129 changes: 0 additions & 129 deletions src/bundle/index.ts

This file was deleted.

7 changes: 2 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { select } from '@inquirer/prompts'
import { consola } from 'consola'
import { localeInstance, t } from './i18n'
import { create } from './create'
import { bundle } from './bundle'
import type { ICliOptions } from './types'

export async function cli(options: ICliOptions) {
Expand All @@ -16,14 +15,12 @@ export async function cli(options: ICliOptions) {
choices: [{
name: t('cli.feature.choices.create'),
value: create,
}, {
name: t('cli.feature.choices.bundle'),
value: bundle,
}],
})

feature(options)
feature()
} catch (error) {
consola.info(t('error.exit'))
consola.error(error)
}
}
7 changes: 0 additions & 7 deletions src/i18n/en-US.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const locale = {
'cli.feature.message': '👋 Hey, what do you want to do today?',
'cli.feature.choices.create': '🔌 Create a new univer plugin',
'cli.feature.choices.bundle': '📦 Build your own UMD bundle',

'create.choices.path': '📝 Please input a path to create a new plugin',
'create.choices.template': '📦 Which template would you like to use?',
Expand All @@ -16,12 +15,6 @@ const locale = {

'create.success': '🎉 Successfully created a new plugin',

'bundle.choices.path': '📝 Please enter the output path',
'bundle.choices.react': '🏗️ Already used React in your project?',
'bundle.choices.rxjs': '🚛 Already used RxJS in your project?',
'bundle.success.css': '🎉 CSS bundle generated successfully',
'bundle.success.js': '🎉 JS bundle generated successfully',

'error.exit': 'Goodbye 👋',
}

Expand Down
7 changes: 0 additions & 7 deletions src/i18n/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type enUS from './en-US'
const locale: typeof enUS = {
'cli.feature.message': '👋 嘿,今天想做什么?',
'cli.feature.choices.create': '🔌 创建一个新的 univer 插件',
'cli.feature.choices.bundle': '📦 构建你自己的 UMD 包',

'create.choices.path': '📝 请输入要创建新插件的路径',
'create.choices.template': '📦 请选择模板',
Expand All @@ -17,12 +16,6 @@ const locale: typeof enUS = {
+ '确认?',
'create.success': '🎉 成功创建一个新插件',

'bundle.choices.path': '📝 请输入输出路径',
'bundle.choices.react': '🏗️ 你的项目中已经使用了 React?',
'bundle.choices.rxjs': '🚛 你的项目中已经使用了 RxJS?',
'bundle.success.css': '🎉 CSS 包生成成功',
'bundle.success.js': '🎉 JS 包生成成功',

'error.exit': '再见 👋',
}

Expand Down
12 changes: 5 additions & 7 deletions templates/normal/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@
"@univerjs/sheets-ui": "*",
"@univerjs/ui": "*",
"@univerjs/uniscript": "*",
"@vitest/coverage-istanbul": "^1.6.0",
"@wendellhu/redi": "^0.15.2",
"@vitest/coverage-istanbul": "^2.0.5",
"rxjs": "^7.8.1",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.1",
"typescript": "^5.5.4",
"vite": "^5.4.1",
"vite-plugin-dts": "^4.0.3",
"vite-plugin-externals": "^0.6.2",
"vitest": "^1.6.0"
"vitest": "^2.0.5"
},
"peerDependencies": {
"@univerjs/core": "*",
"@wendellhu/redi": ">=0.12.13",
"rxjs": ">=7.0.0"
}
}
3 changes: 1 addition & 2 deletions templates/normal/basic/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ export default defineConfig(({ mode }) => ({
formats: ['es', 'umd', 'cjs'],
},
rollupOptions: {
external: ['@univerjs/core', '@wendellhu/redi', 'rxjs'],
external: ['@univerjs/core', 'rxjs'],
output: {
globals: {
'@univerjs/core': 'UniverCore',
'@wendellhu/redi': '@wendellhu/redi',
rxjs: 'rxjs',
},
},
Expand Down
20 changes: 9 additions & 11 deletions templates/normal/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"build": "tsc && vite build"
},
"dependencies": {
"@univerjs/icons": "^0.1.46"
"@univerjs/icons": "latest"
},
"devDependencies": {
"@univerjs/core": "*",
Expand All @@ -66,25 +66,23 @@
"@univerjs/sheets-ui": "*",
"@univerjs/ui": "*",
"@univerjs/uniscript": "*",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-istanbul": "^1.6.0",
"@wendellhu/redi": "^0.15.2",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-istanbul": "^2.0.5",
"clsx": "^2.1.1",
"happy-dom": "^13.6.2",
"happy-dom": "^14.12.3",
"less": "^4.2.0",
"react": "18.2.0",
"react": "18.3.1",
"rxjs": "^7.8.1",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.1",
"typescript": "^5.5.4",
"vite": "^5.4.1",
"vite-plugin-dts": "^4.0.3",
"vite-plugin-externals": "^0.6.2",
"vitest": "^1.6.0"
"vitest": "^2.0.5"
},
"peerDependencies": {
"@univerjs/core": "*",
"@univerjs/design": "*",
"@univerjs/ui": "*",
"@wendellhu/redi": ">=0.12.13",
"clsx": ">=2.0.0",
"react": ">=16.9.0",
"rxjs": ">=7.0.0"
Expand Down
4 changes: 0 additions & 4 deletions templates/normal/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export default defineConfig(({ mode }) => ({
'@univerjs/core',
'@univerjs/design',
'@univerjs/ui',
'@wendellhu/redi',
'@wendellhu/redi/react-bindings',
'clsx',
'react',
'rxjs'
Expand All @@ -53,8 +51,6 @@ export default defineConfig(({ mode }) => ({
'@univerjs/core': 'UniverCore',
'@univerjs/design': 'UniverDesign',
'@univerjs/ui': 'UniverUi',
'@wendellhu/redi': '@wendellhu/redi',
'@wendellhu/redi/react-bindings': '@wendellhu/redi/react-bindings',
clsx: 'clsx',
react: 'React',
rxjs: 'rxjs',
Expand Down
8 changes: 3 additions & 5 deletions templates/univer/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,16 @@
},
"peerDependencies": {
"@univerjs/core": "workspace:*",
"@wendellhu/redi": ">=0.12.13",
"rxjs": ">=7.0.0"
},
"dependencies": {
},
"devDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/shared": "workspace:*",
"@wendellhu/redi": "^0.15.2",
"rxjs": "^7.8.1",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vitest": "^1.6.0"
"typescript": "^5.5.4",
"vite": "^5.4.1",
"vitest": "^2.0.5"
}
}
Loading

0 comments on commit f90af3d

Please sign in to comment.