File tree Expand file tree Collapse file tree 4 files changed +36
-20
lines changed
packages/create-vitnode-app
copy-of-vitnode-plugin/root Expand file tree Collapse file tree 4 files changed +36
-20
lines changed Original file line number Diff line number Diff line change 1- /src /*
2- ! /src /app
3- ! /src /app /**
4- ! /src /app_admin
5- ! /src /app_admin /**
6- ! /src /locales
7- ! /src /locales /**
8-
9- /node_modules
10- /.turbo
11- /tsconfig.json
12- /.swcrc
13- /components.json
14- /global.d.ts
15- /tsup.config.ts
16- /vitest.config.ts
17- /tsconfig.json
18- /scripts
19- /config
1+ This file intentionally left here for reference; actual ignore rules live in npmignore.template and will be renamed by the CLI.
Original file line number Diff line number Diff line change 1+ /src/*
2+ !/src/app
3+ !/src/app/**
4+ !/src/app_admin
5+ !/src/app_admin/**
6+ !/src/locales
7+ !/src/locales/**
8+
9+ /node_modules
10+ /.turbo
11+ /tsconfig.json
12+ /.swcrc
13+ /components.json
14+ /global.d.ts
15+ /tsup.config.ts
16+ /vitest.config.ts
17+ /tsconfig.json
18+ /scripts
19+ /config
Original file line number Diff line number Diff line change 1414 "bin" : {
1515 "create-vitnode-app" : " dist/src/index.js"
1616 },
17+ "files" : [
18+ " dist" ,
19+ " copy-of-vitnode-app" ,
20+ " copy-of-vitnode-plugin" ,
21+ " README.md" ,
22+ " eslint" ,
23+ " eslint-react"
24+ ],
1725 "scripts" : {
1826 "build:scripts" : " tsc && node dist/src/prepare/prepare.js" ,
1927 "start:scripts" : " node dist/src/index.js" ,
Original file line number Diff line number Diff line change 11import { existsSync } from "fs" ;
2- import { cp , mkdir } from "fs/promises" ;
2+ import { cp , mkdir , rename } from "fs/promises" ;
33import ora from "ora" ;
44import { dirname , join } from "path" ;
55import color from "picocolors" ;
@@ -56,6 +56,13 @@ export const createPluginVitNode = async ({
5656 spinner . text = "Preparing the plugin structure..." ;
5757 await cp ( templatePath , pluginPath , { recursive : true } ) ;
5858
59+ // Rename template npmignore to .npmignore in the generated plugin
60+ const npmIgnoreTemplatePath = join ( pluginPath , "npmignore.template" ) ;
61+ const dotNpmIgnorePath = join ( pluginPath , ".npmignore" ) ;
62+ if ( existsSync ( npmIgnoreTemplatePath ) ) {
63+ await rename ( npmIgnoreTemplatePath , dotNpmIgnorePath ) ;
64+ }
65+
5966 spinner . text = "Creating package.json..." ;
6067 await createPluginPackageJSON ( {
6168 pluginName,
You can’t perform that action at this time.
0 commit comments