@spcsn/taro-cli 0.1.5 → 1.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.
Files changed (220) hide show
  1. package/README.md +37 -0
  2. package/define-config.d.ts +1 -0
  3. package/define-config.js +1 -0
  4. package/dist/cli.js +140 -110
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/{customCommand.d.ts → custom-command.d.ts} +1 -1
  7. package/dist/commands/custom-command.js +23 -0
  8. package/dist/commands/custom-command.js.map +1 -0
  9. package/dist/create/creator.js +2 -0
  10. package/dist/create/creator.js.map +1 -1
  11. package/dist/create/{fetchTemplate.js → fetch-template.js} +26 -33
  12. package/dist/create/fetch-template.js.map +1 -0
  13. package/dist/create/project.d.ts +2 -6
  14. package/dist/create/project.js +240 -285
  15. package/dist/create/project.js.map +1 -1
  16. package/dist/create/template-creator.d.ts +75 -0
  17. package/dist/create/template-creator.js +275 -0
  18. package/dist/create/template-creator.js.map +1 -0
  19. package/dist/doctor/validators.d.ts +7 -6
  20. package/dist/doctor/validators.js +6 -7
  21. package/dist/doctor/validators.js.map +1 -1
  22. package/dist/platform-weapp/apis-list.d.ts +1 -0
  23. package/dist/platform-weapp/apis-list.js +37 -0
  24. package/dist/platform-weapp/apis-list.js.map +1 -0
  25. package/dist/platform-weapp/apis.d.ts +16 -0
  26. package/dist/platform-weapp/apis.js +34 -0
  27. package/dist/platform-weapp/apis.js.map +1 -0
  28. package/dist/platform-weapp/components-react.d.ts +80 -0
  29. package/dist/platform-weapp/components-react.js +86 -0
  30. package/dist/platform-weapp/components-react.js.map +1 -0
  31. package/dist/platform-weapp/components.d.ts +4 -0
  32. package/dist/platform-weapp/components.js +520 -0
  33. package/dist/platform-weapp/components.js.map +1 -0
  34. package/dist/platform-weapp/index.d.ts +11 -0
  35. package/dist/platform-weapp/index.js +17 -0
  36. package/dist/platform-weapp/index.js.map +1 -0
  37. package/dist/platform-weapp/program.d.ts +35 -0
  38. package/dist/platform-weapp/program.js +64 -0
  39. package/dist/platform-weapp/program.js.map +1 -0
  40. package/dist/platform-weapp/runtime-utils.d.ts +27 -0
  41. package/dist/platform-weapp/runtime-utils.js +48 -0
  42. package/dist/platform-weapp/runtime-utils.js.map +1 -0
  43. package/dist/platform-weapp/runtime.d.ts +1 -0
  44. package/dist/platform-weapp/runtime.js +7 -0
  45. package/dist/platform-weapp/runtime.js.map +1 -0
  46. package/dist/platform-weapp/template.d.ts +39 -0
  47. package/dist/platform-weapp/template.js +119 -0
  48. package/dist/platform-weapp/template.js.map +1 -0
  49. package/dist/presets/commands/build.js +25 -45
  50. package/dist/presets/commands/build.js.map +1 -1
  51. package/dist/presets/commands/init.js +2 -4
  52. package/dist/presets/commands/init.js.map +1 -1
  53. package/dist/presets/constant/hooks.d.ts +0 -2
  54. package/dist/presets/constant/hooks.js +1 -3
  55. package/dist/presets/constant/hooks.js.map +1 -1
  56. package/dist/presets/files/generate-framework-info.js +68 -0
  57. package/dist/presets/files/generate-framework-info.js.map +1 -0
  58. package/dist/presets/files/{generateProjectConfig.js → generate-project-config.js} +1 -1
  59. package/dist/presets/files/generate-project-config.js.map +1 -0
  60. package/dist/presets/files/{writeFileToDist.js → write-file-to-dist.js} +1 -1
  61. package/dist/presets/files/write-file-to-dist.js.map +1 -0
  62. package/dist/presets/hooks/build.js +1 -3
  63. package/dist/presets/hooks/build.js.map +1 -1
  64. package/dist/presets/index.js +3 -5
  65. package/dist/presets/index.js.map +1 -1
  66. package/dist/util/{appConfig.d.ts → app-config.d.ts} +2 -2
  67. package/dist/util/{appConfig.js → app-config.js} +4 -3
  68. package/dist/util/app-config.js.map +1 -0
  69. package/dist/util/defineConfig.d.ts +5 -5
  70. package/dist/util/defineConfig.js.map +1 -1
  71. package/dist/util/index.d.ts +9 -1
  72. package/dist/util/index.js +54 -23
  73. package/dist/util/index.js.map +1 -1
  74. package/package.json +36 -39
  75. package/postinstall.js +1 -17
  76. package/src/cli.ts +185 -132
  77. package/src/commands/custom-command.ts +22 -0
  78. package/src/create/{fetchTemplate.ts → fetch-template.ts} +30 -35
  79. package/src/create/project.ts +31 -78
  80. package/src/create/template-creator.ts +325 -0
  81. package/src/doctor/validators.js +1 -0
  82. package/src/doctor/validators.ts +8 -6
  83. package/src/platform-weapp/apis-list.ts +33 -0
  84. package/src/platform-weapp/apis.ts +48 -0
  85. package/src/platform-weapp/components-react.ts +81 -0
  86. package/src/platform-weapp/components.ts +521 -0
  87. package/src/platform-weapp/index.ts +25 -0
  88. package/src/platform-weapp/program.ts +70 -0
  89. package/src/platform-weapp/runtime-utils.ts +57 -0
  90. package/src/platform-weapp/runtime.ts +6 -0
  91. package/src/platform-weapp/template.ts +150 -0
  92. package/src/presets/commands/build.ts +20 -40
  93. package/src/presets/commands/init.ts +1 -4
  94. package/src/presets/constant/hooks.js +12 -0
  95. package/src/presets/constant/hooks.ts +0 -2
  96. package/src/presets/files/{generateFrameworkInfo.ts → generate-framework-info.ts} +7 -1
  97. package/src/presets/hooks/build.ts +1 -3
  98. package/src/presets/index.ts +3 -5
  99. package/src/util/app-config.js +1 -0
  100. package/src/util/{appConfig.ts → app-config.ts} +5 -4
  101. package/src/util/defineConfig.ts +6 -6
  102. package/src/util/index.ts +67 -25
  103. package/templates/default/config/dev.js +1 -1
  104. package/templates/default/config/index.js +28 -40
  105. package/templates/default/config/prod.js +1 -1
  106. package/templates/default/package.json.tmpl +2 -17
  107. package/templates/default/types/global.d.ts +0 -4
  108. package/templates/plugin-compile/README.md +3 -1
  109. package/templates/plugin-compile/package.json.tmpl +1 -2
  110. package/templates/plugin-compile/src/index.ts +18 -28
  111. package/LICENSE +0 -174
  112. package/dist/commands/customCommand.js +0 -23
  113. package/dist/commands/customCommand.js.map +0 -1
  114. package/dist/config/packagesManagement.d.ts +0 -19
  115. package/dist/config/packagesManagement.js +0 -22
  116. package/dist/config/packagesManagement.js.map +0 -1
  117. package/dist/create/fetchTemplate.js.map +0 -1
  118. package/dist/create/page.d.ts +0 -65
  119. package/dist/create/page.js +0 -266
  120. package/dist/create/page.js.map +0 -1
  121. package/dist/create/plugin.d.ts +0 -16
  122. package/dist/create/plugin.js +0 -77
  123. package/dist/create/plugin.js.map +0 -1
  124. package/dist/presets/commands/config.js +0 -121
  125. package/dist/presets/commands/config.js.map +0 -1
  126. package/dist/presets/commands/create.js +0 -112
  127. package/dist/presets/commands/create.js.map +0 -1
  128. package/dist/presets/commands/doctor.js +0 -15
  129. package/dist/presets/commands/doctor.js.map +0 -1
  130. package/dist/presets/commands/global-config.d.ts +0 -3
  131. package/dist/presets/commands/global-config.js +0 -175
  132. package/dist/presets/commands/global-config.js.map +0 -1
  133. package/dist/presets/commands/help.d.ts +0 -3
  134. package/dist/presets/commands/help.js +0 -16
  135. package/dist/presets/commands/help.js.map +0 -1
  136. package/dist/presets/commands/info.d.ts +0 -3
  137. package/dist/presets/commands/info.js +0 -96
  138. package/dist/presets/commands/info.js.map +0 -1
  139. package/dist/presets/commands/inspect.d.ts +0 -3
  140. package/dist/presets/commands/inspect.js +0 -155
  141. package/dist/presets/commands/inspect.js.map +0 -1
  142. package/dist/presets/commands/update.d.ts +0 -3
  143. package/dist/presets/commands/update.js +0 -187
  144. package/dist/presets/commands/update.js.map +0 -1
  145. package/dist/presets/files/generateFrameworkInfo.d.ts +0 -3
  146. package/dist/presets/files/generateFrameworkInfo.js +0 -30
  147. package/dist/presets/files/generateFrameworkInfo.js.map +0 -1
  148. package/dist/presets/files/generateProjectConfig.d.ts +0 -3
  149. package/dist/presets/files/generateProjectConfig.js.map +0 -1
  150. package/dist/presets/files/writeFileToDist.d.ts +0 -3
  151. package/dist/presets/files/writeFileToDist.js.map +0 -1
  152. package/dist/presets/hooks/create.d.ts +0 -3
  153. package/dist/presets/hooks/create.js +0 -42
  154. package/dist/presets/hooks/create.js.map +0 -1
  155. package/dist/presets/platforms/plugin.d.ts +0 -3
  156. package/dist/presets/platforms/plugin.js +0 -106
  157. package/dist/presets/platforms/plugin.js.map +0 -1
  158. package/dist/presets/platforms/rn.d.ts +0 -3
  159. package/dist/presets/platforms/rn.js +0 -130
  160. package/dist/presets/platforms/rn.js.map +0 -1
  161. package/dist/util/appConfig.js.map +0 -1
  162. package/dist/util/createPage.d.ts +0 -9
  163. package/dist/util/createPage.js +0 -114
  164. package/dist/util/createPage.js.map +0 -1
  165. package/src/__tests__/__mocks__/presets.ts +0 -15
  166. package/src/__tests__/build-config.spec.ts +0 -66
  167. package/src/__tests__/cli.spec.ts +0 -226
  168. package/src/__tests__/config.spec.ts +0 -224
  169. package/src/__tests__/doctor-config.spec.ts +0 -918
  170. package/src/__tests__/doctor-recommand.spec.ts +0 -136
  171. package/src/__tests__/doctor.spec.ts +0 -94
  172. package/src/__tests__/dotenv-parse.spec.ts +0 -105
  173. package/src/__tests__/env/.env +0 -2
  174. package/src/__tests__/fixtures/default/.env +0 -3
  175. package/src/__tests__/fixtures/default/.env.development +0 -1
  176. package/src/__tests__/fixtures/default/.env.local +0 -1
  177. package/src/__tests__/fixtures/default/.env.pre +0 -3
  178. package/src/__tests__/fixtures/default/.env.production +0 -1
  179. package/src/__tests__/fixtures/default/.env.uat +0 -5
  180. package/src/__tests__/fixtures/default/.env.uat.local +0 -1
  181. package/src/__tests__/fixtures/default/babel.config.js +0 -10
  182. package/src/__tests__/fixtures/default/config/dev.js +0 -9
  183. package/src/__tests__/fixtures/default/config/index.js +0 -84
  184. package/src/__tests__/fixtures/default/config/prod.js +0 -18
  185. package/src/__tests__/fixtures/default/package.json +0 -27
  186. package/src/__tests__/fixtures/default/src/app.config.js +0 -11
  187. package/src/__tests__/fixtures/default/src/app.js +0 -16
  188. package/src/__tests__/fixtures/default/src/app.scss +0 -0
  189. package/src/__tests__/fixtures/default/src/index.html +0 -19
  190. package/src/__tests__/fixtures/default/src/pages/index/index.config.js +0 -3
  191. package/src/__tests__/fixtures/default/src/pages/index/index.jsx +0 -22
  192. package/src/__tests__/fixtures/default/src/pages/index/index.scss +0 -0
  193. package/src/__tests__/info.spec.ts +0 -72
  194. package/src/__tests__/inspect.spec.ts +0 -160
  195. package/src/__tests__/update.spec.ts +0 -310
  196. package/src/__tests__/utils/index.ts +0 -54
  197. package/src/commands/customCommand.ts +0 -22
  198. package/src/config/packagesManagement.ts +0 -20
  199. package/src/config/rn-stylelint.json +0 -4
  200. package/src/create/page.ts +0 -325
  201. package/src/create/plugin.ts +0 -55
  202. package/src/presets/commands/config.ts +0 -86
  203. package/src/presets/commands/create.ts +0 -104
  204. package/src/presets/commands/doctor.ts +0 -21
  205. package/src/presets/commands/global-config.ts +0 -140
  206. package/src/presets/commands/help.ts +0 -17
  207. package/src/presets/commands/info.ts +0 -81
  208. package/src/presets/commands/inspect.ts +0 -137
  209. package/src/presets/commands/update.ts +0 -175
  210. package/src/presets/hooks/create.ts +0 -9
  211. package/src/presets/platforms/plugin.ts +0 -75
  212. package/src/presets/platforms/rn.ts +0 -125
  213. package/src/util/createPage.ts +0 -139
  214. package/templates/default/babel.config.js +0 -14
  215. /package/dist/create/{fetchTemplate.d.ts → fetch-template.d.ts} +0 -0
  216. /package/dist/presets/{commands/config.d.ts → files/generate-framework-info.d.ts} +0 -0
  217. /package/dist/presets/{commands/create.d.ts → files/generate-project-config.d.ts} +0 -0
  218. /package/dist/presets/{commands/doctor.d.ts → files/write-file-to-dist.d.ts} +0 -0
  219. /package/src/presets/files/{generateProjectConfig.ts → generate-project-config.ts} +0 -0
  220. /package/src/presets/files/{writeFileToDist.ts → write-file-to-dist.ts} +0 -0
@@ -10,28 +10,13 @@
10
10
  "framework": "{{ framework }}"
11
11
  },
12
12
  "scripts": {
13
- "new": "taro new",
14
- "build:weapp": "taro build --type weapp",
15
- "dev:weapp": "npm run build:weapp -- --watch"
13
+ "build": "taro build",
14
+ "dev": "taro build --watch"
16
15
  },
17
- {{#if buildEs5 }}
18
- "browserslist": {
19
- "development": [
20
- "defaults and fully supports es6-module",
21
- "maintained node versions"
22
- ],
23
- "production": [
24
- "last 3 versions",
25
- "Android >= 4.1",
26
- "ios >= 8"
27
- ]
28
- },
29
- {{else}}
30
16
  "browserslist": [
31
17
  "defaults and fully supports es6-module",
32
18
  "maintained node versions"
33
19
  ],
34
- {{/if}}
35
20
  "author": "",
36
21
  "dependencies": {
37
22
  "@spcsn/taro-components": "{{ version }}",
@@ -6,10 +6,6 @@ declare module '*.jpg';
6
6
  declare module '*.jpeg';
7
7
  declare module '*.svg';
8
8
  declare module '*.css';
9
- declare module '*.less';
10
- declare module '*.scss';
11
- declare module '*.sass';
12
- declare module '*.styl';
13
9
 
14
10
  declare namespace NodeJS {
15
11
  interface ProcessEnv {
@@ -1,6 +1,8 @@
1
1
  # {{ projectName }}
2
2
 
3
3
  > {{ description }}
4
+ >
5
+ > 这是底座插件开发模板,不是业务应用接入模板。业务应用只需要使用 `@spcsn/taro`、`@spcsn/taro-components` 和 `@spcsn/taro-cli`。
4
6
 
5
7
  ## 使用
6
8
 
@@ -18,7 +20,7 @@ npm i {{ projectName }} -D
18
20
  * installPath: string 安装的路径
19
21
  * css?: 'none' | 'sass' | 'stylus' | 'less'
20
22
  * typescript?: boolean
21
- * compiler?: 'webpack5' | 'vite'
23
+ * compiler?: 'vite'
22
24
  * }
23
25
  * 这些参数后续会被模版文件解析所用
24
26
  * 如果不传,会从 package.json 的 templateInfo
@@ -28,8 +28,7 @@
28
28
  "url": ""
29
29
  },
30
30
  "dependencies": {
31
- "@spcsn/taro-service": "^{{ version }}"{{#if (eq pluginType "plugin-build") }},
32
- "webpack-chain": "^6.5.1"{{/if}}{{#if (eq pluginType "plugin-template") }},
31
+ "@spcsn/taro-cli": "^{{ version }}"{{#if (eq pluginType "plugin-template") }},
33
32
  "download": "^8.0.0",
34
33
  "fs-extra": "^11.2.0",
35
34
  "unzip": "^0.1.11"{{/if}}
@@ -1,6 +1,5 @@
1
- import type { IPluginContext } from '@spcsn/taro-service'
1
+ import type { IPluginContext } from '@spcsn/taro-cli/plugin'
2
2
  {{#if (eq pluginType "plugin-build") }}
3
- import webpackChain from 'webpack-chain'
4
3
 
5
4
  /**
6
5
  * 编译过程扩展
@@ -11,37 +10,28 @@ export default (ctx: IPluginContext, pluginOpts) => {
11
10
  console.log('编译开始')
12
11
  })
13
12
 
14
- ctx.modifyWebpackChain(({ chain }: { chain: webpackChain }) => {
15
- console.log('这里可以修改webpack配置')
16
- // 示例:利用webpackChain向html中插入脚本
17
- if (process.env.TARO_ENV !== 'h5') return
18
- chain
19
- .plugin('htmlWebpackPlugin')
20
- .tap(([pluginConfig]) => {
21
- return [
22
- {
23
- ...pluginConfig,
24
- script: pluginConfig.script + 'console.log("向html中插入代码");'
25
- }
26
- ]
27
- })
28
- })
29
-
30
- ctx.onBuildComplete(() => {
31
- console.log('Taro 构建完成!')
13
+ ctx.modifyViteConfig(({ viteConfig }) => {
14
+ console.log('这里可以修改 Vite 配置')
15
+ viteConfig.define = {
16
+ ...viteConfig.define,
17
+ __PLUGIN_EXAMPLE__: JSON.stringify(true),
18
+ }
32
19
  })
33
20
 
34
21
  ctx.modifyBuildAssets(({ assets }) => {
35
22
  console.log('修改编译后的结果')
36
- // 示例:修改html产物内容
37
- const indexHtml = assets['index.html']
38
- if (indexHtml && indexHtml._value) {
39
- indexHtml._value = indexHtml._value.replace(/<title>(.*?)<\/title>/,'<title>被插件修改过的标题</title>')
23
+ const appJson = assets['app.json']
24
+ if (appJson && appJson._value) {
25
+ appJson._value = appJson._value.replace('"style":"v2"', '"style":"v2"')
40
26
  }
41
27
  })
42
28
 
43
29
  ctx.onBuildFinish(() => {
44
- console.log('Webpack 编译结束!')
30
+ console.log('Vite 编译结束!')
31
+ })
32
+
33
+ ctx.onBuildComplete(() => {
34
+ console.log('Taro 构建完成!')
45
35
  })
46
36
  }
47
37
  {{/if}}
@@ -70,7 +60,7 @@ export default (ctx: IPluginContext, pluginOpts) => {
70
60
  }
71
61
  {{/if}}
72
62
  {{#if (eq pluginType "plugin-template") }}
73
- import * as fs from 'fs-extra'
63
+ import * as fs from 'node:fs'
74
64
  const path = require('path')
75
65
  const download = require('download')
76
66
  const unzip = require("unzip")
@@ -79,9 +69,9 @@ const unzip = require("unzip")
79
69
  */
80
70
 
81
71
  interface ITemplateInfo {
82
- css: 'none' | 'sass' | 'stylus' | 'less'
72
+ css: 'none'
83
73
  typescript?: boolean
84
- compiler?: 'webpack5' | 'vite'
74
+ compiler?: 'vite'
85
75
  template?: string
86
76
  }
87
77
 
package/LICENSE DELETED
@@ -1,174 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 O2Team
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
23
- ========================================================================
24
-
25
- MIT (react-devtools):
26
- The following files embed [react-devtools](https://github.com/facebook/react) MIT:
27
- `/packages/taro-plugin-react-devtools/src/backend/index.js`
28
- See `/LICENSE` for details of the license.
29
-
30
- ==================
31
-
32
- MIT (vue-devtools):
33
- The following files embed [vue-devtools](https://github.com/vuejs/devtools) MIT:
34
- `/packages/taro-plugin-vue-devtools/src/backend/*`
35
- See `/LICENSE` for details of the license.
36
-
37
- ==================
38
-
39
- MIT (vite):
40
- The following files embed [vite](https://github.com/vitejs/vite) MIT:
41
- `/packages/taro-webpack5-prebundle/src/prebundle/scanImport.ts`,
42
- `/packages/taro-webpack5-prebundle/src/prebundle/bundle.ts`,
43
- `/packages/taro-webpack5-prebundle/src/h5.ts`,
44
- `/packages/taro-webpack5-prebundle/src/min.ts`
45
- See `/LICENSE` for details of the license.
46
-
47
- ==================
48
-
49
- MIT (webpack):
50
- The following files embed [webpack](https://github.com/webpack/webpack) MIT:
51
- `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerEntryModule.ts`,
52
- `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerPlugin.ts`,
53
- `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerReferencePlugin.ts`,
54
- `/packages/taro-webpack5-prebundle/src/webpack/TaroModuleFederationPlugin.ts`
55
- See `/LICENSE` for details of the license.
56
-
57
- ==================
58
-
59
- MIT (sizzle):
60
- The following files embed [sizzle](https://github.com/jquery/sizzle) MIT:
61
- `/packages/taro-extends/src/jquery/sizzle.js`
62
- See `/LICENSE.txt` for details of the license.
63
-
64
- ==================
65
-
66
- MIT (zepto):
67
- The following files embed [zepto](https://github.com/madrobby/zepto) MIT:
68
- `/packages/taro-extends/src/jquery/zepto.js`,
69
- `/packages/taro-extends/src/jquery/event.js`
70
- See `/MIT-LICENSE` for details of the license.
71
-
72
- ==================
73
-
74
- MIT (css-to-react-native):
75
- The following files embed [css-to-react-native](https://github.com/styled-components/css-to-react-native) MIT:
76
- `/packages/css-to-react-native/src/css-to-react-native/*`
77
- See `/LICENSE.md` for details of the license.
78
-
79
- ==================
80
-
81
- MIT (reactify-wc):
82
- The following files embed [reactify-wc](https://github.com/BBKolton/reactify-wc) MIT:
83
- `/packages/taro-components-library-react/src/component-lib/reactify-wc.ts`
84
- See `/LICENSE` for details of the license.
85
-
86
- ==================
87
-
88
- MIT (ant-design-mobile-rn):
89
- The following files embed [ant-design-mobile-rn](https://github.com/ant-design/ant-design-mobile-rn) MIT:
90
- `/packages/taro-components-rn/src/components/Swiper/carousel.tsx`
91
- See `/LICENSE` for details of the license.
92
-
93
- ==================
94
-
95
- MIT (react-wx-images-viewer):
96
- The following files embed [react-wx-images-viewer](https://github.com/react-ld/react-wx-images-viewer) MIT:
97
- `/packages/taro-h5/src/api/media/image/previewImage.ts`
98
- See `/LICENSE` for details of the license.
99
-
100
- ==================
101
-
102
- MIT (webpack-contrib/css-loader):
103
- The following files embed [webpack-contrib/css-loader](https://github.com/webpack-contrib/css-loader) MIT:
104
- `/packages/taro-rn-style-transformer/src/utils/index.ts`
105
- See `/LICENSE` for details of the license.
106
-
107
- ==================
108
-
109
- MIT (react-native):
110
- The following files embed [react-native](https://github.com/facebook/react-native) MIT:
111
- `/packages/taro-rn-style-transformer/src/transforms/StyleSheet/*`
112
- See `/LICENSE` for details of the license.
113
-
114
- ==================
115
-
116
- MIT (myrne/performance-now):
117
- The following files embed [myrne/performance-now](https://github.com/myrne/performance-now) MIT:
118
- `/packages/taro-runtime/src/bom/raf.ts`
119
- See `/LICENSE` for details of the license.
120
-
121
- ==================
122
-
123
- Apache (chameleon-api):
124
- The following files embed [chameleon-api](https://github.com/chameleon-team/chameleon-api) Apache:
125
- `/packages/taro-h5/src/api/device/clipboard.ts`
126
-
127
- ==================
128
-
129
- MIT (uni-app):
130
- The following files embed [uni-app](https://github.com/dcloudio/uni-app) MIT:
131
- `/packages/taro-components-rn/src/components/Video/index.tsx`
132
- See `/LICENSE` for details of the license.
133
-
134
- ==================
135
-
136
- MIT (miniprogram-render):
137
- The following files embed [miniprogram-render](https://github.com/Tencent/kbone) MIT:
138
- `/packages/taro-plugin-http/src/runtime/Cookie.ts`
139
- See `/LICENSE` for details of the license.
140
-
141
- ==================
142
-
143
- MIT (stencil-ds-output-targets):
144
- The following files embed [stencil-ds-output-targets](https://github.com/ionic-team/stencil-ds-output-targets/) MIT:
145
- `/packages/taro-components-library-react/src/react-component-lib/utils/attachProps.ts`
146
- `/packages/taro-components-library-react/src/react-component-lib/utils/case.ts`
147
- `/packages/taro-components-library-react/src/react-component-lib/utils/dev.ts`
148
- `/packages/taro-components-library-react/src/react-component-lib/utils/index.tsx`
149
- `/packages/taro-components-library-react/src/react-component-lib/createComponent.tsx`
150
- `/packages/taro-components-library-react/src/react-component-lib/createOverlayComponent.tsx`
151
- `/packages/taro-components-library-react/src/react-component-lib/interfaces.ts`
152
- `/packages/taro-components-library-vue3/src/vue-component-lib/utils.ts`
153
- See `/LICENSE` for details of the license.
154
-
155
- ==================
156
-
157
- MIT (weui):
158
- The following files embed [weui](https://github.com/Tencent/weui) MIT:
159
- `/packages/taro-components/src/components/*.scss`
160
- See `/LICENSE.txt` for details of the license.
161
-
162
- ==================
163
-
164
- Apache-2.0 (intersection-observer):
165
- The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
166
- `/packages/taro-api/src/polyfill/intersection-observer.ts`
167
- See `/LICENSE.txt` for details of the license.
168
-
169
- ==================
170
-
171
- MIT (babel-plugin-jsx-dom-expressions):
172
- The following files embed [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions) MIT:
173
- `/packages/babel-plugin-transform-solid-jsx/src/*`
174
- See `/LICENSE` for details of the license.
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = customCommand;
4
- function customCommand(command, kernel, args) {
5
- if (typeof command === 'string') {
6
- const options = {};
7
- const excludeKeys = ['_', 'version', 'v', 'help', 'h', 'disable-global-config'];
8
- Object.keys(args).forEach((key) => {
9
- if (!excludeKeys.includes(key)) {
10
- options[key] = args[key];
11
- }
12
- });
13
- kernel.run({
14
- name: command,
15
- opts: {
16
- _: args._,
17
- options,
18
- isHelp: args.h,
19
- },
20
- });
21
- }
22
- }
23
- //# sourceMappingURL=customCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customCommand.js","sourceRoot":"","sources":["../../src/commands/customCommand.ts"],"names":[],"mappings":";;AAEA,gCAmBC;AAnBD,SAAwB,aAAa,CAAC,OAAe,EAAE,MAAc,EAAE,IAAyC;IAC9G,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,CAAC,CAAC;QAChF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,CAAC;YACT,IAAI,EAAE,OAAO;YACb,IAAI,EAAE;gBACJ,CAAC,EAAE,IAAI,CAAC,CAAC;gBACT,OAAO;gBACP,MAAM,EAAE,IAAI,CAAC,CAAC;aACf;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -1,19 +0,0 @@
1
- declare const packagesManagement: {
2
- yarn: {
3
- command: string;
4
- globalCommand: string;
5
- };
6
- pnpm: {
7
- command: string;
8
- globalCommand: string;
9
- };
10
- cnpm: {
11
- command: string;
12
- globalCommand: string;
13
- };
14
- npm: {
15
- command: string;
16
- globalCommand: string;
17
- };
18
- };
19
- export default packagesManagement;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const packagesManagement = {
4
- yarn: {
5
- command: 'yarn install',
6
- globalCommand: 'yarn global add @spcsn/taro-cli',
7
- },
8
- pnpm: {
9
- command: 'pnpm install',
10
- globalCommand: 'pnpm add -g @spcsn/taro-cli',
11
- },
12
- cnpm: {
13
- command: 'cnpm install',
14
- globalCommand: 'cnpm i -g @spcsn/taro-cli',
15
- },
16
- npm: {
17
- command: 'npm install',
18
- globalCommand: 'npm i -g @spcsn/taro-cli',
19
- },
20
- };
21
- exports.default = packagesManagement;
22
- //# sourceMappingURL=packagesManagement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packagesManagement.js","sourceRoot":"","sources":["../../src/config/packagesManagement.ts"],"names":[],"mappings":";;AAAA,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE;QACJ,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,iCAAiC;KACjD;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,6BAA6B;KAC7C;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,2BAA2B;KAC3C;IACD,GAAG,EAAE;QACH,OAAO,EAAE,aAAa;QACtB,aAAa,EAAE,0BAA0B;KAC1C;CACF,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchTemplate.js","sourceRoot":"","sources":["../../src/create/fetchTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,gCA2IC;AAhKD,gDAAkC;AAElC,oDAA+C;AAC/C,gDAAkC;AAClC,kDAA0B;AAC1B,4DAA8C;AAC9C,8CAAsB;AAEtB,kCAAsE;AACtE,2CAA+C;AAU/C,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAEzC,SAAwB,aAAa,CACnC,cAAsB,EACtB,gBAAwB,EACxB,KAAe;IAEf,MAAM,IAAI,GAAG,IAAA,4BAAqB,EAAC,cAAc,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IACnE,IAAI,IAAY,CAAC;IACjB,qDAAqD;IACrD,OAAO,IAAI,OAAO,CAAO,KAAK,EAA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AAS;oBACT,QAAQ;oBACR,IAAI;iBACL,CAAC;YACJ,CAAC,CAAC;iBACD,MAAM,CAAC,OAAO,CAAiB,CAAC;YAEnC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM;YACN,MAAM,gBAAE,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACtF,MAAM,gBAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE1B,IAAI,GAAG,GAAe,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAExF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,4BAAgB,CAAC,CAAC;YAExE,IAAI,gBAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;gBAExF,GAAG,GAAG;oBACJ,IAAI,EAAE,WAAW,IAAI,IAAI;oBACzB,KAAK,EAAE,IAAI;oBACX,SAAS;oBACT,QAAQ;oBACR,IAAI,EAAE,IAAI,IAAI,cAAc;iBAC7B,CAAC;YACJ,CAAC;YAED,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,65 +0,0 @@
1
- import { CompilerType, CSSType, FrameworkType, NpmType } from '@spcsn/taro-binding';
2
- import Creator from './creator';
3
- export interface IPageConf {
4
- projectDir: string;
5
- projectName: string;
6
- npm: NpmType;
7
- template: string;
8
- clone?: boolean;
9
- templateSource?: string;
10
- description?: string;
11
- pageName: string;
12
- date?: string;
13
- framework: FrameworkType;
14
- css: CSSType;
15
- typescript?: boolean;
16
- compiler?: CompilerType;
17
- isCustomTemplate?: boolean;
18
- customTemplatePath?: string;
19
- pageDir?: string;
20
- subPkg?: string;
21
- }
22
- interface IPageArgs extends IPageConf {
23
- modifyCustomTemplateConfig: TGetCustomTemplate;
24
- afterCreate?: TAfterCreate;
25
- }
26
- interface ITemplateInfo {
27
- css: CSSType;
28
- typescript?: boolean;
29
- compiler?: CompilerType;
30
- template?: string;
31
- templateSource?: string;
32
- clone?: boolean;
33
- }
34
- type TCustomTemplateInfo = Omit<ITemplateInfo & {
35
- isCustomTemplate?: boolean;
36
- customTemplatePath?: string;
37
- }, 'template'>;
38
- export type TSetCustomTemplateConfig = (customTemplateConfig: TCustomTemplateInfo) => void;
39
- type TGetCustomTemplate = (cb: TSetCustomTemplateConfig) => Promise<void>;
40
- type TAfterCreate = (state: boolean) => void;
41
- export declare enum ConfigModificationState {
42
- Success = 0,
43
- Fail = 1,
44
- NeedLess = 2
45
- }
46
- export type ModifyCallback = (state: ConfigModificationState) => void;
47
- export default class Page extends Creator {
48
- rootPath: string;
49
- conf: IPageConf;
50
- private modifyCustomTemplateConfig;
51
- private afterCreate;
52
- private pageEntryPath;
53
- constructor(args: IPageArgs);
54
- processPageName(): void;
55
- getPkgPath(): string;
56
- getPkgTemplateInfo(): any;
57
- setPageEntryPath(files: string[], handler: any): void;
58
- setCustomTemplateConfig(customTemplateConfig: TCustomTemplateInfo): void;
59
- setTemplateConfig(templateInfo: ITemplateInfo): void;
60
- fetchTemplates(): Promise<void>;
61
- create(): Promise<void>;
62
- updateAppConfig(): void;
63
- write(): void;
64
- }
65
- export type { Page as PageCreator };