Skip to content

Commit

Permalink
build: adjust build dist and remove quill to dependencies (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Oct 23, 2024
1 parent 6115cd0 commit 760fbbe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
4 changes: 2 additions & 2 deletions packages/docs/fluent-editor/docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 快速开始

安装 Fluent Editor 和 Quill
安装 Fluent Editor:

```shell
npm i @opentiny/fluent-editor quill
npm i @opentiny/fluent-editor
```

编写 html:
Expand Down
8 changes: 2 additions & 6 deletions packages/docs/fluent-editor/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ export default defineConfig({
resolve: {
alias: [
{
find: /^@opentiny\/fluent-editor(\/(es|lib))?$/,
replacement: path.resolve(fluentEditorRoot, 'src/index.ts'),
},
{
find: /^@opentiny\/fluent-editor\/(theme)\/(.*)$/,
replacement: `${path.resolve(fluentEditorRoot, 'src/assets')}/$1/$2`,
find: '@opentiny/fluent-editor/style.scss',
replacement: path.resolve(fluentEditorRoot, 'src/assets/style.scss'),
},
],
},
Expand Down
17 changes: 4 additions & 13 deletions packages/fluent-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/fluent-editor",
"version": "3.20.0",
"version": "3.20.2",
"description": "A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It's powerful and out-of-the-box.",
"author": "OpenTiny Team",
"license": "MIT",
Expand All @@ -22,27 +22,18 @@
"opentiny",
"fluent-editor"
],
"exports": {
".": {
"import": "./src/index.ts",
"require": "./src/index.ts"
},
"./style.scss": "./src/assets/style.scss"
},
"main": "src/index.ts",
"module": "src/index.ts",
"scripts": {
"start": "vite build && vite",
"dev": "vite",
"build": "vite build && pnpm build:theme && node scripts/pre-release.js",
"build": "pnpm build:theme && vite build && node scripts/pre-release.js",
"build:theme": "vite build --config vite.config.theme.ts",
"test": "jest"
},
"peerDependencies": {
"quill": "^2.0.0"
},
"dependencies": {
"lodash-es": "^4.17.15"
"lodash-es": "^4.17.15",
"quill": "^2.0.0"
},
"devDependencies": {
"@types/jest": "^26.0.23",
Expand Down
5 changes: 0 additions & 5 deletions packages/fluent-editor/scripts/pre-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ if (program.versions) {
newVersion = program.versions
}

console.log('newVersion:', newVersion)

function preRelease() {
shelljs.sed('-i', `"version": "${currentVersion}"`, `"version": "${newVersion}"`, targetFile)
shelljs.sed('-i', `"main": "src/index.ts"`, `"main": "lib/index.cjs.js"`, targetFile)
shelljs.sed('-i', `"module": "src/index.ts"`, `"module": "es/index.es.js"`, targetFile)
shelljs.sed('-i', `"import": "./src/index.ts"`, `"import": "./es/index.es.js"`, targetFile)
shelljs.sed('-i', `"require": "./src/index.ts"`, `"require": "./lib/index.cjs.js"`, targetFile)
shelljs.sed('-i', `"./style.scss": "./src/assets/style.scss"`, `"./style.css": "./theme/style.css"`, targetFile)
shelljs.cp('-rf', '../../README.md', 'dist')
}

Expand Down
2 changes: 1 addition & 1 deletion packages/fluent-editor/vite.config.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
treeshake: false,
preserveEntrySignatures: 'strict',
output: {
dir: resolve(__dirname, 'dist/theme'),
dir: resolve(__dirname, 'dist'),
assetFileNames: 'style.css',
preserveModules: true,
preserveModulesRoot: resolve(__dirname, 'src/assets'),
Expand Down

0 comments on commit 760fbbe

Please sign in to comment.