@weapp-core/init 3.0.1 → 3.0.3

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 (44) hide show
  1. package/dist/index.cjs +116 -51
  2. package/dist/index.d.cts +32 -10
  3. package/dist/index.d.ts +32 -10
  4. package/dist/index.js +114 -49
  5. package/package.json +1 -1
  6. package/templates/default/auto-import-components.json +3 -0
  7. package/templates/default/gitignore +2 -1
  8. package/templates/default/package.json +2 -2
  9. package/templates/default/project.private.config.json +1 -1
  10. package/templates/default/src/components/HelloWorld/HelloWorld.json +1 -1
  11. package/templates/default/src/components/HelloWorld/HelloWorld.ts +1 -0
  12. package/templates/default/src/pages/index/index.ts +1 -0
  13. package/templates/default/tsconfig.app.json +55 -0
  14. package/templates/default/tsconfig.json +4 -41
  15. package/templates/default/tsconfig.node.json +23 -3
  16. package/templates/tailwindcss/auto-import-components.json +3 -0
  17. package/templates/tailwindcss/gitignore +2 -1
  18. package/templates/tailwindcss/package.json +5 -5
  19. package/templates/tailwindcss/project.config.json +1 -1
  20. package/templates/tailwindcss/project.private.config.json +1 -1
  21. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.ts +1 -0
  22. package/templates/tailwindcss/src/pages/index/index.ts +2 -0
  23. package/templates/tailwindcss/src/pages/profile/index.ts +1 -0
  24. package/templates/tailwindcss/tsconfig.app.json +55 -0
  25. package/templates/tailwindcss/tsconfig.json +4 -41
  26. package/templates/tailwindcss/tsconfig.node.json +23 -3
  27. package/templates/tdesign/gitignore +2 -1
  28. package/templates/tdesign/package.json +6 -6
  29. package/templates/tdesign/project.config.json +3 -2
  30. package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +1 -0
  31. package/templates/tdesign/src/pages/index/index.ts +3 -0
  32. package/templates/tdesign/tsconfig.app.json +58 -0
  33. package/templates/tdesign/tsconfig.json +4 -42
  34. package/templates/tdesign/tsconfig.node.json +23 -3
  35. package/templates/tdesign/vite.config.ts +2 -4
  36. package/templates/vant/gitignore +2 -1
  37. package/templates/vant/package.json +5 -5
  38. package/templates/vant/project.config.json +1 -1
  39. package/templates/vant/src/components/HelloWorld/HelloWorld.ts +1 -0
  40. package/templates/vant/src/pages/index/index.ts +2 -0
  41. package/templates/vant/tsconfig.app.json +58 -0
  42. package/templates/vant/tsconfig.json +4 -44
  43. package/templates/vant/tsconfig.node.json +23 -3
  44. package/templates/vant/vite.config.ts +2 -4
@@ -1,48 +1,11 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "jsx": "preserve",
5
- "lib": [
6
- "ES2020",
7
- "DOM",
8
- "DOM.Iterable"
9
- ],
10
- "useDefineForClassFields": false,
11
- "baseUrl": ".",
12
- "module": "ESNext",
13
- "moduleResolution": "bundler",
14
- "paths": {
15
- "@/*": [
16
- "./src/*"
17
- ]
18
- },
19
- "resolveJsonModule": true,
20
- "types": [
21
- "miniprogram-api-typings"
22
- ],
23
- "allowImportingTsExtensions": true,
24
- "allowJs": true,
25
- "strict": true,
26
- "noFallthroughCasesInSwitch": true,
27
- "noUnusedLocals": true,
28
- "noUnusedParameters": true,
29
- "noEmit": true,
30
- "allowSyntheticDefaultImports": true,
31
- "esModuleInterop": true,
32
- "isolatedModules": true,
33
- "skipLibCheck": true
34
- },
35
2
  "references": [
3
+ {
4
+ "path": "./tsconfig.app.json"
5
+ },
36
6
  {
37
7
  "path": "./tsconfig.node.json"
38
8
  }
39
9
  ],
40
- "include": [
41
- "src/**/*.ts",
42
- "src/**/*.js"
43
- ],
44
- "exclude": [
45
- "node_modules",
46
- "dist"
47
- ]
10
+ "files": []
48
11
  }
@@ -1,13 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "composite": true,
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": [
6
+ "ES2023"
7
+ ],
8
+ "moduleDetection": "force",
4
9
  "module": "ESNext",
5
10
  "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "types": [
13
+ "node"
14
+ ],
15
+ "allowImportingTsExtensions": true,
6
16
  "strict": true,
7
- "allowSyntheticDefaultImports": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noEmit": true,
21
+ "verbatimModuleSyntax": true,
22
+ "noUncheckedSideEffectImports": true,
23
+ "erasableSyntaxOnly": true,
8
24
  "skipLibCheck": true
9
25
  },
10
26
  "include": [
11
- "vite.config.ts"
27
+ "vite.config.ts",
28
+ "vite.config.*.ts",
29
+ "*.config.ts",
30
+ "config/**/*.ts",
31
+ "scripts/**/*.ts"
12
32
  ]
13
33
  }
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/weapp-vite/weapp-vite.git",
12
- "directory": "apps/weapp-vite-tailwindcss-tdesign-template"
12
+ "directory": "templates/weapp-vite-tailwindcss-tdesign-template"
13
13
  },
14
14
  "bugs": {
15
15
  "url": "https://github.com/weapp-vite/weapp-vite/issues"
@@ -24,18 +24,18 @@
24
24
  "postinstall": "weapp-tw patch"
25
25
  },
26
26
  "dependencies": {
27
- "tdesign-miniprogram": "^1.10.1"
27
+ "tdesign-miniprogram": "^1.11.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@egoist/tailwindcss-icons": "^1.9.0",
31
31
  "@iconify-json/mdi": "^1.2.3",
32
- "autoprefixer": "^10.4.21",
32
+ "autoprefixer": "^10.4.22",
33
33
  "miniprogram-api-typings": "^4.1.0",
34
34
  "postcss": "^8.5.6",
35
- "sass": "^1.93.2",
36
- "tailwindcss": "^3.4.17",
35
+ "sass": "^1.94.0",
36
+ "tailwindcss": "^3.4.18",
37
37
  "typescript": "^5.9.3",
38
- "weapp-tailwindcss": "^4.3.3",
38
+ "weapp-tailwindcss": "^4.7.7",
39
39
  "weapp-vite": "workspace:*"
40
40
  }
41
41
  }
@@ -25,7 +25,8 @@
25
25
  "packNpmManually": true,
26
26
  "es6": true,
27
27
  "swc": false,
28
- "disableSWC": true
28
+ "disableSWC": true,
29
+ "minifyWXML": true
29
30
  },
30
31
  "simulatorType": "wechat",
31
32
  "simulatorPluginLibVersion": {},
@@ -41,4 +42,4 @@
41
42
  "include": []
42
43
  },
43
44
  "appid": "wx6ffee4673b257014"
44
- }
45
+ }
@@ -56,6 +56,7 @@ Component({
56
56
  })
57
57
  }
58
58
  catch (error) {
59
+ // eslint-disable-next-line no-console
59
60
  console.error('复制链接失败', error)
60
61
  }
61
62
  },
@@ -72,13 +72,16 @@ Page({
72
72
  await wx.setClipboardData({
73
73
  data: e.mark.url,
74
74
  })
75
+ // eslint-disable-next-line no-console
75
76
  console.log(`复制成功: ${e.mark.url}`)
76
77
  }
77
78
  },
78
79
  handleSelected(e: WechatMiniprogram.CustomEvent) {
80
+ // eslint-disable-next-line no-console
79
81
  console.log(e.detail)
80
82
  },
81
83
  onLoad() {
84
+ // eslint-disable-next-line no-console
82
85
  console.log(hello())
83
86
  },
84
87
  handleAction() {
@@ -0,0 +1,58 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "jsx": "preserve",
6
+ "lib": [
7
+ "ES2023",
8
+ "DOM",
9
+ "DOM.Iterable"
10
+ ],
11
+ "moduleDetection": "force",
12
+ "baseUrl": ".",
13
+ "module": "ESNext",
14
+ "moduleResolution": "bundler",
15
+ "paths": {
16
+ "@/*": [
17
+ "./src/*"
18
+ ],
19
+ "tdesign-miniprogram/*": [
20
+ "./node_modules/tdesign-miniprogram/miniprogram_dist/*"
21
+ ],
22
+ "take:@/*": [
23
+ "./src/*"
24
+ ]
25
+ },
26
+ "resolveJsonModule": true,
27
+ "types": [
28
+ "miniprogram-api-typings"
29
+ ],
30
+ "allowImportingTsExtensions": true,
31
+ "allowJs": true,
32
+ "strict": true,
33
+ "noFallthroughCasesInSwitch": true,
34
+ "noUnusedLocals": true,
35
+ "noUnusedParameters": true,
36
+ "noEmit": true,
37
+ "allowSyntheticDefaultImports": true,
38
+ "esModuleInterop": true,
39
+ "isolatedModules": true,
40
+ "verbatimModuleSyntax": true,
41
+ "noUncheckedSideEffectImports": true,
42
+ "erasableSyntaxOnly": true,
43
+ "skipLibCheck": true
44
+ },
45
+ "include": [
46
+ "src/**/*.ts",
47
+ "src/**/*.tsx",
48
+ "src/**/*.js",
49
+ "src/**/*.jsx",
50
+ "src/**/*.mts",
51
+ "src/**/*.cts",
52
+ "src/**/*.vue",
53
+ "src/**/*.json",
54
+ "src/**/*.d.ts",
55
+ "types/**/*.d.ts",
56
+ "env.d.ts"
57
+ ]
58
+ }
@@ -1,49 +1,11 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "jsx": "preserve",
5
- "lib": [
6
- "ES2020",
7
- "DOM",
8
- "DOM.Iterable"
9
- ],
10
- "useDefineForClassFields": false,
11
- "baseUrl": ".",
12
- "module": "ESNext",
13
- "moduleResolution": "bundler",
14
- "paths": {
15
- "@/*": [
16
- "./src/*"
17
- ],
18
- "tdesign-miniprogram/*": ["./node_modules/tdesign-miniprogram/miniprogram_dist/*"]
19
- },
20
- "resolveJsonModule": true,
21
- "types": [
22
- "miniprogram-api-typings"
23
- ],
24
- "allowImportingTsExtensions": true,
25
- "allowJs": true,
26
- "strict": true,
27
- "noFallthroughCasesInSwitch": true,
28
- "noUnusedLocals": true,
29
- "noUnusedParameters": true,
30
- "noEmit": true,
31
- "allowSyntheticDefaultImports": true,
32
- "esModuleInterop": true,
33
- "isolatedModules": true,
34
- "skipLibCheck": true
35
- },
36
2
  "references": [
3
+ {
4
+ "path": "./tsconfig.app.json"
5
+ },
37
6
  {
38
7
  "path": "./tsconfig.node.json"
39
8
  }
40
9
  ],
41
- "include": [
42
- "src/**/*.ts",
43
- "src/**/*.js"
44
- ],
45
- "exclude": [
46
- "node_modules",
47
- "dist"
48
- ]
10
+ "files": []
49
11
  }
@@ -1,13 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "composite": true,
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": [
6
+ "ES2023"
7
+ ],
8
+ "moduleDetection": "force",
4
9
  "module": "ESNext",
5
10
  "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "types": [
13
+ "node"
14
+ ],
15
+ "allowImportingTsExtensions": true,
6
16
  "strict": true,
7
- "allowSyntheticDefaultImports": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noEmit": true,
21
+ "verbatimModuleSyntax": true,
22
+ "noUncheckedSideEffectImports": true,
23
+ "erasableSyntaxOnly": true,
8
24
  "skipLibCheck": true
9
25
  },
10
26
  "include": [
11
- "vite.config.ts"
27
+ "vite.config.ts",
28
+ "vite.config.*.ts",
29
+ "*.config.ts",
30
+ "config/**/*.ts",
31
+ "scripts/**/*.ts"
12
32
  ]
13
33
  }
@@ -5,10 +5,8 @@ import { defineConfig } from 'weapp-vite/config'
5
5
  export default defineConfig({
6
6
  weapp: {
7
7
  srcRoot: 'src',
8
- enhance: {
9
- autoImportComponents: {
10
- resolvers: [TDesignResolver()],
11
- },
8
+ autoImportComponents: {
9
+ resolvers: [TDesignResolver()],
12
10
  },
13
11
  // pnpm g 生成的格式
14
12
  // https://vite.icebreaker.top/guide/generate.html
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/weapp-vite/weapp-vite.git",
12
- "directory": "apps/weapp-vite-tailwindcss-vant-template"
12
+ "directory": "templates/weapp-vite-tailwindcss-vant-template"
13
13
  },
14
14
  "bugs": {
15
15
  "url": "https://github.com/weapp-vite/weapp-vite/issues"
@@ -29,13 +29,13 @@
29
29
  "devDependencies": {
30
30
  "@egoist/tailwindcss-icons": "^1.9.0",
31
31
  "@iconify-json/mdi": "^1.2.3",
32
- "autoprefixer": "^10.4.21",
32
+ "autoprefixer": "^10.4.22",
33
33
  "miniprogram-api-typings": "^4.1.0",
34
34
  "postcss": "^8.5.6",
35
- "sass": "^1.93.2",
36
- "tailwindcss": "^3.4.17",
35
+ "sass": "^1.94.0",
36
+ "tailwindcss": "^3.4.18",
37
37
  "typescript": "^5.9.3",
38
- "weapp-tailwindcss": "^4.3.3",
38
+ "weapp-tailwindcss": "^4.7.7",
39
39
  "weapp-vite": "workspace:*"
40
40
  }
41
41
  }
@@ -39,4 +39,4 @@
39
39
  "include": []
40
40
  },
41
41
  "appid": "wx6ffee4673b257014"
42
- }
42
+ }
@@ -53,6 +53,7 @@ Component({
53
53
  })
54
54
  }
55
55
  catch (error) {
56
+ // eslint-disable-next-line no-console
56
57
  console.error('复制链接失败', error)
57
58
  }
58
59
  },
@@ -38,6 +38,7 @@ Page({
38
38
  await wx.setClipboardData({
39
39
  data: e.mark.url,
40
40
  })
41
+ // eslint-disable-next-line no-console
41
42
  console.log(`复制成功: ${e.mark.url}`)
42
43
  }
43
44
  },
@@ -50,6 +51,7 @@ Page({
50
51
  })
51
52
  },
52
53
  onLoad() {
54
+ // eslint-disable-next-line no-console
53
55
  console.log(hello())
54
56
  },
55
57
  })
@@ -0,0 +1,58 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "jsx": "preserve",
6
+ "lib": [
7
+ "ES2023",
8
+ "DOM",
9
+ "DOM.Iterable"
10
+ ],
11
+ "moduleDetection": "force",
12
+ "baseUrl": ".",
13
+ "module": "ESNext",
14
+ "moduleResolution": "bundler",
15
+ "paths": {
16
+ "@/*": [
17
+ "./src/*"
18
+ ],
19
+ "@vant/weapp/*": [
20
+ "./node_modules/@vant/weapp/dist/*"
21
+ ],
22
+ "take:@/*": [
23
+ "./src/*"
24
+ ]
25
+ },
26
+ "resolveJsonModule": true,
27
+ "types": [
28
+ "miniprogram-api-typings"
29
+ ],
30
+ "allowImportingTsExtensions": true,
31
+ "allowJs": true,
32
+ "strict": true,
33
+ "noFallthroughCasesInSwitch": true,
34
+ "noUnusedLocals": true,
35
+ "noUnusedParameters": true,
36
+ "noEmit": true,
37
+ "allowSyntheticDefaultImports": true,
38
+ "esModuleInterop": true,
39
+ "isolatedModules": true,
40
+ "verbatimModuleSyntax": true,
41
+ "noUncheckedSideEffectImports": true,
42
+ "erasableSyntaxOnly": true,
43
+ "skipLibCheck": true
44
+ },
45
+ "include": [
46
+ "src/**/*.ts",
47
+ "src/**/*.tsx",
48
+ "src/**/*.js",
49
+ "src/**/*.jsx",
50
+ "src/**/*.mts",
51
+ "src/**/*.cts",
52
+ "src/**/*.vue",
53
+ "src/**/*.json",
54
+ "src/**/*.d.ts",
55
+ "types/**/*.d.ts",
56
+ "env.d.ts"
57
+ ]
58
+ }
@@ -1,51 +1,11 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "jsx": "preserve",
5
- "lib": [
6
- "ES2020",
7
- "DOM",
8
- "DOM.Iterable"
9
- ],
10
- "useDefineForClassFields": false,
11
- "baseUrl": ".",
12
- "module": "ESNext",
13
- "moduleResolution": "bundler",
14
- "paths": {
15
- "@/*": [
16
- "./src/*"
17
- ],
18
- "@vant/weapp/*": [
19
- "./node_modules/@vant/weapp/dist/*"
20
- ]
21
- },
22
- "resolveJsonModule": true,
23
- "types": [
24
- "miniprogram-api-typings"
25
- ],
26
- "allowImportingTsExtensions": true,
27
- "allowJs": true,
28
- "strict": true,
29
- "noFallthroughCasesInSwitch": true,
30
- "noUnusedLocals": true,
31
- "noUnusedParameters": true,
32
- "noEmit": true,
33
- "allowSyntheticDefaultImports": true,
34
- "esModuleInterop": true,
35
- "isolatedModules": true,
36
- "skipLibCheck": true
37
- },
38
2
  "references": [
3
+ {
4
+ "path": "./tsconfig.app.json"
5
+ },
39
6
  {
40
7
  "path": "./tsconfig.node.json"
41
8
  }
42
9
  ],
43
- "include": [
44
- "src/**/*.ts",
45
- "src/**/*.js"
46
- ],
47
- "exclude": [
48
- "node_modules",
49
- "dist"
50
- ]
10
+ "files": []
51
11
  }
@@ -1,13 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "composite": true,
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": [
6
+ "ES2023"
7
+ ],
8
+ "moduleDetection": "force",
4
9
  "module": "ESNext",
5
10
  "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "types": [
13
+ "node"
14
+ ],
15
+ "allowImportingTsExtensions": true,
6
16
  "strict": true,
7
- "allowSyntheticDefaultImports": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noEmit": true,
21
+ "verbatimModuleSyntax": true,
22
+ "noUncheckedSideEffectImports": true,
23
+ "erasableSyntaxOnly": true,
8
24
  "skipLibCheck": true
9
25
  },
10
26
  "include": [
11
- "vite.config.ts"
27
+ "vite.config.ts",
28
+ "vite.config.*.ts",
29
+ "*.config.ts",
30
+ "config/**/*.ts",
31
+ "scripts/**/*.ts"
12
32
  ]
13
33
  }
@@ -5,10 +5,8 @@ import { defineConfig } from 'weapp-vite/config'
5
5
  export default defineConfig({
6
6
  weapp: {
7
7
  srcRoot: 'src',
8
- enhance: {
9
- autoImportComponents: {
10
- resolvers: [VantResolver()],
11
- },
8
+ autoImportComponents: {
9
+ resolvers: [VantResolver()],
12
10
  },
13
11
  // pnpm g 生成的格式
14
12
  // https://vite.icebreaker.top/guide/generate.html