@weapp-core/init 2.1.5 → 3.0.0
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.
- package/dist/index.cjs +491 -304
- package/dist/index.d.cts +71 -41
- package/dist/index.d.ts +71 -41
- package/dist/index.js +488 -301
- package/package.json +1 -1
- package/templates/default/gitignore +34 -0
- package/templates/default/package.json +2 -2
- package/templates/{tdesign/src/components/Navbar/Navbar.json → default/src/components/HelloWorld/HelloWorld.json} +1 -2
- package/templates/default/src/components/HelloWorld/HelloWorld.ts +1 -0
- package/templates/default/src/components/HelloWorld/HelloWorld.wxml +4 -0
- package/templates/default/src/pages/index/index.json +7 -0
- package/templates/default/src/pages/index/index.wxml +1 -1
- package/templates/tailwindcss/gitignore +34 -0
- package/templates/tailwindcss/package.json +3 -3
- package/templates/tdesign/gitignore +34 -0
- package/templates/tdesign/package.json +3 -3
- package/templates/{default/src/components/Navbar/Navbar.json → tdesign/src/components/HelloWorld/HelloWorld.json} +0 -1
- package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +5 -0
- package/templates/tdesign/src/components/HelloWorld/HelloWorld.wxml +7 -0
- package/templates/tdesign/src/pages/index/index.json +1 -1
- package/templates/tdesign/src/pages/index/index.wxml +6 -10
- package/templates/vant/gitignore +34 -0
- package/templates/vant/package.json +3 -3
- package/templates/default/src/components/Navbar/Navbar.ts +0 -3
- package/templates/default/src/components/Navbar/Navbar.wxml +0 -1
- package/templates/tdesign/src/components/Navbar/Navbar.ts +0 -3
- package/templates/tdesign/src/components/Navbar/Navbar.wxml +0 -0
- /package/templates/default/src/components/{Navbar/Navbar.scss → HelloWorld/HelloWorld.scss} +0 -0
- /package/templates/tdesign/src/components/{Navbar/Navbar.scss → HelloWorld/HelloWorld.scss} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PackageJson } from 'pkg-types';
|
|
1
|
+
import { PackageJson, TSConfig } from 'pkg-types';
|
|
3
2
|
import { set } from '@weapp-core/shared';
|
|
4
3
|
|
|
5
4
|
interface SetMethod {
|
|
@@ -30,53 +29,84 @@ interface ProjectConfig {
|
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
interface ContextDocument<T> {
|
|
33
|
+
name: string;
|
|
34
|
+
path: string;
|
|
35
|
+
value: T | null;
|
|
36
|
+
}
|
|
37
|
+
interface Context {
|
|
38
|
+
projectConfig: ContextDocument<ProjectConfig>;
|
|
39
|
+
packageJson: ContextDocument<PackageJson>;
|
|
40
|
+
viteConfig: ContextDocument<string>;
|
|
41
|
+
tsconfig: ContextDocument<TSConfig>;
|
|
42
|
+
tsconfigNode: ContextDocument<TSConfig>;
|
|
43
|
+
dts: ContextDocument<string>;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig | undefined>;
|
|
41
|
-
declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson | undefined>;
|
|
42
46
|
declare function initViteConfigFile(options: SharedUpdateOptions): Promise<string>;
|
|
43
47
|
declare function initTsDtsFile(options: SharedUpdateOptions): Promise<string>;
|
|
44
|
-
declare function initTsJsonFiles(options: SharedUpdateOptions): Promise<
|
|
45
|
-
declare function initConfig(options: {
|
|
46
|
-
root?: string;
|
|
47
|
-
command?: 'weapp-vite';
|
|
48
|
-
}): Promise<{
|
|
49
|
-
projectConfig: {
|
|
50
|
-
name: string;
|
|
51
|
-
path: string;
|
|
52
|
-
value: ProjectConfig;
|
|
53
|
-
};
|
|
54
|
-
packageJson: {
|
|
55
|
-
name: string;
|
|
56
|
-
path: string;
|
|
57
|
-
value: PackageJson;
|
|
58
|
-
};
|
|
59
|
-
viteConfig: {
|
|
60
|
-
name: string;
|
|
61
|
-
path: string;
|
|
62
|
-
value: string;
|
|
63
|
-
};
|
|
48
|
+
declare function initTsJsonFiles(options: SharedUpdateOptions): Promise<{
|
|
64
49
|
tsconfig: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
compilerOptions: {
|
|
51
|
+
target: string;
|
|
52
|
+
jsx: string;
|
|
53
|
+
lib: string[];
|
|
54
|
+
useDefineForClassFields: boolean;
|
|
55
|
+
baseUrl: string;
|
|
56
|
+
module: string;
|
|
57
|
+
moduleResolution: string;
|
|
58
|
+
paths: {
|
|
59
|
+
'@/*': string[];
|
|
60
|
+
};
|
|
61
|
+
resolveJsonModule: boolean;
|
|
62
|
+
types: string[];
|
|
63
|
+
allowImportingTsExtensions: boolean;
|
|
64
|
+
allowJs: boolean;
|
|
65
|
+
strict: boolean;
|
|
66
|
+
noFallthroughCasesInSwitch: boolean;
|
|
67
|
+
noUnusedLocals: boolean;
|
|
68
|
+
noUnusedParameters: boolean;
|
|
69
|
+
noEmit: boolean;
|
|
70
|
+
isolatedModules: boolean;
|
|
71
|
+
skipLibCheck: boolean;
|
|
72
|
+
};
|
|
73
|
+
references: {
|
|
74
|
+
path: string;
|
|
75
|
+
}[];
|
|
76
|
+
include: string[];
|
|
77
|
+
exclude: string[];
|
|
68
78
|
};
|
|
69
79
|
tsconfigNode: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
compilerOptions: {
|
|
81
|
+
composite: boolean;
|
|
82
|
+
module: string;
|
|
83
|
+
moduleResolution: string;
|
|
84
|
+
strict: boolean;
|
|
85
|
+
allowSyntheticDefaultImports: boolean;
|
|
86
|
+
skipLibCheck: boolean;
|
|
87
|
+
};
|
|
88
|
+
include: string[];
|
|
78
89
|
};
|
|
79
90
|
}>;
|
|
91
|
+
|
|
92
|
+
declare enum TemplateName {
|
|
93
|
+
default = "default",
|
|
94
|
+
tailwindcss = "tailwindcss",
|
|
95
|
+
vant = "vant",
|
|
96
|
+
tdesign = "tdesign"
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
declare function createProject(targetDir?: string, templateName?: TemplateName): Promise<void>;
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson>;
|
|
102
|
+
|
|
103
|
+
declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig>;
|
|
104
|
+
|
|
105
|
+
declare function resetContext(): void;
|
|
106
|
+
|
|
107
|
+
declare function initConfig(options: {
|
|
108
|
+
root?: string;
|
|
109
|
+
command?: 'weapp-vite';
|
|
110
|
+
}): Promise<Context>;
|
|
111
|
+
|
|
112
|
+
export { type Context, TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile, resetContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PackageJson } from 'pkg-types';
|
|
1
|
+
import { PackageJson, TSConfig } from 'pkg-types';
|
|
3
2
|
import { set } from '@weapp-core/shared';
|
|
4
3
|
|
|
5
4
|
interface SetMethod {
|
|
@@ -30,53 +29,84 @@ interface ProjectConfig {
|
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
interface ContextDocument<T> {
|
|
33
|
+
name: string;
|
|
34
|
+
path: string;
|
|
35
|
+
value: T | null;
|
|
36
|
+
}
|
|
37
|
+
interface Context {
|
|
38
|
+
projectConfig: ContextDocument<ProjectConfig>;
|
|
39
|
+
packageJson: ContextDocument<PackageJson>;
|
|
40
|
+
viteConfig: ContextDocument<string>;
|
|
41
|
+
tsconfig: ContextDocument<TSConfig>;
|
|
42
|
+
tsconfigNode: ContextDocument<TSConfig>;
|
|
43
|
+
dts: ContextDocument<string>;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig | undefined>;
|
|
41
|
-
declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson | undefined>;
|
|
42
46
|
declare function initViteConfigFile(options: SharedUpdateOptions): Promise<string>;
|
|
43
47
|
declare function initTsDtsFile(options: SharedUpdateOptions): Promise<string>;
|
|
44
|
-
declare function initTsJsonFiles(options: SharedUpdateOptions): Promise<
|
|
45
|
-
declare function initConfig(options: {
|
|
46
|
-
root?: string;
|
|
47
|
-
command?: 'weapp-vite';
|
|
48
|
-
}): Promise<{
|
|
49
|
-
projectConfig: {
|
|
50
|
-
name: string;
|
|
51
|
-
path: string;
|
|
52
|
-
value: ProjectConfig;
|
|
53
|
-
};
|
|
54
|
-
packageJson: {
|
|
55
|
-
name: string;
|
|
56
|
-
path: string;
|
|
57
|
-
value: PackageJson;
|
|
58
|
-
};
|
|
59
|
-
viteConfig: {
|
|
60
|
-
name: string;
|
|
61
|
-
path: string;
|
|
62
|
-
value: string;
|
|
63
|
-
};
|
|
48
|
+
declare function initTsJsonFiles(options: SharedUpdateOptions): Promise<{
|
|
64
49
|
tsconfig: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
compilerOptions: {
|
|
51
|
+
target: string;
|
|
52
|
+
jsx: string;
|
|
53
|
+
lib: string[];
|
|
54
|
+
useDefineForClassFields: boolean;
|
|
55
|
+
baseUrl: string;
|
|
56
|
+
module: string;
|
|
57
|
+
moduleResolution: string;
|
|
58
|
+
paths: {
|
|
59
|
+
'@/*': string[];
|
|
60
|
+
};
|
|
61
|
+
resolveJsonModule: boolean;
|
|
62
|
+
types: string[];
|
|
63
|
+
allowImportingTsExtensions: boolean;
|
|
64
|
+
allowJs: boolean;
|
|
65
|
+
strict: boolean;
|
|
66
|
+
noFallthroughCasesInSwitch: boolean;
|
|
67
|
+
noUnusedLocals: boolean;
|
|
68
|
+
noUnusedParameters: boolean;
|
|
69
|
+
noEmit: boolean;
|
|
70
|
+
isolatedModules: boolean;
|
|
71
|
+
skipLibCheck: boolean;
|
|
72
|
+
};
|
|
73
|
+
references: {
|
|
74
|
+
path: string;
|
|
75
|
+
}[];
|
|
76
|
+
include: string[];
|
|
77
|
+
exclude: string[];
|
|
68
78
|
};
|
|
69
79
|
tsconfigNode: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
compilerOptions: {
|
|
81
|
+
composite: boolean;
|
|
82
|
+
module: string;
|
|
83
|
+
moduleResolution: string;
|
|
84
|
+
strict: boolean;
|
|
85
|
+
allowSyntheticDefaultImports: boolean;
|
|
86
|
+
skipLibCheck: boolean;
|
|
87
|
+
};
|
|
88
|
+
include: string[];
|
|
78
89
|
};
|
|
79
90
|
}>;
|
|
91
|
+
|
|
92
|
+
declare enum TemplateName {
|
|
93
|
+
default = "default",
|
|
94
|
+
tailwindcss = "tailwindcss",
|
|
95
|
+
vant = "vant",
|
|
96
|
+
tdesign = "tdesign"
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
declare function createProject(targetDir?: string, templateName?: TemplateName): Promise<void>;
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson>;
|
|
102
|
+
|
|
103
|
+
declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig>;
|
|
104
|
+
|
|
105
|
+
declare function resetContext(): void;
|
|
106
|
+
|
|
107
|
+
declare function initConfig(options: {
|
|
108
|
+
root?: string;
|
|
109
|
+
command?: 'weapp-vite';
|
|
110
|
+
}): Promise<Context>;
|
|
111
|
+
|
|
112
|
+
export { type Context, TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile, resetContext };
|