@weapp-core/init 6.0.2 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +22 -379
  2. package/dist/index.js +22 -107
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,324 +1,5 @@
1
1
  import { set } from "@weapp-core/shared";
2
2
 
3
- //#region ../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.d.mts
4
- type StripEnums<T extends Record<string, any>> = { [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any };
5
- interface TSConfig {
6
- compilerOptions?: StripEnums<CompilerOptions>;
7
- exclude?: string[];
8
- compileOnSave?: boolean;
9
- extends?: string | string[];
10
- files?: string[];
11
- include?: string[];
12
- typeAcquisition?: TypeAcquisition;
13
- references?: {
14
- path: string;
15
- }[];
16
- }
17
- /**
18
- * Defines a TSConfig structure.
19
- * @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
20
- * @returns the same `tsconfig.json` object.
21
- */
22
- interface PackageJson {
23
- /**
24
- * The name is what your thing is called.
25
- * Some rules:
26
- * - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
27
- * - The name can’t start with a dot or an underscore.
28
- * - New packages must not have uppercase letters in the name.
29
- * - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
30
- */
31
- name?: string;
32
- /**
33
- * Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
34
- */
35
- version?: string;
36
- /**
37
- * Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
38
- */
39
- description?: string;
40
- /**
41
- * Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
42
- */
43
- keywords?: string[];
44
- /**
45
- * The url to the project homepage.
46
- */
47
- homepage?: string;
48
- /**
49
- * The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
50
- */
51
- bugs?: string | {
52
- url?: string;
53
- email?: string;
54
- };
55
- /**
56
- * You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
57
- */
58
- license?: string;
59
- /**
60
- * Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
61
- * For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
62
- */
63
- repository?: string | {
64
- type: string;
65
- url: string;
66
- /**
67
- * If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
68
- */
69
- directory?: string;
70
- };
71
- /**
72
- * The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
73
- */
74
- scripts?: PackageJsonScripts;
75
- /**
76
- * If you set `"private": true` in your package.json, then npm will refuse to publish it.
77
- */
78
- private?: boolean;
79
- /**
80
- * The “author” is one person.
81
- */
82
- author?: PackageJsonPerson;
83
- /**
84
- * “contributors” is an array of people.
85
- */
86
- contributors?: PackageJsonPerson[];
87
- /**
88
- * An object containing a URL that provides up-to-date information
89
- * about ways to help fund development of your package,
90
- * a string URL, or an array of objects and string URLs
91
- */
92
- funding?: PackageJsonFunding | PackageJsonFunding[];
93
- /**
94
- * The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
95
- */
96
- files?: string[];
97
- /**
98
- * The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
99
- * This should be a module ID relative to the root of your package folder.
100
- * For most modules, it makes the most sense to have a main script and often not much else.
101
- */
102
- main?: string;
103
- /**
104
- * If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
105
- */
106
- browser?: string | Record<string, string | false>;
107
- /**
108
- * The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
109
- */
110
- unpkg?: string;
111
- /**
112
- * A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
113
- */
114
- bin?: string | Record<string, string>;
115
- /**
116
- * Specify either a single file or an array of filenames to put in place for the `man` program to find.
117
- */
118
- man?: string | string[];
119
- /**
120
- * Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
121
- */
122
- dependencies?: Record<string, string>;
123
- /**
124
- * If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
125
- * In this case, it’s best to map these additional items in a `devDependencies` object.
126
- */
127
- devDependencies?: Record<string, string>;
128
- /**
129
- * If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
130
- */
131
- optionalDependencies?: Record<string, string>;
132
- /**
133
- * In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
134
- */
135
- peerDependencies?: Record<string, string>;
136
- /**
137
- * TypeScript typings, typically ending by `.d.ts`.
138
- */
139
- types?: string;
140
- /**
141
- * This field is synonymous with `types`.
142
- */
143
- typings?: string;
144
- /**
145
- * Non-Standard Node.js alternate entry-point to main.
146
- * An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
147
- */
148
- module?: string;
149
- /**
150
- * Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
151
- *
152
- * Docs:
153
- * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
154
- *
155
- * @default 'commonjs'
156
- * @since Node.js v14
157
- */
158
- type?: "module" | "commonjs";
159
- /**
160
- * Alternate and extensible alternative to "main" entry point.
161
- *
162
- * When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
163
- *
164
- * Docs:
165
- * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
166
- *
167
- * @since Node.js v12.7
168
- */
169
- exports?: PackageJsonExports;
170
- /**
171
- * Docs:
172
- * - https://nodejs.org/api/packages.html#imports
173
- */
174
- imports?: Record<string, string | Record<string, string>>;
175
- /**
176
- * The field is used to define a set of sub-packages (or workspaces) within a monorepo.
177
- *
178
- * This field is an array of glob patterns or an object with specific configurations for managing
179
- * multiple packages in a single repository.
180
- */
181
- workspaces?: string[] | {
182
- /**
183
- * Workspace package paths. Glob patterns are supported.
184
- */
185
- packages?: string[];
186
- /**
187
- * Packages to block from hoisting to the workspace root.
188
- * Uses glob patterns to match module paths in the dependency tree.
189
- *
190
- * Docs:
191
- * - https://classic.yarnpkg.com/blog/2018/02/15/nohoist/
192
- */
193
- nohoist?: string[];
194
- };
195
- /**
196
- * The field is used to specify different TypeScript declaration files for
197
- * different versions of TypeScript, allowing for version-specific type definitions.
198
- */
199
- typesVersions?: Record<string, Record<string, string[]>>;
200
- /**
201
- * You can specify which operating systems your module will run on:
202
- * ```json
203
- * {
204
- * "os": ["darwin", "linux"]
205
- * }
206
- * ```
207
- * You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
208
- * ```json
209
- * {
210
- * "os": ["!win32"]
211
- * }
212
- * ```
213
- * The host operating system is determined by `process.platform`
214
- * It is allowed to both block and allow an item, although there isn't any good reason to do this.
215
- */
216
- os?: string[];
217
- /**
218
- * If your code only runs on certain cpu architectures, you can specify which ones.
219
- * ```json
220
- * {
221
- * "cpu": ["x64", "ia32"]
222
- * }
223
- * ```
224
- * Like the `os` option, you can also block architectures:
225
- * ```json
226
- * {
227
- * "cpu": ["!arm", "!mips"]
228
- * }
229
- * ```
230
- * The host architecture is determined by `process.arch`
231
- */
232
- cpu?: string[];
233
- /**
234
- * This is a set of config values that will be used at publish-time.
235
- */
236
- publishConfig?: {
237
- /**
238
- * The registry that will be used if the package is published.
239
- */
240
- registry?: string;
241
- /**
242
- * The tag that will be used if the package is published.
243
- */
244
- tag?: string;
245
- /**
246
- * The access level that will be used if the package is published.
247
- */
248
- access?: "public" | "restricted";
249
- /**
250
- * **pnpm-only**
251
- *
252
- * By default, for portability reasons, no files except those listed in
253
- * the bin field will be marked as executable in the resulting package
254
- * archive. The executableFiles field lets you declare additional fields
255
- * that must have the executable flag (+x) set even if
256
- * they aren't directly accessible through the bin field.
257
- */
258
- executableFiles?: string[];
259
- /**
260
- * **pnpm-only**
261
- *
262
- * You also can use the field `publishConfig.directory` to customize
263
- * the published subdirectory relative to the current `package.json`.
264
- *
265
- * It is expected to have a modified version of the current package in
266
- * the specified directory (usually using third party build tools).
267
- */
268
- directory?: string;
269
- /**
270
- * **pnpm-only**
271
- *
272
- * When set to `true`, the project will be symlinked from the
273
- * `publishConfig.directory` location during local development.
274
- * @default true
275
- */
276
- linkDirectory?: boolean;
277
- } & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
278
- /**
279
- * See: https://nodejs.org/api/packages.html#packagemanager
280
- * This field defines which package manager is expected to be used when working on the current project.
281
- * Should be of the format: `<name>@<version>[#hash]`
282
- */
283
- packageManager?: string;
284
- [key: string]: any;
285
- }
286
- /**
287
- * See: https://docs.npmjs.com/cli/v11/using-npm/scripts#pre--post-scripts
288
- */
289
- type PackageJsonScriptWithPreAndPost<S extends string> = S | `${"pre" | "post"}${S}`;
290
- /**
291
- * See: https://docs.npmjs.com/cli/v11/using-npm/scripts#life-cycle-operation-order
292
- */
293
- type PackageJsonNpmLifeCycleScripts = "dependencies" | "prepublishOnly" | PackageJsonScriptWithPreAndPost<"install" | "pack" | "prepare" | "publish" | "restart" | "start" | "stop" | "test" | "version">;
294
- /**
295
- * See: https://pnpm.io/scripts#lifecycle-scripts
296
- */
297
- type PackageJsonPnpmLifeCycleScripts = "pnpm:devPreinstall";
298
- type PackageJsonCommonScripts = "build" | "coverage" | "deploy" | "dev" | "format" | "lint" | "preview" | "release" | "typecheck" | "watch";
299
- type PackageJsonScriptName = PackageJsonCommonScripts | PackageJsonNpmLifeCycleScripts | PackageJsonPnpmLifeCycleScripts | (string & {});
300
- type PackageJsonScripts = { [P in PackageJsonScriptName]?: string };
301
- /**
302
- * A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
303
- */
304
- type PackageJsonPerson = string | {
305
- name: string;
306
- email?: string;
307
- url?: string;
308
- };
309
- type PackageJsonFunding = string | {
310
- url: string;
311
- type?: string;
312
- };
313
- type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
314
- type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
315
- type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
316
- /**
317
- * Defines a PackageJson structure.
318
- * @param pkg - The `package.json` content as an object. See {@link PackageJson}.
319
- * @returns the same `package.json` object.
320
- */
321
- //#endregion
322
3
  //#region src/types.d.ts
323
4
  /**
324
5
  * @description set-value 的写入方法签名
@@ -364,6 +45,19 @@ interface ProjectConfig {
364
45
  }
365
46
  //#endregion
366
47
  //#region src/context.d.ts
48
+ type JsonPrimitive = string | number | boolean | null;
49
+ type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
50
+ interface JsonObject {
51
+ [key: string]: JsonValue | undefined;
52
+ }
53
+ interface PackageJsonData extends JsonObject {
54
+ name?: string;
55
+ homepage?: string;
56
+ type?: string;
57
+ scripts?: Record<string, string>;
58
+ devDependencies?: Record<string, string>;
59
+ }
60
+ interface TsConfigData extends JsonObject {}
367
61
  /**
368
62
  * @description init 过程中单个文件的上下文结构
369
63
  */
@@ -377,11 +71,12 @@ interface ContextDocument<T> {
377
71
  */
378
72
  interface Context {
379
73
  projectConfig: ContextDocument<ProjectConfig>;
380
- packageJson: ContextDocument<PackageJson>;
74
+ packageJson: ContextDocument<PackageJsonData>;
381
75
  viteConfig: ContextDocument<string>;
382
- tsconfig: ContextDocument<TSConfig>;
383
- tsconfigApp: ContextDocument<TSConfig>;
384
- tsconfigNode: ContextDocument<TSConfig>;
76
+ tsconfig: ContextDocument<TsConfigData>;
77
+ tsconfigApp: ContextDocument<TsConfigData>;
78
+ tsconfigServer: ContextDocument<TsConfigData>;
79
+ tsconfigNode: ContextDocument<TsConfigData>;
385
80
  dts: ContextDocument<string>;
386
81
  }
387
82
  //#endregion
@@ -395,68 +90,16 @@ declare function initTsJsonFiles(options: SharedUpdateOptions): Promise<{
395
90
  }[];
396
91
  files: never[];
397
92
  };
398
- tsconfigApp: {
399
- compilerOptions: {
400
- tsBuildInfoFile: string;
401
- target: string;
402
- lib: string[];
403
- jsx: string;
404
- module: string;
405
- moduleResolution: string;
406
- moduleDetection: string;
407
- baseUrl: string;
408
- paths: {
409
- '@/*': string[];
410
- };
411
- resolveJsonModule: boolean;
412
- types: string[];
413
- allowImportingTsExtensions: boolean;
414
- allowJs: boolean;
415
- allowSyntheticDefaultImports: boolean;
416
- esModuleInterop: boolean;
417
- isolatedModules: boolean;
418
- strict: boolean;
419
- noFallthroughCasesInSwitch: boolean;
420
- noUnusedLocals: boolean;
421
- noUnusedParameters: boolean;
422
- noEmit: boolean;
423
- verbatimModuleSyntax: boolean;
424
- noUncheckedSideEffectImports: boolean;
425
- erasableSyntaxOnly: boolean;
426
- skipLibCheck: boolean;
427
- };
428
- include: string[];
429
- };
430
- tsconfigNode: {
431
- compilerOptions: {
432
- tsBuildInfoFile: string;
433
- target: string;
434
- lib: string[];
435
- module: string;
436
- moduleResolution: string;
437
- moduleDetection: string;
438
- types: string[];
439
- allowImportingTsExtensions: boolean;
440
- resolveJsonModule: boolean;
441
- verbatimModuleSyntax: boolean;
442
- strict: boolean;
443
- noFallthroughCasesInSwitch: boolean;
444
- noUnusedLocals: boolean;
445
- noUnusedParameters: boolean;
446
- noEmit: boolean;
447
- noUncheckedSideEffectImports: boolean;
448
- erasableSyntaxOnly: boolean;
449
- skipLibCheck: boolean;
450
- };
451
- include: string[];
452
- };
93
+ tsconfigApp: null;
94
+ tsconfigServer: null;
95
+ tsconfigNode: null;
453
96
  }>;
454
97
  //#endregion
455
98
  //#region src/packageJson.d.ts
456
99
  /**
457
100
  * @description 创建或更新 package.json
458
101
  */
459
- declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson>;
102
+ declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJsonData>;
460
103
  //#endregion
461
104
  //#region src/projectConfig.d.ts
462
105
  /**
package/dist/index.js CHANGED
@@ -467,6 +467,7 @@ function createContext() {
467
467
  viteConfig: createDocument(),
468
468
  tsconfig: createDocument(),
469
469
  tsconfigApp: createDocument(),
470
+ tsconfigServer: createDocument(),
470
471
  tsconfigNode: createDocument(),
471
472
  dts: createDocument()
472
473
  };
@@ -487,106 +488,26 @@ function resetContext() {
487
488
  Object.assign(ctx.viteConfig, next.viteConfig);
488
489
  Object.assign(ctx.tsconfig, next.tsconfig);
489
490
  Object.assign(ctx.tsconfigApp, next.tsconfigApp);
491
+ Object.assign(ctx.tsconfigServer, next.tsconfigServer);
490
492
  Object.assign(ctx.tsconfigNode, next.tsconfigNode);
491
493
  Object.assign(ctx.dts, next.dts);
492
494
  }
493
495
  //#endregion
494
496
  //#region src/tsconfigJson.ts
495
- const srcIncludeGlobs = [
496
- "src/**/*.ts",
497
- "src/**/*.tsx",
498
- "src/**/*.js",
499
- "src/**/*.jsx",
500
- "src/**/*.mts",
501
- "src/**/*.cts",
502
- "src/**/*.vue",
503
- "src/**/*.json",
504
- "src/**/*.d.ts",
505
- "types/**/*.d.ts",
506
- "env.d.ts"
507
- ];
508
497
  /**
509
498
  * @description 生成默认 tsconfig.json
510
499
  */
511
500
  function getDefaultTsconfigJson() {
512
501
  return {
513
- references: [{ path: "./tsconfig.app.json" }, { path: "./tsconfig.node.json" }],
502
+ references: [
503
+ { path: "./.weapp-vite/tsconfig.app.json" },
504
+ { path: "./.weapp-vite/tsconfig.server.json" },
505
+ { path: "./.weapp-vite/tsconfig.node.json" },
506
+ { path: "./.weapp-vite/tsconfig.shared.json" }
507
+ ],
514
508
  files: []
515
509
  };
516
510
  }
517
- /**
518
- * @description 生成默认 tsconfig.app.json
519
- */
520
- function getDefaultTsconfigAppJson() {
521
- return {
522
- compilerOptions: {
523
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
524
- target: "ES2023",
525
- lib: [
526
- "ES2023",
527
- "DOM",
528
- "DOM.Iterable"
529
- ],
530
- jsx: "preserve",
531
- module: "ESNext",
532
- moduleResolution: "bundler",
533
- moduleDetection: "force",
534
- baseUrl: ".",
535
- paths: { "@/*": ["./src/*"] },
536
- resolveJsonModule: true,
537
- types: ["miniprogram-api-typings"],
538
- allowImportingTsExtensions: true,
539
- allowJs: true,
540
- allowSyntheticDefaultImports: true,
541
- esModuleInterop: true,
542
- isolatedModules: true,
543
- strict: true,
544
- noFallthroughCasesInSwitch: true,
545
- noUnusedLocals: true,
546
- noUnusedParameters: true,
547
- noEmit: true,
548
- verbatimModuleSyntax: true,
549
- noUncheckedSideEffectImports: true,
550
- erasableSyntaxOnly: true,
551
- skipLibCheck: true
552
- },
553
- include: srcIncludeGlobs
554
- };
555
- }
556
- /**
557
- * @description 生成默认 tsconfig.node.json
558
- */
559
- function getDefaultTsconfigNodeJson(include = []) {
560
- return {
561
- compilerOptions: {
562
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
563
- target: "ES2023",
564
- lib: ["ES2023"],
565
- module: "ESNext",
566
- moduleResolution: "bundler",
567
- moduleDetection: "force",
568
- types: ["node"],
569
- allowImportingTsExtensions: true,
570
- resolveJsonModule: true,
571
- verbatimModuleSyntax: true,
572
- strict: true,
573
- noFallthroughCasesInSwitch: true,
574
- noUnusedLocals: true,
575
- noUnusedParameters: true,
576
- noEmit: true,
577
- noUncheckedSideEffectImports: true,
578
- erasableSyntaxOnly: true,
579
- skipLibCheck: true
580
- },
581
- include: [...new Set([...[
582
- "vite.config.ts",
583
- "vite.config.*.ts",
584
- "*.config.ts",
585
- "config/**/*.ts",
586
- "scripts/**/*.ts"
587
- ], ...include])]
588
- };
589
- }
590
511
  //#endregion
591
512
  //#region src/tsDts.ts
592
513
  /**
@@ -717,38 +638,32 @@ async function initTsJsonFiles(options) {
717
638
  const { root, dest, write = true } = options;
718
639
  const tsJsonFilename = ctx.tsconfig.name = "tsconfig.json";
719
640
  const tsJsonFilePath = ctx.tsconfig.path = posix.resolve(root, tsJsonFilename);
720
- const tsAppJsonFilename = ctx.tsconfigApp.name = "tsconfig.app.json";
721
- const tsAppJsonFilePath = ctx.tsconfigApp.path = posix.resolve(root, tsAppJsonFilename);
722
- const tsNodeJsonFilename = ctx.tsconfigNode.name = "tsconfig.node.json";
723
- const tsNodeJsonFilePath = ctx.tsconfigNode.path = posix.resolve(root, tsNodeJsonFilename);
641
+ ctx.tsconfigApp.name = ".weapp-vite/tsconfig.app.json";
642
+ ctx.tsconfigApp.path = posix.resolve(root, ctx.tsconfigApp.name);
643
+ ctx.tsconfigServer.name = ".weapp-vite/tsconfig.server.json";
644
+ ctx.tsconfigServer.path = posix.resolve(root, ctx.tsconfigServer.name);
645
+ ctx.tsconfigNode.name = ".weapp-vite/tsconfig.node.json";
646
+ ctx.tsconfigNode.path = posix.resolve(root, ctx.tsconfigNode.name);
724
647
  const tsconfig = getDefaultTsconfigJson();
725
- const tsconfigApp = getDefaultTsconfigAppJson();
726
- const tsconfigNode = getDefaultTsconfigNodeJson(ctx.viteConfig.name ? [ctx.viteConfig.name] : []);
727
648
  ctx.tsconfig.value = tsconfig;
728
- ctx.tsconfigApp.value = tsconfigApp;
729
- ctx.tsconfigNode.value = tsconfigNode;
649
+ ctx.tsconfigApp.value = null;
650
+ ctx.tsconfigServer.value = null;
651
+ ctx.tsconfigNode.value = null;
730
652
  if (write) {
731
653
  const tsconfigOutputPath = resolveOutputPath(root, dest, tsJsonFilePath);
732
- const tsconfigAppOutputPath = resolveOutputPath(root, dest, tsAppJsonFilePath);
733
- const tsconfigNodeOutputPath = resolveOutputPath(root, dest, tsNodeJsonFilePath);
734
654
  await writeJsonFile(tsconfigOutputPath, tsconfig);
735
- await writeJsonFile(tsconfigAppOutputPath, tsconfigApp);
736
- await writeJsonFile(tsconfigNodeOutputPath, tsconfigNode);
737
- logger.log(`✨ 写入 ${[
738
- posix.relative(root, tsconfigOutputPath),
739
- posix.relative(root, tsconfigAppOutputPath),
740
- posix.relative(root, tsconfigNodeOutputPath)
741
- ].join(", ")} 成功!`);
655
+ logger.log(`✨ 写入 ${posix.relative(root, tsconfigOutputPath)} 成功!`);
742
656
  }
743
657
  return {
744
658
  tsconfig,
745
- tsconfigApp,
746
- tsconfigNode
659
+ tsconfigApp: null,
660
+ tsconfigServer: null,
661
+ tsconfigNode: null
747
662
  };
748
663
  }
749
664
  //#endregion
750
665
  //#region ../../packages/weapp-vite/package.json
751
- var version = "6.9.0";
666
+ var version = "6.11.1";
752
667
  //#endregion
753
668
  //#region src/npm.ts
754
669
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/init",
3
3
  "type": "module",
4
- "version": "6.0.2",
4
+ "version": "6.0.4",
5
5
  "description": "@weapp-core/init",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",