File tree Expand file tree Collapse file tree 5 files changed +15
-128
lines changed
packages/cherry-markdown/build Expand file tree Collapse file tree 5 files changed +15
-128
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ const cherryInstance = new Cherry({
164164### Node
165165
166166``` javascript
167- const { default: CherryEngine } = require (' cherry-markdown/dist/cherry-markdown.engine.core.common ' );
167+ const { default: CherryEngine } = require (' cherry-markdown/dist/cherry-markdown.engine.core' );
168168const cherryEngineInstance = new CherryEngine ();
169169const htmlContent = cherryEngineInstance .makeHtml (' # welcome to cherry editor!' );
170170```
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ const cherryInstance = new Cherry({
163163### Node
164164
165165``` javascript
166- const { default: CherryEngine } = require (' cherry-markdown/dist/cherry-markdown.engine.core.common ' );
166+ const { default: CherryEngine } = require (' cherry-markdown/dist/cherry-markdown.engine.core' );
167167const cherryEngineInstance = new CherryEngine ();
168168const htmlContent = cherryEngineInstance .makeHtml (' # welcome to cherry editor!' );
169169```
Original file line number Diff line number Diff line change @@ -3,11 +3,18 @@ const { replaceInFile } = pkg;
33
44async function replacePaths ( ) {
55 try {
6- const results = await replaceInFile ( {
7- files : 'dist/types/**/*.d.ts' ,
8- from : / ~ t y p e s \/ / g,
9- to : '../../types/' ,
10- } ) ;
6+ const results = await Promise . all ( [
7+ replaceInFile ( {
8+ files : 'dist/types/**/*.d.ts' ,
9+ from : / ~ t y p e s \/ / g,
10+ to : '../../types/' ,
11+ } ) ,
12+ replaceInFile ( {
13+ files : 'dist/types/**/*.d.ts' ,
14+ from : / @ \/ a d d o n s \/ / g,
15+ to : './addons/' ,
16+ } ) ,
17+ ] ) ;
1118 for ( const result of results ) {
1219 if ( result . hasChanged ) {
1320 console . log ( result ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import * as path from 'path' ;
22import * as fs from 'fs' ;
3- import { execSync } from 'child_process' ;
43
54const cwd = process . cwd ( ) ;
65const cherryDist = path . join ( cwd , 'packages/cherry-markdown/dist' ) ;
76const cherryVscodePlugin = path . join ( cwd , 'packages/vscodePlugin/web-resources/dist' ) ;
87
9- // 1. 生成 cherry markdown addons 插件 exports 配置
10- console . log ( '[post-build] Generating addons exports...' ) ;
11- try {
12- execSync ( 'tsx scripts/generate-addons-exports.ts' , { cwd, stdio : 'inherit' } ) ;
13- } catch ( error ) {
14- console . warn ( '[post-build] Failed to generate addons exports:' , error ) ;
15- }
16-
17- // 2. 复制 dist 到 vscode 插件
8+ // 复制 dist 到 vscode 插件
189console . log ( '[post-build] Copying dist to vscode plugin...' ) ;
1910fs . cpSync ( cherryDist , cherryVscodePlugin , { recursive : true } ) ;
2011console . log ( '[post-build] Done!' ) ;
You can’t perform that action at this time.
0 commit comments