@baic/yolk-cli 2.1.0-alpha.11 → 2.1.0-alpha.110
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/compiled/commander/index.d.ts +430 -0
- package/compiled/commander/index.js +1970 -0
- package/compiled/commander/package.json +1 -0
- package/compiled/glob/index.d.ts +101 -0
- package/compiled/glob/index.js +2222 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/minimatch/index.d.ts +312 -0
- package/compiled/minimatch/index.js +1292 -0
- package/compiled/minimatch/package.json +1 -0
- package/compiled/mkdirp/index.d.ts +114 -0
- package/compiled/mkdirp/index.js +348 -0
- package/compiled/mkdirp/package.json +1 -0
- package/compiled/mustache/index.d.ts +423 -0
- package/compiled/mustache/index.js +828 -0
- package/compiled/mustache/package.json +1 -0
- package/compiled/prettier/index.d.ts +904 -0
- package/compiled/prettier/index.js +49577 -0
- package/compiled/prettier/package.json +1 -0
- package/compiled/rimraf/index.d.ts +48 -0
- package/compiled/rimraf/index.js +449 -0
- package/compiled/rimraf/package.json +1 -0
- package/compiled/staged-git-files/index.js +267 -0
- package/compiled/staged-git-files/package.json +1 -0
- package/es/.prettierrc.js +15 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -1
- package/es/yolk.d.ts +5 -1
- package/es/yolk.js +1 -1
- package/lib/.prettierrc.js +15 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/yolk.d.ts +5 -1
- package/lib/yolk.js +1 -1
- package/package.json +39 -26
- package/templates/miniprogram/.eslintrc +1 -1
- package/templates/miniprogram/.gitignore.tpl +13 -11
- package/templates/miniprogram/.npmrc.tpl +2 -0
- package/templates/miniprogram/.prettierignore +5 -1
- package/templates/miniprogram/.prettierrc.js +1 -0
- package/templates/miniprogram/README.md.tpl +2 -2
- package/templates/miniprogram/global.d.ts +1 -33
- package/templates/miniprogram/package.json.tpl +5 -0
- package/templates/miniprogram/project.config.json.tpl +2 -2
- package/templates/miniprogram/src/app.scss +0 -1
- package/templates/miniprogram/src/app.tsx +4 -6
- package/templates/miniprogram/src/pages/demo/examples/Input.tsx +11 -2
- package/templates/miniprogram/src/pages/index/index.tsx +3 -1
- package/templates/miniprogram/src/types/user.d.ts +4 -2
- package/templates/umi-mobile/.eslintrc +1 -1
- package/templates/umi-mobile/.gitignore.tpl +8 -5
- package/templates/umi-mobile/.npmrc.tpl +2 -0
- package/templates/umi-mobile/.prettierignore +6 -2
- package/templates/umi-mobile/.prettierrc.js +1 -0
- package/templates/umi-mobile/.umirc.ts.tpl +2 -2
- package/templates/umi-mobile/README.md.tpl +2 -2
- package/templates/umi-mobile/package.json.tpl +5 -0
- package/templates/{umi-web-screen/src/.umi-production → umi-mobile/src/.umi}/core/EmptyRoute.tsx +3 -2
- package/templates/umi-mobile/src/.umi/core/defineApp.ts +21 -0
- package/templates/{umi-web-screen → umi-mobile}/src/.umi/core/history.ts +26 -9
- package/templates/umi-mobile/src/.umi/core/historyIntelli.ts +132 -0
- package/templates/umi-mobile/src/.umi/core/plugin.ts +83 -0
- package/templates/umi-mobile/src/.umi/core/pluginConfig.d.ts +295 -0
- package/templates/umi-mobile/src/.umi/core/polyfill.ts +191 -0
- package/templates/umi-mobile/src/.umi/core/route.tsx +267 -0
- package/templates/umi-mobile/src/.umi/core/routeProps.js +3 -0
- package/templates/{umi-web-screen/src/.umi/core/EmptyRoute.tsx → umi-mobile/src/.umi/core/routeProps.ts} +1 -4
- package/templates/umi-mobile/src/.umi/core/terminal.ts +62 -0
- package/templates/umi-mobile/src/.umi/exports.ts +51 -0
- package/templates/umi-mobile/src/.umi/plugin-clickToComponent/runtime.tsx +19 -0
- package/templates/umi-mobile/src/.umi/plugin-errorBoundary/runtime.tsx +67 -0
- package/templates/umi-mobile/src/.umi/plugin-hd/runtime.tsx +57 -0
- package/templates/umi-mobile/src/.umi/testBrowser.tsx +91 -0
- package/templates/{umi-web-screen → umi-mobile}/src/.umi/tsconfig.json +11 -14
- package/templates/umi-mobile/src/.umi/typings.d.ts +138 -0
- package/templates/umi-mobile/src/.umi/umi.ts +76 -0
- package/templates/umi-mobile/src/app.tsx +2 -2
- package/templates/umi-mobile/src/pages/404.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +1 -3
- package/templates/umi-mobile/src/pages/demo/examples/List/1.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/List/2.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/examples/List/3.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +9 -10
- package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +1 -3
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +1 -3
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +1 -3
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +1 -3
- package/templates/umi-mobile/src/pages/demo/examples/PagingList/1.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/index.tsx +8 -8
- package/templates/umi-mobile/src/pages/index.tsx +0 -2
- package/templates/umi-mobile/src/types/user.d.ts +2 -2
- package/templates/umi-mobile-h5+app/.eslintrc +1 -1
- package/templates/umi-mobile-h5+app/.gitignore.tpl +8 -5
- package/templates/umi-mobile-h5+app/.npmrc.tpl +2 -0
- package/templates/umi-mobile-h5+app/.prettierignore +6 -2
- package/templates/umi-mobile-h5+app/.prettierrc.js +1 -0
- package/templates/umi-mobile-h5+app/.umirc.ts.tpl +2 -2
- package/templates/umi-mobile-h5+app/README.md.tpl +2 -2
- package/templates/umi-mobile-h5+app/package.json.tpl +5 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/Input.tsx +1 -2
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/4.tsx +2 -2
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +1 -2
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +1 -2
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +1 -2
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +1 -2
- package/templates/umi-mobile-h5+app/src/types/user.d.ts +2 -2
- package/templates/umi-mobile-native/.eslintrc +1 -1
- package/templates/umi-mobile-native/.gitignore.tpl +14 -6
- package/templates/umi-mobile-native/.npmrc.tpl +2 -0
- package/templates/umi-mobile-native/.prettierignore +6 -2
- package/templates/umi-mobile-native/.prettierrc.js +1 -0
- package/templates/umi-mobile-native/.umirc.ts.tpl +2 -2
- package/templates/umi-mobile-native/README.md.tpl +2 -2
- package/templates/umi-mobile-native/package.json.tpl +5 -0
- package/templates/umi-mobile-native/src/common/Xprinter.ts +4 -4
- package/templates/umi-mobile-native/src/common/bluetooth.ts +2 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/Input.tsx +1 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/List/4.tsx +2 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +1 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +1 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +1 -2
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +1 -2
- package/templates/umi-mobile-native/src/types/user.d.ts +2 -2
- package/templates/umi-web/.eslintrc +1 -1
- package/templates/umi-web/.gitignore.tpl +8 -5
- package/templates/umi-web/.npmrc.tpl +2 -0
- package/templates/umi-web/.prettierignore +6 -2
- package/templates/umi-web/.prettierrc.js +1 -0
- package/templates/umi-web/.umirc.ts.tpl +1 -2
- package/templates/umi-web/README.md.tpl +1 -1
- package/templates/umi-web/package.json.tpl +5 -0
- package/templates/umi-web/src/pages/404.tsx +2 -3
- package/templates/umi-web/src/pages/demo/examples/BankInput.tsx +1 -2
- package/templates/umi-web/src/pages/demo/examples/Grid/5.tsx +1 -2
- package/templates/umi-web/src/pages/demo/examples/Input/2.tsx +2 -1
- package/templates/umi-web/src/pages/demo/examples/RangeNumber/2.tsx +1 -2
- package/templates/umi-web/src/pages/demo/examples/SearchLayout.tsx +2 -2
- package/templates/umi-web/src/pages/demo/index.tsx +3 -2
- package/templates/umi-web/src/pages/index.tsx +0 -2
- package/templates/umi-web/src/types/user.d.ts +2 -2
- package/templates/umi-web-screen/.eslintrc +1 -1
- package/templates/umi-web-screen/.gitignore.tpl +8 -5
- package/templates/umi-web-screen/.npmrc.tpl +2 -0
- package/templates/umi-web-screen/.prettierignore +6 -2
- package/templates/umi-web-screen/.prettierrc.js +1 -0
- package/templates/umi-web-screen/.umirc.ts.tpl +3 -2
- package/templates/umi-web-screen/README.md.tpl +1 -1
- package/templates/umi-web-screen/package.json.tpl +5 -0
- package/templates/umi-web-screen/src/components/resize-container/index.tsx +14 -14
- package/templates/umi-web-screen/src/layouts/controller/index.tsx +5 -9
- package/templates/umi-web-screen/src/pages/404.tsx +2 -3
- package/templates/umi-web-screen/src/pages/template/components/charts/demo-line/index.tsx +2 -3
- package/templates/umi-web-screen/src/pages/template/controller/index.tsx +11 -12
- package/templates/umi-web-screen/src/types/user.d.ts +2 -2
- package/templates/ice-mobile/.eslintrc +0 -6
- package/templates/ice-mobile/.gitignore.tpl +0 -30
- package/templates/ice-mobile/.icerc.ts +0 -3
- package/templates/ice-mobile/.prettierignore +0 -9
- package/templates/ice-mobile/.prettierrc +0 -11
- package/templates/ice-mobile/.stylelintrc +0 -3
- package/templates/ice-mobile/README.md.tpl +0 -34
- package/templates/ice-mobile/package.json.tpl +0 -11
- package/templates/ice-mobile/public/favicon.ico +0 -0
- package/templates/ice-mobile/public/index.html +0 -15
- package/templates/ice-mobile/src/app.tsx +0 -5
- package/templates/ice-mobile/src/common/request.ts +0 -3
- package/templates/ice-mobile/src/common/util.ts +0 -7
- package/templates/ice-mobile/src/components/index.ts +0 -0
- package/templates/ice-mobile/src/global.less +0 -3
- package/templates/ice-mobile/src/layouts/index.tsx +0 -5
- package/templates/ice-mobile/src/pages/404.tsx +0 -10
- package/templates/ice-mobile/src/pages/demo/examples/BarCode.tsx +0 -4
- package/templates/ice-mobile/src/pages/demo/examples/Iconfont.tsx +0 -18
- package/templates/ice-mobile/src/pages/demo/examples/Input.tsx +0 -17
- package/templates/ice-mobile/src/pages/demo/examples/List/1.tsx +0 -12
- package/templates/ice-mobile/src/pages/demo/examples/List/2.tsx +0 -29
- package/templates/ice-mobile/src/pages/demo/examples/List/3.tsx +0 -29
- package/templates/ice-mobile/src/pages/demo/examples/List/4.tsx +0 -55
- package/templates/ice-mobile/src/pages/demo/examples/List/mock.ts +0 -30
- package/templates/ice-mobile/src/pages/demo/examples/Loading.tsx +0 -12
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/1.tsx +0 -17
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/2.tsx +0 -17
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/3.tsx +0 -17
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/4.tsx +0 -17
- package/templates/ice-mobile/src/pages/demo/examples/PagingList/1.tsx +0 -6
- package/templates/ice-mobile/src/pages/demo/examples/QrCode.tsx +0 -4
- package/templates/ice-mobile/src/pages/demo/examples/Required.tsx +0 -4
- package/templates/ice-mobile/src/pages/demo/examples/TimerButton.tsx +0 -4
- package/templates/ice-mobile/src/pages/demo/examples/usePreload.tsx +0 -9
- package/templates/ice-mobile/src/pages/demo/index.tsx +0 -87
- package/templates/ice-mobile/src/pages/index.tsx +0 -3
- package/templates/ice-mobile/src/routes.ts +0 -29
- package/templates/ice-mobile/src/types/user.d.ts +0 -3
- package/templates/ice-mobile/tsconfig.json +0 -3
- package/templates/ice-mobile/typings.d.ts +0 -1
- package/templates/ice-mobile-h5+app/.eslintrc +0 -6
- package/templates/ice-mobile-h5+app/.gitignore.tpl +0 -30
- package/templates/ice-mobile-h5+app/.icerc.ts +0 -5
- package/templates/ice-mobile-h5+app/.prettierignore +0 -9
- package/templates/ice-mobile-h5+app/.prettierrc +0 -11
- package/templates/ice-mobile-h5+app/.stylelintrc +0 -3
- package/templates/ice-mobile-h5+app/README.md.tpl +0 -34
- package/templates/ice-mobile-h5+app/h5+app/manifest.json +0 -87
- package/templates/ice-mobile-h5+app/package.json.tpl +0 -11
- package/templates/ice-mobile-h5+app/public/favicon.ico +0 -0
- package/templates/ice-mobile-h5+app/public/index.html +0 -15
- package/templates/ice-mobile-h5+app/src/app.tsx +0 -5
- package/templates/ice-mobile-h5+app/src/common/request.ts +0 -3
- package/templates/ice-mobile-h5+app/src/common/util.ts +0 -7
- package/templates/ice-mobile-h5+app/src/components/index.ts +0 -0
- package/templates/ice-mobile-h5+app/src/global.less +0 -3
- package/templates/ice-mobile-h5+app/src/layouts/index.tsx +0 -5
- package/templates/ice-mobile-h5+app/src/pages/404.tsx +0 -10
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/BarCode.tsx +0 -4
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +0 -18
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Input.tsx +0 -17
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/1.tsx +0 -12
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/2.tsx +0 -29
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/3.tsx +0 -29
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/4.tsx +0 -55
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/mock.ts +0 -30
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Loading.tsx +0 -12
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +0 -17
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +0 -17
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +0 -17
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +0 -17
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +0 -6
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/QrCode.tsx +0 -4
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Required.tsx +0 -4
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/TimerButton.tsx +0 -4
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +0 -9
- package/templates/ice-mobile-h5+app/src/pages/demo/index.tsx +0 -87
- package/templates/ice-mobile-h5+app/src/pages/index.tsx +0 -3
- package/templates/ice-mobile-h5+app/src/routes.ts +0 -29
- package/templates/ice-mobile-h5+app/src/types/user.d.ts +0 -3
- package/templates/ice-mobile-h5+app/tsconfig.json +0 -3
- package/templates/ice-mobile-h5+app/typings.d.ts +0 -1
- package/templates/ice-mobile-native/.eslintrc +0 -6
- package/templates/ice-mobile-native/.gitignore.tpl +0 -30
- package/templates/ice-mobile-native/.icerc.ts +0 -7
- package/templates/ice-mobile-native/.prettierignore +0 -9
- package/templates/ice-mobile-native/.prettierrc +0 -11
- package/templates/ice-mobile-native/.stylelintrc +0 -3
- package/templates/ice-mobile-native/README.md.tpl +0 -34
- package/templates/ice-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
- package/templates/ice-mobile-native/android/app/build.gradle +0 -66
- package/templates/ice-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
- package/templates/ice-mobile-native/android/app/libs/PosPrinterSDK.jar +0 -0
- package/templates/ice-mobile-native/android/app/libs/android-gif-drawable-release@1.2.23.aar +0 -0
- package/templates/ice-mobile-native/android/app/libs/lib.5plus.base-release.aar +0 -0
- package/templates/ice-mobile-native/android/app/libs/oaid_sdk_1.0.25.aar +0 -0
- package/templates/ice-mobile-native/android/app/libs/webview-x5-release.aar +0 -0
- package/templates/ice-mobile-native/android/app/proguard-rules.pro +0 -303
- package/templates/ice-mobile-native/android/app/src/main/AndroidManifest.xml +0 -98
- package/templates/ice-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +0 -89
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +0 -6
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_error.html +0 -92
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +0 -19
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +0 -119
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +0 -17
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +0 -17
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +0 -26
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +0 -265
- package/templates/ice-mobile-native/android/app/src/main/res/drawable/icon.png +0 -0
- package/templates/ice-mobile-native/android/app/src/main/res/values/colors.xml +0 -5
- package/templates/ice-mobile-native/android/app/src/main/res/values/strings.xml +0 -3
- package/templates/ice-mobile-native/android/build.gradle +0 -9
- package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/templates/ice-mobile-native/android/gradle.properties +0 -22
- package/templates/ice-mobile-native/android/gradlew +0 -185
- package/templates/ice-mobile-native/android/gradlew.bat +0 -89
- package/templates/ice-mobile-native/android/settings.gradle +0 -16
- package/templates/ice-mobile-native/ios/HBuilder/HBuilder.entitlements +0 -5
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120-1.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/180x180.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/40x40.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/58x58.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/60x60.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/80x80.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/87x87.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/Contents.json +0 -62
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +0 -6
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +0 -20
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/120x120.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/180x180.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/60x60.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/Contents.json +0 -26
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +0 -21
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/brightness@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211-1.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206-1.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset/Contents.json +0 -21
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset//345/257/271/347/204/246/347/272/277.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset//345/257/271/347/204/246/345/272/225-1.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset//345/257/271/347/204/246/345/272/225.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/Contents.json +0 -23
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/Contents.json +0 -23
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/Contents.json +0 -23
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/Contents.json +0 -23
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/Contents.json +0 -22
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@2x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@3x.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/120x120.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/180x180.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.h +0 -16
- package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.m +0 -225
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +0 -65
- package/templates/ice-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +0 -13
- package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +0 -486
- package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +0 -16
- package/templates/ice-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +0 -67
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +0 -79
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/1024x1024.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/120x120.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/144x144.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/152x152.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/167x167.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/180x180.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/192x192.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/20x20.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/29x29.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/40x40.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/58x58.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/60x60.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/72x72.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/76x76.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/80x80.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/87x87.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/96x96.png +0 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.h +0 -19
- package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.m +0 -161
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.h +0 -19
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.m +0 -235
- package/templates/ice-mobile-native/ios/HBuilder-Hello/control.xml +0 -107
- package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +0 -4
- package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +0 -12
- package/templates/ice-mobile-native/ios/HBuilder-Hello/main.m +0 -18
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +0 -4
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +0 -3
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +0 -13
- package/templates/ice-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +0 -1607
- package/templates/ice-mobile-native/package.json.tpl +0 -11
- package/templates/ice-mobile-native/public/favicon.ico +0 -0
- package/templates/ice-mobile-native/public/index.html +0 -15
- package/templates/ice-mobile-native/src/app.tsx +0 -5
- package/templates/ice-mobile-native/src/common/Xprinter.ts +0 -58
- package/templates/ice-mobile-native/src/common/bluetooth.ts +0 -354
- package/templates/ice-mobile-native/src/common/bridge.ts +0 -59
- package/templates/ice-mobile-native/src/common/request.ts +0 -3
- package/templates/ice-mobile-native/src/common/util.ts +0 -7
- package/templates/ice-mobile-native/src/components/index.ts +0 -0
- package/templates/ice-mobile-native/src/global.less +0 -3
- package/templates/ice-mobile-native/src/layouts/index.tsx +0 -5
- package/templates/ice-mobile-native/src/pages/404.tsx +0 -10
- package/templates/ice-mobile-native/src/pages/demo/examples/BarCode.tsx +0 -4
- package/templates/ice-mobile-native/src/pages/demo/examples/Iconfont.tsx +0 -18
- package/templates/ice-mobile-native/src/pages/demo/examples/Input.tsx +0 -17
- package/templates/ice-mobile-native/src/pages/demo/examples/List/1.tsx +0 -12
- package/templates/ice-mobile-native/src/pages/demo/examples/List/2.tsx +0 -29
- package/templates/ice-mobile-native/src/pages/demo/examples/List/3.tsx +0 -29
- package/templates/ice-mobile-native/src/pages/demo/examples/List/4.tsx +0 -55
- package/templates/ice-mobile-native/src/pages/demo/examples/List/mock.ts +0 -30
- package/templates/ice-mobile-native/src/pages/demo/examples/Loading.tsx +0 -12
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +0 -17
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +0 -17
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +0 -17
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +0 -17
- package/templates/ice-mobile-native/src/pages/demo/examples/PagingList/1.tsx +0 -6
- package/templates/ice-mobile-native/src/pages/demo/examples/QrCode.tsx +0 -4
- package/templates/ice-mobile-native/src/pages/demo/examples/Required.tsx +0 -4
- package/templates/ice-mobile-native/src/pages/demo/examples/TimerButton.tsx +0 -4
- package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +0 -64
- package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/style.less +0 -16
- package/templates/ice-mobile-native/src/pages/demo/examples/usePreload.tsx +0 -9
- package/templates/ice-mobile-native/src/pages/demo/index.tsx +0 -89
- package/templates/ice-mobile-native/src/pages/index.tsx +0 -3
- package/templates/ice-mobile-native/src/routes.ts +0 -29
- package/templates/ice-mobile-native/src/types/user.d.ts +0 -3
- package/templates/ice-mobile-native/tsconfig.json +0 -3
- package/templates/ice-mobile-native/typings.d.ts +0 -1
- package/templates/ice-web/.eslintcache +0 -1
- package/templates/ice-web/.eslintrc +0 -6
- package/templates/ice-web/.gitignore.tpl +0 -30
- package/templates/ice-web/.icerc.ts +0 -3
- package/templates/ice-web/.prettierignore +0 -9
- package/templates/ice-web/.prettierrc +0 -11
- package/templates/ice-web/.stylelintrc +0 -3
- package/templates/ice-web/README.md.tpl +0 -34
- package/templates/ice-web/package.json.tpl +0 -11
- package/templates/ice-web/public/favicon.ico +0 -0
- package/templates/ice-web/public/index.html +0 -15
- package/templates/ice-web/src/app.tsx +0 -5
- package/templates/ice-web/src/common/request.ts +0 -3
- package/templates/ice-web/src/common/util.ts +0 -7
- package/templates/ice-web/src/components/index.ts +0 -0
- package/templates/ice-web/src/global.less +0 -5
- package/templates/ice-web/src/layouts/index.tsx +0 -5
- package/templates/ice-web/src/pages/404.tsx +0 -17
- package/templates/ice-web/src/pages/demo/examples/BankInput.tsx +0 -13
- package/templates/ice-web/src/pages/demo/examples/BarCode.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/Collapse.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/DatePicker.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/Flex.tsx +0 -10
- package/templates/ice-web/src/pages/demo/examples/Grid/1.tsx +0 -25
- package/templates/ice-web/src/pages/demo/examples/Grid/2.tsx +0 -26
- package/templates/ice-web/src/pages/demo/examples/Grid/3.tsx +0 -37
- package/templates/ice-web/src/pages/demo/examples/Grid/4.tsx +0 -43
- package/templates/ice-web/src/pages/demo/examples/Grid/5.tsx +0 -36
- package/templates/ice-web/src/pages/demo/examples/Grid/6.tsx +0 -28
- package/templates/ice-web/src/pages/demo/examples/Iconfont.tsx +0 -18
- package/templates/ice-web/src/pages/demo/examples/ImagePreview.tsx +0 -20
- package/templates/ice-web/src/pages/demo/examples/Input/1.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/Input/2.tsx +0 -80
- package/templates/ice-web/src/pages/demo/examples/LinkButton/1.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/LinkButton/2.tsx +0 -9
- package/templates/ice-web/src/pages/demo/examples/LinkButton/3.tsx +0 -12
- package/templates/ice-web/src/pages/demo/examples/Loading.tsx +0 -12
- package/templates/ice-web/src/pages/demo/examples/MobileInput.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/NumberInput.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/PagingTable.tsx +0 -21
- package/templates/ice-web/src/pages/demo/examples/QrCode.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/RangeNumber/1.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/RangeNumber/2.tsx +0 -15
- package/templates/ice-web/src/pages/demo/examples/Required.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/SearchLayout.tsx +0 -46
- package/templates/ice-web/src/pages/demo/examples/Table/1.tsx +0 -64
- package/templates/ice-web/src/pages/demo/examples/Table/2.tsx +0 -29
- package/templates/ice-web/src/pages/demo/examples/Table/3.tsx +0 -39
- package/templates/ice-web/src/pages/demo/examples/Table/4.tsx +0 -42
- package/templates/ice-web/src/pages/demo/examples/TimerButton.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/Title/1.tsx +0 -4
- package/templates/ice-web/src/pages/demo/examples/Title/2.tsx +0 -5
- package/templates/ice-web/src/pages/demo/examples/WaterMark.tsx +0 -8
- package/templates/ice-web/src/pages/demo/examples/Wrapper.tsx +0 -40
- package/templates/ice-web/src/pages/demo/examples/usePreload.tsx +0 -9
- package/templates/ice-web/src/pages/demo/index.tsx +0 -135
- package/templates/ice-web/src/pages/index.tsx +0 -3
- package/templates/ice-web/src/routes.ts +0 -29
- package/templates/ice-web/src/types/user.d.ts +0 -3
- package/templates/ice-web/tsconfig.json +0 -3
- package/templates/ice-web/typings.d.ts +0 -1
- package/templates/ice-web-screen/.eslintcache +0 -1
- package/templates/ice-web-screen/.eslintrc +0 -6
- package/templates/ice-web-screen/.gitignore.tpl +0 -30
- package/templates/ice-web-screen/.icerc.ts +0 -3
- package/templates/ice-web-screen/.prettierignore +0 -9
- package/templates/ice-web-screen/.prettierrc +0 -11
- package/templates/ice-web-screen/.stylelintrc +0 -3
- package/templates/ice-web-screen/README.md.tpl +0 -34
- package/templates/ice-web-screen/package.json.tpl +0 -12
- package/templates/ice-web-screen/public/favicon.ico +0 -0
- package/templates/ice-web-screen/public/index.html +0 -15
- package/templates/ice-web-screen/src/app.tsx +0 -5
- package/templates/ice-web-screen/src/common/request.ts +0 -3
- package/templates/ice-web-screen/src/common/util.ts +0 -15
- package/templates/ice-web-screen/src/components/index.ts +0 -1
- package/templates/ice-web-screen/src/components/resize-container/index.tsx +0 -95
- package/templates/ice-web-screen/src/components/resize-container/style.module.less +0 -3
- package/templates/ice-web-screen/src/constants.ts +0 -7
- package/templates/ice-web-screen/src/global.less +0 -31
- package/templates/ice-web-screen/src/hooks/use-size.ts +0 -18
- package/templates/ice-web-screen/src/layouts/16_9/fixed.less +0 -18
- package/templates/ice-web-screen/src/layouts/16_9/index.less.d.ts +0 -8
- package/templates/ice-web-screen/src/layouts/16_9/index.tsx +0 -34
- package/templates/ice-web-screen/src/layouts/16_9/style.less.d.ts +0 -10
- package/templates/ice-web-screen/src/layouts/16_9/style.module.less +0 -19
- package/templates/ice-web-screen/src/layouts/components/index.ts +0 -0
- package/templates/ice-web-screen/src/layouts/controller/index.tsx +0 -79
- package/templates/ice-web-screen/src/layouts/index.tsx +0 -11
- package/templates/ice-web-screen/src/pages/404.tsx +0 -17
- package/templates/ice-web-screen/src/pages/index.tsx +0 -3
- package/templates/ice-web-screen/src/pages/template/16_9/index.tsx +0 -13
- package/templates/ice-web-screen/src/pages/template/16_9/style.module.less +0 -7
- package/templates/ice-web-screen/src/pages/template/components/charts/demo-line/index.tsx +0 -274
- package/templates/ice-web-screen/src/pages/template/components/charts/index.ts +0 -1
- package/templates/ice-web-screen/src/pages/template/components/index.ts +0 -1
- package/templates/ice-web-screen/src/pages/template/controller/index.tsx +0 -85
- package/templates/ice-web-screen/src/pages/template/index.tsx +0 -15
- package/templates/ice-web-screen/src/pages/template/style.module.less +0 -3
- package/templates/ice-web-screen/src/routes.ts +0 -29
- package/templates/ice-web-screen/src/styles/vars.less +0 -5
- package/templates/ice-web-screen/src/types/user.d.ts +0 -3
- package/templates/ice-web-screen/tsconfig.json +0 -3
- package/templates/ice-web-screen/typings.d.ts +0 -1
- package/templates/miniprogram/.editorconfig +0 -12
- package/templates/miniprogram/.prettierrc +0 -12
- package/templates/miniprogram/src/pages/demo/index.module.scss.d.ts +0 -5
- package/templates/miniprogram/src/pages/index/index.module.scss.d.ts +0 -5
- package/templates/umi-mobile/.prettierrc +0 -11
- package/templates/umi-mobile-h5+app/.prettierrc +0 -11
- package/templates/umi-mobile-native/.prettierrc +0 -11
- package/templates/umi-web/.prettierrc +0 -11
- package/templates/umi-web-screen/.prettierrc +0 -11
- package/templates/umi-web-screen/src/.umi/core/plugin.ts +0 -31
- package/templates/umi-web-screen/src/.umi/core/pluginConfig.d.ts +0 -239
- package/templates/umi-web-screen/src/.umi/core/polyfill.ts +0 -358
- package/templates/umi-web-screen/src/.umi/core/route.tsx +0 -21
- package/templates/umi-web-screen/src/.umi/core/terminal.ts +0 -38
- package/templates/umi-web-screen/src/.umi/exports.ts +0 -11
- package/templates/umi-web-screen/src/.umi/plugin-moment2dayjs/runtime.tsx +0 -29
- package/templates/umi-web-screen/src/.umi/typings.d.ts +0 -131
- package/templates/umi-web-screen/src/.umi/umi.ts +0 -59
- package/templates/umi-web-screen/src/.umi-production/core/history.ts +0 -53
- package/templates/umi-web-screen/src/.umi-production/core/plugin.ts +0 -31
- package/templates/umi-web-screen/src/.umi-production/core/pluginConfig.d.ts +0 -239
- package/templates/umi-web-screen/src/.umi-production/core/polyfill.ts +0 -358
- package/templates/umi-web-screen/src/.umi-production/core/route.tsx +0 -53
- package/templates/umi-web-screen/src/.umi-production/core/terminal.ts +0 -38
- package/templates/umi-web-screen/src/.umi-production/exports.ts +0 -11
- package/templates/umi-web-screen/src/.umi-production/plugin-moment2dayjs/runtime.tsx +0 -29
- package/templates/umi-web-screen/src/.umi-production/tsconfig.json +0 -32
- package/templates/umi-web-screen/src/.umi-production/typings.d.ts +0 -131
- package/templates/umi-web-screen/src/.umi-production/umi.ts +0 -59
- package/templates/umi-web-screen/src/layouts/16_9/index.less.d.ts +0 -8
- package/templates/umi-web-screen/src/layouts/16_9/style.less.d.ts +0 -10
- /package/templates/miniprogram/src/pages/demo/{index.module.scss → style.scss} +0 -0
- /package/templates/miniprogram/src/pages/index/{index.module.scss → style.scss} +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/******/ (function() { // webpackBootstrap
|
|
2
|
+
/******/ var __webpack_modules__ = ({
|
|
3
|
+
|
|
4
|
+
/***/ 925:
|
|
5
|
+
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
|
|
6
|
+
|
|
7
|
+
var spawn = (__nccwpck_require__(81).spawn);
|
|
8
|
+
var fs = __nccwpck_require__(147);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var sgf = function (options = {}, callback) {
|
|
12
|
+
const typeOfOptions = typeof options;
|
|
13
|
+
let filter;
|
|
14
|
+
|
|
15
|
+
if (typeOfOptions === 'function') {
|
|
16
|
+
callback = options;
|
|
17
|
+
filter = undefined;
|
|
18
|
+
} else if (typeOfOptions === 'string') {
|
|
19
|
+
filter = options;
|
|
20
|
+
} else {
|
|
21
|
+
filter = options.filter;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof callback === 'undefined') {
|
|
25
|
+
return new Promise(function (resolve, reject) {
|
|
26
|
+
_sgf(filter, function (err, head) {
|
|
27
|
+
if (err)
|
|
28
|
+
return reject(err);
|
|
29
|
+
resolve(head);
|
|
30
|
+
}, options);
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
_sgf(filter, callback, options);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
function _sgf (filter, callback, options) {
|
|
39
|
+
if (typeof filter === 'undefined')
|
|
40
|
+
filter = 'ACDMRTUXB';
|
|
41
|
+
|
|
42
|
+
sgf.getHead(function(err, head) {
|
|
43
|
+
if (err) {
|
|
44
|
+
callback(err);
|
|
45
|
+
} else {
|
|
46
|
+
var command = "git -c core.quotepath=false diff-index --cached --name-status";
|
|
47
|
+
|
|
48
|
+
if (options.relative) {
|
|
49
|
+
command += " --relative";
|
|
50
|
+
}
|
|
51
|
+
if (filter.indexOf('R') !== -1) {
|
|
52
|
+
command += " -M";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
command += " --diff-filter=" + filter + " " + head;
|
|
56
|
+
|
|
57
|
+
run(command, function(err, stdout, stderr) {
|
|
58
|
+
if (err || stderr) {
|
|
59
|
+
callback(err || new Error(stderr));
|
|
60
|
+
} else {
|
|
61
|
+
callback(null, stdoutToResultsObject(stdout));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
sgf.cwd = process.cwd();
|
|
70
|
+
sgf.debug = false;
|
|
71
|
+
sgf.includeContent = false;
|
|
72
|
+
|
|
73
|
+
// sgf.firstHead = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
74
|
+
|
|
75
|
+
sgf.getHead = function(callback) {
|
|
76
|
+
run("git rev-parse --verify HEAD", function(err, stdout, stderr) {
|
|
77
|
+
if (err && err.message.indexOf("fatal: Needed a single revision")!==-1) {
|
|
78
|
+
// callback(null, sgf.firstHead);
|
|
79
|
+
run("git hash-object -t tree /dev/null", function(err, stdout, stderr) {
|
|
80
|
+
if (err || stderr) {
|
|
81
|
+
callback(err || new Error("STDERR: " + stderr));
|
|
82
|
+
} else {
|
|
83
|
+
stdout = stdout.replace("\n", "");
|
|
84
|
+
callback(null, stdout);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
} else if (err || stderr) {
|
|
88
|
+
callback(err || new Error("STDERR: " + stderr));
|
|
89
|
+
} else {
|
|
90
|
+
stdout = stdout.replace("\n", "");
|
|
91
|
+
callback(null, stdout);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
sgf.readFile = function(filename, options, callback) {
|
|
97
|
+
fs.readFile(sgf.cwd + "/" + filename, options, callback);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
module.exports = sgf;
|
|
102
|
+
|
|
103
|
+
/** ======================================== HELPERS ======================================== **/
|
|
104
|
+
|
|
105
|
+
var run = function(command, callback) {
|
|
106
|
+
if (sgf.debug) {
|
|
107
|
+
console.log("RUNNING: " + command);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
var bits = command.split(" ");
|
|
111
|
+
var args = bits.slice(1);
|
|
112
|
+
|
|
113
|
+
var cmd = spawn(bits[0], args, {
|
|
114
|
+
cwd: module.exports.cwd
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
var stdout = "";
|
|
118
|
+
var stderr = "";
|
|
119
|
+
|
|
120
|
+
cmd.stdout.on('data', function(data){
|
|
121
|
+
stdout+=data.toString();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
cmd.stderr.on('data', function(data){
|
|
125
|
+
stderr+=data.toString();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
cmd.on("close", function(code){
|
|
129
|
+
var err = null;
|
|
130
|
+
|
|
131
|
+
if(code!==0){
|
|
132
|
+
err = new Error(stderr);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
callback(err,stdout,stderr);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var codeToStatus = function(code) {
|
|
140
|
+
/* =======================================================================================================
|
|
141
|
+
** PER docs at https://git-scm.com/docs/git-diff-index
|
|
142
|
+
** Possible status letters are:
|
|
143
|
+
** A: addition of a file
|
|
144
|
+
** C: copy of a file into a new one
|
|
145
|
+
** D: deletion of a file
|
|
146
|
+
** M: modification of the contents or mode of a file
|
|
147
|
+
** R: renaming of a file
|
|
148
|
+
** T: change in the type of the file
|
|
149
|
+
** U: file is unmerged (you must complete the merge before it can be committed)
|
|
150
|
+
** X: "unknown" change type (most probably a bug, please report it)
|
|
151
|
+
**
|
|
152
|
+
** Status letters C and R are always followed by a score
|
|
153
|
+
** (denoting the percentage of similarity between the source and target of the move or copy).
|
|
154
|
+
** Status letter M may be followed by a score (denoting the percentage of dissimilarity) for file rewrites.
|
|
155
|
+
** ======================================================================================================= */
|
|
156
|
+
|
|
157
|
+
var map = {
|
|
158
|
+
"A": "Added",
|
|
159
|
+
"C": "Copied",
|
|
160
|
+
"D": "Deleted",
|
|
161
|
+
"M": "Modified",
|
|
162
|
+
"R": "Renamed",
|
|
163
|
+
"T": "Type-Change",
|
|
164
|
+
"U": "Unmerged",
|
|
165
|
+
"X": "Unknown",
|
|
166
|
+
"B": "Broken"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return map[code.charAt(0)];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
var stdoutToResultsObject = function(stdout) {
|
|
173
|
+
var results = [];
|
|
174
|
+
var lines = stdout.split("\n");
|
|
175
|
+
var iLines = lines.length;
|
|
176
|
+
var files_with_errors = 0;
|
|
177
|
+
while (iLines--) {
|
|
178
|
+
var line = lines[iLines];
|
|
179
|
+
if (line != "") {
|
|
180
|
+
var parts = line.split("\t");
|
|
181
|
+
var result = {
|
|
182
|
+
filename: parts[2] || parts[1],
|
|
183
|
+
status: codeToStatus(parts[0])
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (sgf.includeContent) {
|
|
187
|
+
try {
|
|
188
|
+
result.content = fs.readFileSync(sgf.cwd + "/" + result.filename, {
|
|
189
|
+
encoding: "utf8"
|
|
190
|
+
});
|
|
191
|
+
} catch (err) {
|
|
192
|
+
result.err = err;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
results.push(result);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return results;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
/***/ }),
|
|
204
|
+
|
|
205
|
+
/***/ 81:
|
|
206
|
+
/***/ (function(module) {
|
|
207
|
+
|
|
208
|
+
"use strict";
|
|
209
|
+
module.exports = require("child_process");
|
|
210
|
+
|
|
211
|
+
/***/ }),
|
|
212
|
+
|
|
213
|
+
/***/ 147:
|
|
214
|
+
/***/ (function(module) {
|
|
215
|
+
|
|
216
|
+
"use strict";
|
|
217
|
+
module.exports = require("fs");
|
|
218
|
+
|
|
219
|
+
/***/ })
|
|
220
|
+
|
|
221
|
+
/******/ });
|
|
222
|
+
/************************************************************************/
|
|
223
|
+
/******/ // The module cache
|
|
224
|
+
/******/ var __webpack_module_cache__ = {};
|
|
225
|
+
/******/
|
|
226
|
+
/******/ // The require function
|
|
227
|
+
/******/ function __nccwpck_require__(moduleId) {
|
|
228
|
+
/******/ // Check if module is in cache
|
|
229
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
230
|
+
/******/ if (cachedModule !== undefined) {
|
|
231
|
+
/******/ return cachedModule.exports;
|
|
232
|
+
/******/ }
|
|
233
|
+
/******/ // Create a new module (and put it into the cache)
|
|
234
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
235
|
+
/******/ // no module.id needed
|
|
236
|
+
/******/ // no module.loaded needed
|
|
237
|
+
/******/ exports: {}
|
|
238
|
+
/******/ };
|
|
239
|
+
/******/
|
|
240
|
+
/******/ // Execute the module function
|
|
241
|
+
/******/ var threw = true;
|
|
242
|
+
/******/ try {
|
|
243
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
244
|
+
/******/ threw = false;
|
|
245
|
+
/******/ } finally {
|
|
246
|
+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
247
|
+
/******/ }
|
|
248
|
+
/******/
|
|
249
|
+
/******/ // Return the exports of the module
|
|
250
|
+
/******/ return module.exports;
|
|
251
|
+
/******/ }
|
|
252
|
+
/******/
|
|
253
|
+
/************************************************************************/
|
|
254
|
+
/******/ /* webpack/runtime/compat */
|
|
255
|
+
/******/
|
|
256
|
+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
257
|
+
/******/
|
|
258
|
+
/************************************************************************/
|
|
259
|
+
/******/
|
|
260
|
+
/******/ // startup
|
|
261
|
+
/******/ // Load entry module and return exports
|
|
262
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
263
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(925);
|
|
264
|
+
/******/ module.exports = __webpack_exports__;
|
|
265
|
+
/******/
|
|
266
|
+
/******/ })()
|
|
267
|
+
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"staged-git-files","version":"1.3.0","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause","_lastModified":"2023-02-21T03:20:22.825Z"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
printWidth: 80,
|
|
3
|
+
singleQuote: true,
|
|
4
|
+
trailingComma: 'all',
|
|
5
|
+
proseWrap: 'never',
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: '.prettierrc',
|
|
9
|
+
options: {
|
|
10
|
+
parser: 'json',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
// "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
|
|
15
|
+
};
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import"./yolk";
|
|
2
|
+
import"v8-compile-cache";import"./yolk";
|
package/es/yolk.d.ts
CHANGED
package/es/yolk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import e from"@babel/runtime/helpers/toArray";import t from"@babel/runtime/helpers/defineProperty";import o from"lodash/isString";import r from"lodash/pick";import s from"lodash/floor";import i from"lodash/chunk";function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach((function(o){t(e,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}import{execSync as a,spawn as m}from"child_process";import l from"commander";import p from"fs";import u from"glob";import d from"inquirer";import f from"minimatch";import*as y from"miniprogram-ci";import g from"mkdirp";import h from"mustache";import b from"ora";import j from"os";import S from"path";import{format as k}from"prettier";import v from"rimraf";import w from"../package.json";const x=require("staged-git-files"),$=process.cwd(),P="##### CREATED BY YOLK #####",O={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},E="utf-8",F=60,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/mock/**","**/yolk/**","**/yolk-web/**","**/yolk-web-ui/**","**/yolk-mobile/**","**/yolk-mobile-ui/**","**/yolk-miniprogram/**","**/yolk-miniprogram-ui/**"],D=b(),I=e=>e&&D.warn(Buffer.from(e,E).toString()),q=e=>e&&D.fail(Buffer.from(e,E).toString()),Q=e=>e&&D.succeed(Buffer.from(e,E).toString()),R=e=>e&&D.info(Buffer.from(e,E).toString()),T=e=>"win32"===process.platform?`${e}.cmd`:e,L=()=>{Q("yolk complete!"),process.exit(0)},N=()=>{I("yolk break!"),process.exit(0)},_=({command:e,args:t,complete:o,close:r,exit:s=!0})=>{const i=m(T(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(r&&r(),q("yolk close!"),process.exit(e)):(o&&o(),s&&L())}));process.on("SIGINT",(()=>{l.runningCommand&&l.runningCommand.kill("SIGKILL"),i.kill(),N()}))},A=(e,t,o)=>{d.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"web template(ice framework)",value:"ice-web"},{name:"web big screen template(ice framework)",value:"ice-web-screen"},{name:"mobile template(ice framework)",value:"ice-mobile"},{name:"mobile HBuilderX h5+app template(ice framework)",value:"ice-mobile-h5+app"},{name:"mobile native template(ice framework)",value:"ice-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:S.basename(S.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:!1,choices:[{name:"npm install",value:"npm"},{name:"yarn install",value:"yarn"},{name:"pnpm install",value:"pnpm"},{name:"\u4e0d\u5b89\u88c5\u4f9d\u8d56",value:!1}]}]).then((r=>{const s={projectName:r.projectName,mobile:"umi-mobile"===r.type,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:w.version};t||(t=S.join(__dirname,`../templates/${r.type}`)),Q(`\u590d\u5236\u6a21\u7248 ${S.basename(t)}`);const i=u.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((o=>{if(!t)return;const r=S.join(t,o);if(!p.statSync(r).isDirectory())if(o.endsWith(".tpl")){const t=p.readFileSync(r,E),i=S.join(e,o.replace(/\.tpl$/u,"")),n=h.render(t,s);g.sync(S.dirname(i)),Q(`\u521b\u5efa ${S.relative(e,i)}`),p.writeFileSync(i,n,E)}else{Q(`\u521b\u5efa ${o}`);const t=S.join(e,o);g.sync(S.dirname(t)),p.copyFileSync(r,t)}})),Q("\u590d\u5236\u6a21\u7248 success!"),o&&p.existsSync(t)&&v(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${S.basename(t||"")}`)})),r.dependenciesInstallType)switch(Q("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"npm":_({command:"npm",args:["install"]});break;case"yarn":_({command:"yarn",args:["install"]});break;case"pnpm":_({command:"pnpm",args:["install"]});break;default:}Q("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},K=(e,t)=>A(e,t,!0),C=()=>{const e=u.sync("*.yolkrc*",{cwd:$,dot:!0});if(!e.length)return{};const t=S.join($,e[0]);if(!p.existsSync(t))return{};try{return JSON.parse(p.readFileSync(t,E))||{}}catch(o){return q(o.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},H=()=>{const e=S.join($,".prettierrc");if(p.existsSync(e))try{return JSON.parse(p.readFileSync(e,E))||{}}catch(t){return q(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return{singleQuote:!0,trailingComma:"all",printWidth:80,overrides:[{files:".prettierrc",options:{parser:"json"}}]}},J=()=>{const e=S.join($,"project.config.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,E))||{}}catch(t){return q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>{const e=S.join($,"package.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,E))||{}}catch(t){return q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>p.existsSync(S.join($,"project.config.json")),V=()=>p.existsSync(S.join($,".icerc.ts"))||p.existsSync(S.join($,".icerc.js"))||p.existsSync(S.join($,".ice.ts"))||p.existsSync(S.join($,".ice.js")),G=()=>{let e=p.existsSync(S.join($,"node_modules/.bin/max"));if(!e)try{e=p.existsSync(require.resolve("@umijs/max"))}catch(t){}return e},W=()=>p.existsSync(S.join($,".icerc.ts"))?".icerc.ts":p.existsSync(S.join($,".icerc.js"))?".icerc.js":p.existsSync(S.join($,".ice.ts"))?".ice.ts":".ice.js",X=()=>{const e=S.join($,"project.config.json");if(p.existsSync(e)){const t=require(e);return t.appid}return""},Y=()=>p.existsSync(S.join($,"project.tt.json"))&&0===X().indexOf("tt"),z=()=>0===X().indexOf("20"),Z=()=>{const e=C();let t="";try{t=U()?require.resolve("@baic/eslint-config-yolk-miniprogram"):require.resolve("@baic/eslint-config-yolk")}catch(s){}const o=u.sync("*.eslintrc*",{cwd:$,dot:!0}),r=o[0];return!1===e.strict&&r&&p.existsSync(r)?r:t},ee=()=>{const e=u.sync("*.stylelintrc*",{cwd:$,dot:!0}),t=e[0];return t},te=()=>{const e=S.join($,".git/"),t=S.join($,".git/hooks"),o=S.join(t,"pre-commit"),r=p.existsSync(e),s=p.existsSync(o),i=s&&p.readFileSync(o,"utf8").includes(P);if(r&&(!s||!i)){g.sync(t),p.writeFileSync(o,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",P].join(j.EOL),"utf8");try{p.chmodSync(o,"777")}catch(n){q(`chmod ${o} failed: ${n.message}`)}Q("Create pre-commit hook")}},oe=()=>{const e=C(),t=!1!==e.strict,o=e.eslintIgnore,r=e.stylelintIgnore;x().then((e=>{const s=new Promise(((o,s)=>{const n=ee();if(n){const a=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.(le|sa|sc|c)s{2}$/iu.test(e))).filter((e=>B.every((t=>!f(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof r?!f(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((t=>"string"===typeof t?!f(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=S.join($,e);return p.existsSync(t)?t:null})).filter((e=>!!e));if(a.forEach((e=>{if(e&&p.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),o=p.readFileSync(e,"utf8"),r=k(o,c({parser:O[t]},H()));p.writeFileSync(e,r,"utf8")}})),Q("style prettier success!"),a.length>=F){const e=[];i(a,20).forEach((o=>{e.push(new Promise(((e,r)=>{_({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...o],complete:e,close:r,exit:!1})})))}));const r=process.getMaxListeners(),c=i(e,r?r/2:2);let m=0;const l=()=>{m<c.length?Promise.all(c[m]).then((()=>{m++,l()})).catch(s):o()};l()}else a.length&&_({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...a],complete:o,close:s,exit:!1})}else o()})),n=()=>{const r=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.([t|j]sx?)$/iu.test(e))).map((e=>{const t=S.join($,e);return p.existsSync(t)?t:null})).filter((e=>!!e));if(r.length){r.forEach((e=>{if(e&&p.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),o=p.readFileSync(e,"utf8"),r=k(o,c({parser:O[t]},H()));p.writeFileSync(e,r,"utf8")}})),Q("script prettier success!");const e=Z();if(e){const s=r.filter((e=>B.every((t=>!f(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof o?!f(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((t=>"string"===typeof t?!f(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(t&&(I("git commit\u7981\u6b62eslint\u7684ignore\u65b9\u5f0f(eslint-disable\u3001.eslintrc*\u3001ignore\u7b49)\u3002"),o&&I(`\u901a\u8fc7yolkrc\u914d\u7f6eeslintIgnore\uff1a${o}\u3002`)),s.length>=F){const o=[];i(s,20).forEach((r=>{o.push(new Promise((o=>{_({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...r],complete:o,exit:!1})})))}));const r=process.getMaxListeners(),n=i(o,r?r/2:2);let c=0;const a=()=>{c<n.length?Promise.all(n[c]).then((()=>{c++,a()})):L()};a()}else s.length&&_({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...s]})}else I("\u6ca1\u6709eslint\u914d\u7f6e\u6587\u4ef6")}else L()};I("\u8981\u6c42\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),s.then(n)}))},re=({mProject:e,mPrivateKeyPath:t,mVersion:o,mDesc:r,mRobot:s,mQrcodeFormat:i,mQrcodeOutputDest:n,mPagePath:c,mSearchQuery:m})=>{const l=p.existsSync(S.join($,".git"))?a("git log -1 --pretty=format:%H").toString():"",u=J(),d=u.appid,f=e||S.join($,"dist"),g=t||S.join($,`private.${d}.key`);if(p.existsSync(f)){if(p.existsSync(g)){const e=M(),t=o||e.version||u.version||"1.0.0",a=r||e.description||u.description,p=`version: ${t};${l?` commit: ${l};`:""}${a?` description: ${a};`:""}`;l&&R(`commit: ${l}`),R(`dist: ${f}`),R(`key: ${g}`),R(`appid: ${d}`),R(`version: ${t}`),R(`desc: ${p}`);const h=new y.Project({appid:d,type:"miniProgram",projectPath:f,privateKeyPath:g,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:d,options:{project:h,version:t,desc:p,setting:u.setting,robot:s,qrcodeFormat:i,qrcodeOutputDest:n,pagePath:c,searchQuery:m}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${g})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${f})`)},se=()=>{te(),process.argv.length>2?l.version(w.version).usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((t,i)=>{const n=e(i),a=n[0],m=n.slice(1),l=t.clone,u=t.template,d=t.docs;if(a)switch(R(`yolk version: ${w.version}`),R(`node version: ${process.version}`),R(`platform: ${j.platform()}`),R(`memory: ${s(j.freemem()/1024/1024)} MB(${s(j.totalmem()/1024/1024)} MB)`),a){case"init":if(Q(`yolk ${a} \u5f00\u59cb`),l)if(u){const e=".yolk",t=S.join($,e);p.existsSync(t)&&v(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),_({command:"git",args:["clone","-b","master","--depth","1",u,e].concat(m)}),K($,t)}else q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else A($);break;case"start":U()?Y()?_({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):z()?_({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):_({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):d?_({command:"dumi",args:["dev"].concat(m)}):V()?_({command:"icejs",args:["start","--config",W()].concat(m)}):G()?_({command:"max",args:["dev"].concat(m)}):_({command:"umi",args:["dev"].concat(m)});break;case"build":U()?Y()?_({command:"taro",args:["build","--type","tt"].concat(m)}):z()?_({command:"taro",args:["build","--type","alipay"].concat(m)}):_({command:"taro",args:["build","--type","weapp"].concat(m)}):d?_({command:"dumi",args:["build"].concat(m)}):V()?_({command:"icejs",args:["build","--config",W()].concat(m)}):G()?_({command:"max",args:["build"].concat(m)}):_({command:"umi",args:["build"].concat(m)});break;case"pre-commit":oe();break;case"test":_({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(m)});break;case"miniapp-upload":case"miniprogram-upload":if(U())if(Y());else if(z());else{const e=re(t),s=e.appid,i=e.options;R(`${s}\u4e0a\u4f20\u5f00\u59cb`),y.upload(c(c({},r(i,["project","version","desc","setting","robot"])),{},{onProgressUpdate:e=>{if(o(e))R(`task: ${e}`);else{const t=e.status,o=e.message;R(`task(${t}): ${o}`)}}})).then((()=>{Q(`${s}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(U())if(Y());else if(z());else{const e=re(t),s=e.appid,i=e.options;R(`${s}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),y.preview(c(c({},r(i,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:e=>{if(o(e))R(`task: ${e}`);else{const t=e.status,o=e.message;R(`task(${t}): ${o}`)}}})).then((()=>{Q(`${s}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:N()}})).parse(process.argv):N()};se();
|
|
2
|
+
import e from"@babel/runtime/helpers/esm/toArray";import t from"@babel/runtime/helpers/esm/toConsumableArray";import n from"@babel/runtime/helpers/esm/defineProperty";import r from"lodash/isString";import o from"lodash/pick";import c from"lodash/floor";import i from"lodash/chunk";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}import{execSync as m,spawn as l}from"child_process";import p from"fs";import u from"os";import f from"path";import d from"inquirer";import*as y from"miniprogram-ci";import g from"ora";import h from"../compiled/commander";import v from"../compiled/glob";import b from"../compiled/minimatch";import j from"../compiled/mkdirp";import S from"../compiled/mustache";import{format as x}from"../compiled/prettier";import k from"../compiled/rimraf";import w from"../package.json";var O=require("../compiled/staged-git-files"),P=process.cwd(),D="##### CREATED BY YOLK #####",_={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},F="utf-8",I=20,E=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],N=g(),B=function(e){return e&&N.warn(Buffer.from(e,F).toString())},q=function(e){return e&&N.fail(Buffer.from(e,F).toString())},K=function(e){return e&&N.succeed(Buffer.from(e,F).toString())},$=function(e){return e&&N.info(Buffer.from(e,F).toString())},U=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},Q=function(){K("yolk complete!"),process.exit(0)},R=function(){B("yolk break!"),process.exit(0)},T=function(e){var t=e.command,n=e.args,r=e.complete,o=e.close,c=e.exit,i=void 0===c||c,s=l(U(t),n||[],{stdio:"inherit"}).on("close",(function(e){e?(o&&o(),q("yolk close!"),process.exit(e)):(r&&r(),i&&Q())}));process.on("SIGINT",(function(){h.runningCommand&&h.runningCommand.kill("SIGKILL"),s.kill(),R()}))},Y=function(e,t,n){d.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:f.basename(f.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((function(r){var o={projectName:r.projectName,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:w.version},c=t||f.join(__dirname,"../templates/".concat(r.type));K("\u590d\u5236\u6a21\u7248 ".concat(f.basename(c)));var i=v.sync("**/*",{cwd:c,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((function(t){if(c){var n=f.join(c,t);if(!p.statSync(n).isDirectory())if(t.endsWith(".tpl")){var r=p.readFileSync(n,F),i=f.join(e,t.replace(/\.tpl$/,"")),s=S.render(r,o);j.sync(f.dirname(i)),K("\u521b\u5efa ".concat(f.relative(e,i))),p.writeFileSync(i,s,F)}else{K("\u521b\u5efa ".concat(t));var a=f.join(e,t);j.sync(f.dirname(a)),p.copyFileSync(n,a)}}})),K("\u590d\u5236\u6a21\u7248 success!"),n&&p.existsSync(c)&&k(c,(function(){K("\u7f13\u5b58\u5220\u9664 success! ".concat(f.basename(c||"")))})),r.dependenciesInstallType)switch(K("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"default":case"pnpm":T({command:"pnpm",args:["install"]});break;case"yarn":T({command:"yarn",args:["install"]});break;case"npm":T({command:"npm",args:["install"]});break;default:}K("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},A=function(e,t){return Y(e,t,!0)},W=function(){var e=v.sync("*.yolkrc*",{cwd:P,dot:!0});if(!e.length)return{};var t=f.join(P,e[0]);if(!p.existsSync(t))return{};try{return JSON.parse(p.readFileSync(t,F))||{}}catch(n){return q(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},L=function(){var e=f.join(P,".prettierrc");if(p.existsSync(e))try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},C=function(){var e=f.join(P,"project.config.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},J=function(){var e=f.join(P,"package.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=function(){return p.existsSync(f.join(P,"project.config.json"))},G=function(){var e=p.existsSync(f.join(P,"node_modules/.bin/max"));if(!e)try{e=p.existsSync(require.resolve("@umijs/max"))}catch(r){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(m("umi -v").toString())}catch(r){}if(!e){var t=f.join(P,"node_modules","umi","package.json");if(p.existsSync(t))try{var n=JSON.parse(p.readFileSync(t,F))||{};e=n.version&&+n.version.split(".")[0]>3}catch(r){}}return e},H=function(){var e=f.join(P,"project.config.json");if(p.existsSync(e)){var t=require(e);return t.appid}return""},M=function(){return p.existsSync(f.join(P,"project.tt.json"))&&0===H().indexOf("tt")},X=function(){return 0===H().indexOf("20")},z=function(){var e=W(),t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(o){}var n=v.sync("*.eslintrc*",{cwd:P,dot:!0}),r=n[0];return!1===e.strict&&r&&p.existsSync(r)?r:p.existsSync(t)?t:r},Z=function(){var e=W(),t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(o){}var n=v.sync("*.stylelintrc*",{cwd:P,dot:!0}),r=n[0];return!1===e.strict&&r&&p.existsSync(r)?r:p.existsSync(t)?t:r},ee=function(){var e=f.join(P,".git/"),t=f.join(P,".git/hooks"),n=f.join(t,"pre-commit"),r=p.existsSync(e),o=p.existsSync(n),c=o&&p.readFileSync(n,F).includes(D);if(r&&(!o||!c)){j.sync(t),p.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",D].join(u.EOL),F);try{p.chmodSync(n,"777")}catch(i){q("chmod ".concat(n," failed: ").concat(i.message))}K("Create pre-commit hook")}},te=function(){var e=W(),n=!1!==e.strict,r=e.eslintIgnore,o=e.stylelintIgnore;O().then((function(e){var c=function(r){return new Promise((function(c,s){var m=Z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[r].test(e)})).filter((function(e){var t=f.join(P,e);return p.existsSync(t)})).filter((function(e){return E.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof o?!b(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,F),r=x(n,a({parser:_[t]},L()));p.writeFileSync(e,r,F)}})),K("".concat(r," - ").concat(l.length," files prettier success!")),l.length>=I){var u=[];i(l,I).forEach((function(e){u.push(new Promise((function(o,c){T({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(r),"--config",m].concat(t(e)),complete:o,close:c,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(K("".concat(r," - ").concat(l.length," files stylelint success!")),c())};y()}else l.length&&T({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(r),"--config",m].concat(t(l)),complete:function(){K("".concat(r," - ").concat(l.length," files stylelint success!")),c()},close:s,exit:!1});else c()}else q("\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c".concat(r," files prettier fail!")),c()}))},s=function(o){return new Promise((function(c,s){var m=z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[o].test(e)})).filter((function(e){var t=f.join(P,e);return p.existsSync(t)})).filter((function(e){return E.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof r?!b(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,F),r=x(n,a({parser:_[t]},L()));p.writeFileSync(e,r,F)}})),K("".concat(o," - ").concat(l.length," files prettier success!")),l.length>=I){var u=[];i(l,I).forEach((function(e){u.push(new Promise((function(r,o){T({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(e)),complete:r,close:o,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(K("".concat(o," - ").concat(l.length," files eslint success!")),c())};y()}else l.length&&T({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(l)),complete:function(){K("".concat(o," - ").concat(l.length," files eslint success!")),c()},close:s,exit:!1});else c()}else q("\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c".concat(o," files eslint fail!")),c()}))};B("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),n&&(B("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),o&&B("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(o,"\u3002")),r&&B("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(r,"\u3002"))),c("css").then((function(){return c("less")})).then((function(){return c("sass")})).then((function(){return c("scss")})).then((function(){return s("js")})).then((function(){return s("jsx")})).then((function(){return s("ts")})).then((function(){return s("tsx")})).then(Q).catch(Q)}))},ne=function(e){var t=e.mProject,n=e.mPrivateKeyPath,r=e.mVersion,o=e.mDesc,c=e.mRobot,i=e.mQrcodeFormat,s=e.mQrcodeOutputDest,a=e.mPagePath,l=e.mSearchQuery,u=p.existsSync(f.join(P,".git"))?m("git log -1 --pretty=format:%H").toString():"",d=C(),g=d.appid,h=t||f.join(P,"dist"),v=n||f.join(P,"private.".concat(g,".key"));if(p.existsSync(h)){if(p.existsSync(v)){var b=J(),j=r||b.version||d.version||"1.0.0",S=o||b.description||d.description,x="version: ".concat(j,";").concat(u?" commit: ".concat(u,";"):"").concat(S?" description: ".concat(S,";"):"");u&&$("commit: ".concat(u)),$("dist: ".concat(h)),$("key: ".concat(v)),$("appid: ".concat(g)),$("version: ".concat(j)),$("desc: ".concat(x));var k=new y.Project({appid:g,type:"miniProgram",projectPath:h,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:g,options:{project:k,version:j,desc:x,setting:d.setting,robot:c,qrcodeFormat:i,qrcodeOutputDest:s,pagePath:a,searchQuery:l}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(v,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(h,")"))},re=function(){ee(),process.argv.length>2?h.version(w.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action((function(t,n){var i=e(n),s=i[0],m=i.slice(1),l=t.clone,d=t.template,g=t.docs;if(s)switch($("yolk version: ".concat(w.version)),$("node version: ".concat(process.version)),$("platform: ".concat(u.platform())),$("memory: ".concat(c(u.freemem()/1024/1024)," MB(").concat(c(u.totalmem()/1024/1024)," MB)")),s){case"init":if(K("yolk ".concat(s," \u5f00\u59cb")),l)if(d){var h=".yolk",v=f.join(P,h);p.existsSync(v)&&k(v,(function(){K("\u7f13\u5b58\u5220\u9664 success! ".concat(v))})),T({command:"git",args:["clone","-b","master","--depth","1",d,h].concat(m)}),A(P,v)}else q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else Y(P);break;case"start":V()?M()?T({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):X()?T({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):T({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):g?(process.env.DID_YOU_KNOW="none",T({command:"dumi",args:["dev"].concat(m)})):G()?(process.env.DID_YOU_KNOW="none",T({command:"max",args:["dev"].concat(m)})):(process.env.DID_YOU_KNOW="none",T({command:"umi",args:["dev"].concat(m)}));break;case"build":V()?M()?T({command:"taro",args:["build","--type","tt"].concat(m)}):X()?T({command:"taro",args:["build","--type","alipay"].concat(m)}):T({command:"taro",args:["build","--type","weapp"].concat(m)}):g?(process.env.DID_YOU_KNOW="none",T({command:"dumi",args:["build"].concat(m)})):G()?(process.env.DID_YOU_KNOW="none",T({command:"max",args:["setup"].concat(m),complete:function(){return T({command:"max",args:["build"].concat(m)})},exit:!1})):(process.env.DID_YOU_KNOW="none",T({command:"umi",args:["build"].concat(m)}));break;case"pre-commit":te();break;case"miniprogram-upload":if(V())if(M());else if(X());else{var b=ne(t),j=b.appid,S=b.options;$("".concat(j,"\u4e0a\u4f20\u5f00\u59cb")),y.upload(a(a({},o(S,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(r(e))$("task: ".concat(e));else{var t=e.status,n=e.message;$("task(".concat(t,"): ").concat(n))}}})).then((function(){K("".concat(j,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniprogram-preview":if(V())if(M());else if(X());else{var x=ne(t),O=x.appid,D=x.options;$("".concat(O,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),y.preview(a(a({},o(D,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(r(e))$("task: ".concat(e));else{var t=e.status,n=e.message;$("task(".concat(t,"): ").concat(n))}}})).then((function(){K("".concat(O,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:R()}})).parse(process.argv):R()};re();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
printWidth: 80,
|
|
3
|
+
singleQuote: true,
|
|
4
|
+
trailingComma: 'all',
|
|
5
|
+
proseWrap: 'never',
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: '.prettierrc',
|
|
9
|
+
options: {
|
|
10
|
+
parser: 'json',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
// "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
|
|
15
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
|
|
2
|
+
var e=require("v8-compile-cache"),r=require("./yolk");
|
package/lib/yolk.d.ts
CHANGED
package/lib/yolk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");function t(){const n=e(require("@babel/runtime/helpers/toArray"));return t=function(){return n},n}function n(){const t=e(require("@babel/runtime/helpers/defineProperty"));return n=function(){return t},t}function r(){const t=e(require("lodash/isString"));return r=function(){return t},t}function i(){const t=e(require("lodash/pick"));return i=function(){return t},t}function o(){const t=e(require("lodash/floor"));return o=function(){return t},t}function a(){const t=e(require("lodash/chunk"));return a=function(){return t},t}function s(){const e=require("child_process");return s=function(){return e},e}function c(){const t=e(require("commander"));return c=function(){return t},t}function l(){const t=e(require("fs"));return l=function(){return t},t}function u(){const t=e(require("glob"));return u=function(){return t},t}function f(){const t=e(require("inquirer"));return f=function(){return t},t}function m(){const t=e(require("minimatch"));return m=function(){return t},t}function d(){const e=w(require("miniprogram-ci"));return d=function(){return e},e}function p(){const t=e(require("mkdirp"));return p=function(){return t},t}function y(){const t=e(require("mustache"));return y=function(){return t},t}function g(){const t=e(require("ora"));return g=function(){return t},t}function b(){const t=e(require("os"));return b=function(){return t},t}function h(){const t=e(require("path"));return h=function(){return t},t}function j(){const e=require("prettier");return j=function(){return e},e}function v(){const t=e(require("rimraf"));return v=function(){return t},t}var k=e(require("../package.json"));function S(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function w(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){(0,n().default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const O=require("staged-git-files"),P=process.cwd(),q="##### CREATED BY YOLK #####",E={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},F="utf-8",D=60,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/mock/**","**/yolk/**","**/yolk-web/**","**/yolk-web-ui/**","**/yolk-mobile/**","**/yolk-mobile-ui/**","**/yolk-miniprogram/**","**/yolk-miniprogram-ui/**"],I=(0,g().default)(),Q=e=>e&&I.warn(Buffer.from(e,F).toString()),R=e=>e&&I.fail(Buffer.from(e,F).toString()),_=e=>e&&I.succeed(Buffer.from(e,F).toString()),T=e=>e&&I.info(Buffer.from(e,F).toString()),L=e=>"win32"===process.platform?`${e}.cmd`:e,M=()=>{_("yolk complete!"),process.exit(0)},N=()=>{Q("yolk break!"),process.exit(0)},A=({command:e,args:t,complete:n,close:r,exit:i=!0})=>{const o=(0,s().spawn)(L(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(r&&r(),R("yolk close!"),process.exit(e)):(n&&n(),i&&M())}));process.on("SIGINT",(()=>{c().default.runningCommand&&c().default.runningCommand.kill("SIGKILL"),o.kill(),N()}))},K=(e,t,n)=>{f().default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"web template(ice framework)",value:"ice-web"},{name:"web big screen template(ice framework)",value:"ice-web-screen"},{name:"mobile template(ice framework)",value:"ice-mobile"},{name:"mobile HBuilderX h5+app template(ice framework)",value:"ice-mobile-h5+app"},{name:"mobile native template(ice framework)",value:"ice-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:h().default.basename(h().default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:!1,choices:[{name:"npm install",value:"npm"},{name:"yarn install",value:"yarn"},{name:"pnpm install",value:"pnpm"},{name:"\u4e0d\u5b89\u88c5\u4f9d\u8d56",value:!1}]}]).then((r=>{const i={projectName:r.projectName,mobile:"umi-mobile"===r.type,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:k.default.version};t||(t=h().default.join(__dirname,`../templates/${r.type}`)),_(`\u590d\u5236\u6a21\u7248 ${h().default.basename(t)}`);const o=u().default.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(o.forEach((n=>{if(!t)return;const r=h().default.join(t,n);if(!l().default.statSync(r).isDirectory())if(n.endsWith(".tpl")){const t=l().default.readFileSync(r,F),o=h().default.join(e,n.replace(/\.tpl$/u,"")),a=y().default.render(t,i);p().default.sync(h().default.dirname(o)),_(`\u521b\u5efa ${h().default.relative(e,o)}`),l().default.writeFileSync(o,a,F)}else{_(`\u521b\u5efa ${n}`);const t=h().default.join(e,n);p().default.sync(h().default.dirname(t)),l().default.copyFileSync(r,t)}})),_("\u590d\u5236\u6a21\u7248 success!"),n&&l().default.existsSync(t)&&(0,v().default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${h().default.basename(t||"")}`)})),r.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"npm":A({command:"npm",args:["install"]});break;case"yarn":A({command:"yarn",args:["install"]});break;case"pnpm":A({command:"pnpm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},C=(e,t)=>K(e,t,!0),W=()=>{const e=u().default.sync("*.yolkrc*",{cwd:P,dot:!0});if(!e.length)return{};const t=h().default.join(P,e[0]);if(!l().default.existsSync(t))return{};try{return JSON.parse(l().default.readFileSync(t,F))||{}}catch(n){return R(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},H=()=>{const e=h().default.join(P,".prettierrc");if(l().default.existsSync(e))try{return JSON.parse(l().default.readFileSync(e,F))||{}}catch(t){return R(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return{singleQuote:!0,trailingComma:"all",printWidth:80,overrides:[{files:".prettierrc",options:{parser:"json"}}]}},J=()=>{const e=h().default.join(P,"project.config.json");if(!l().default.existsSync(e))return{};try{return JSON.parse(l().default.readFileSync(e,F))||{}}catch(t){return R(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>{const e=h().default.join(P,"package.json");if(!l().default.existsSync(e))return{};try{return JSON.parse(l().default.readFileSync(e,F))||{}}catch(t){return R(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>l().default.existsSync(h().default.join(P,"project.config.json")),G=()=>l().default.existsSync(h().default.join(P,".icerc.ts"))||l().default.existsSync(h().default.join(P,".icerc.js"))||l().default.existsSync(h().default.join(P,".ice.ts"))||l().default.existsSync(h().default.join(P,".ice.js")),X=()=>{let e=l().default.existsSync(h().default.join(P,"node_modules/.bin/max"));if(!e)try{e=l().default.existsSync(require.resolve("@umijs/max"))}catch(t){}return e},Y=()=>l().default.existsSync(h().default.join(P,".icerc.ts"))?".icerc.ts":l().default.existsSync(h().default.join(P,".icerc.js"))?".icerc.js":l().default.existsSync(h().default.join(P,".ice.ts"))?".ice.ts":".ice.js",z=()=>{const e=h().default.join(P,"project.config.json");if(l().default.existsSync(e)){const t=require(e);return t.appid}return""},Z=()=>l().default.existsSync(h().default.join(P,"project.tt.json"))&&0===z().indexOf("tt"),ee=()=>0===z().indexOf("20"),te=()=>{const e=W();let t="";try{t=V()?require.resolve("@baic/eslint-config-yolk-miniprogram"):require.resolve("@baic/eslint-config-yolk")}catch(i){}const n=u().default.sync("*.eslintrc*",{cwd:P,dot:!0}),r=n[0];return!1===e.strict&&r&&l().default.existsSync(r)?r:t},ne=()=>{const e=u().default.sync("*.stylelintrc*",{cwd:P,dot:!0}),t=e[0];return t},re=()=>{const e=h().default.join(P,".git/"),t=h().default.join(P,".git/hooks"),n=h().default.join(t,"pre-commit"),r=l().default.existsSync(e),i=l().default.existsSync(n),o=i&&l().default.readFileSync(n,"utf8").includes(q);if(r&&(!i||!o)){p().default.sync(t),l().default.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(b().default.EOL),"utf8");try{l().default.chmodSync(n,"777")}catch(a){R(`chmod ${n} failed: ${a.message}`)}_("Create pre-commit hook")}},ie=()=>{const e=W(),t=!1!==e.strict,n=e.eslintIgnore,r=e.stylelintIgnore;O().then((e=>{const i=new Promise(((n,i)=>{const o=ne();if(o){const s=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.(le|sa|sc|c)s{2}$/iu.test(e))).filter((e=>B.every((t=>!(0,m().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof r?!(0,m().default)(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((t=>"string"===typeof t?!(0,m().default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=h().default.join(P,e);return l().default.existsSync(t)?t:null})).filter((e=>!!e));if(s.forEach((e=>{if(e&&l().default.existsSync(e)){const t=h().default.extname(e).replace(/^\./u,""),n=l().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:E[t]},H()));l().default.writeFileSync(e,r,"utf8")}})),_("style prettier success!"),s.length>=D){const e=[];(0,a().default)(s,20).forEach((n=>{e.push(new Promise(((e,r)=>{A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",o,...n],complete:e,close:r,exit:!1})})))}));const r=process.getMaxListeners(),c=(0,a().default)(e,r?r/2:2);let l=0;const u=()=>{l<c.length?Promise.all(c[l]).then((()=>{l++,u()})).catch(i):n()};u()}else s.length&&A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",o,...s],complete:n,close:i,exit:!1})}else n()})),o=()=>{const r=e.map((e=>e.filename)).filter((e=>/^(src|tests)/iu.test(e))).filter((e=>/\.([t|j]sx?)$/iu.test(e))).map((e=>{const t=h().default.join(P,e);return l().default.existsSync(t)?t:null})).filter((e=>!!e));if(r.length){r.forEach((e=>{if(e&&l().default.existsSync(e)){const t=h().default.extname(e).replace(/^\./u,""),n=l().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:E[t]},H()));l().default.writeFileSync(e,r,"utf8")}})),_("script prettier success!");const e=te();if(e){const i=r.filter((e=>B.every((t=>!(0,m().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof n?!(0,m().default)(e,n,{matchBase:!0}):n instanceof RegExp?!n.test(e):!Array.isArray(n)||n.every((t=>"string"===typeof t?!(0,m().default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(t&&(Q("git commit\u7981\u6b62eslint\u7684ignore\u65b9\u5f0f(eslint-disable\u3001.eslintrc*\u3001ignore\u7b49)\u3002"),n&&Q(`\u901a\u8fc7yolkrc\u914d\u7f6eeslintIgnore\uff1a${n}\u3002`)),i.length>=D){const n=[];(0,a().default)(i,20).forEach((r=>{n.push(new Promise((n=>{A({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...r],complete:n,exit:!1})})))}));const r=process.getMaxListeners(),o=(0,a().default)(n,r?r/2:2);let s=0;const c=()=>{s<o.length?Promise.all(o[s]).then((()=>{s++,c()})):M()};c()}else i.length&&A({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...i]})}else Q("\u6ca1\u6709eslint\u914d\u7f6e\u6587\u4ef6")}else M()};Q("\u8981\u6c42\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),i.then(o)}))},oe=({mProject:e,mPrivateKeyPath:t,mVersion:n,mDesc:r,mRobot:i,mQrcodeFormat:o,mQrcodeOutputDest:a,mPagePath:c,mSearchQuery:u})=>{const f=l().default.existsSync(h().default.join(P,".git"))?(0,s().execSync)("git log -1 --pretty=format:%H").toString():"",m=J(),p=m.appid,y=e||h().default.join(P,"dist"),g=t||h().default.join(P,`private.${p}.key`);if(l().default.existsSync(y)){if(l().default.existsSync(g)){const e=U(),t=n||e.version||m.version||"1.0.0",s=r||e.description||m.description,l=`version: ${t};${f?` commit: ${f};`:""}${s?` description: ${s};`:""}`;f&&T(`commit: ${f}`),T(`dist: ${y}`),T(`key: ${g}`),T(`appid: ${p}`),T(`version: ${t}`),T(`desc: ${l}`);const b=new(d().Project)({appid:p,type:"miniProgram",projectPath:y,privateKeyPath:g,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:p,options:{project:b,version:t,desc:l,setting:m.setting,robot:i,qrcodeFormat:o,qrcodeOutputDest:a,pagePath:c,searchQuery:u}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${g})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${y})`)},ae=()=>{re(),process.argv.length>2?c().default.version(k.default.version).usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,n)=>{const a=(0,t().default)(n),s=a[0],c=a.slice(1),u=e.clone,f=e.template,m=e.docs;if(s)switch(T(`yolk version: ${k.default.version}`),T(`node version: ${process.version}`),T(`platform: ${b().default.platform()}`),T(`memory: ${(0,o().default)(b().default.freemem()/1024/1024)} MB(${(0,o().default)(b().default.totalmem()/1024/1024)} MB)`),s){case"init":if(_(`yolk ${s} \u5f00\u59cb`),u)if(f){const e=".yolk",t=h().default.join(P,e);l().default.existsSync(t)&&(0,v().default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),A({command:"git",args:["clone","-b","master","--depth","1",f,e].concat(c)}),C(P,t)}else R("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else K(P);break;case"start":V()?Z()?A({command:"taro",args:["build","--type","tt","--watch"].concat(c)}):ee()?A({command:"taro",args:["build","--type","alipay","--watch"].concat(c)}):A({command:"taro",args:["build","--type","weapp","--watch"].concat(c)}):m?A({command:"dumi",args:["dev"].concat(c)}):G()?A({command:"icejs",args:["start","--config",Y()].concat(c)}):X()?A({command:"max",args:["dev"].concat(c)}):A({command:"umi",args:["dev"].concat(c)});break;case"build":V()?Z()?A({command:"taro",args:["build","--type","tt"].concat(c)}):ee()?A({command:"taro",args:["build","--type","alipay"].concat(c)}):A({command:"taro",args:["build","--type","weapp"].concat(c)}):m?A({command:"dumi",args:["build"].concat(c)}):G()?A({command:"icejs",args:["build","--config",Y()].concat(c)}):X()?A({command:"max",args:["build"].concat(c)}):A({command:"umi",args:["build"].concat(c)});break;case"pre-commit":ie();break;case"test":A({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(c)});break;case"miniapp-upload":case"miniprogram-upload":if(V())if(Z());else if(ee());else{const t=oe(e),n=t.appid,o=t.options;T(`${n}\u4e0a\u4f20\u5f00\u59cb`),d().upload($($({},(0,i().default)(o,["project","version","desc","setting","robot"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))T(`task: ${e}`);else{const t=e.status,n=e.message;T(`task(${t}): ${n}`)}}})).then((()=>{_(`${n}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(V())if(Z());else if(ee());else{const t=oe(e),n=t.appid,o=t.options;T(`${n}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),d().preview($($({},(0,i().default)(o,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))T(`task: ${e}`);else{const t=e.status,n=e.message;T(`task(${t}): ${n}`)}}})).then((()=>{_(`${n}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:N()}})).parse(process.argv):N()};ae();
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,r=(e,n,r,o)=>{if(n&&"object"===typeof n||"function"===typeof n)for(let c of a(n))i.call(e,c)||c===r||t(e,c,{get:()=>n[c],enumerable:!(o=s(n,c))||o.enumerable});return e},o=(s,a,i)=>(i=null!=s?e(n(s)):{},r(!a&&s&&s.__esModule?i:t(i,"default",{value:s,enumerable:!0}),s)),c=e=>r(t({},"__esModule",{value:!0}),e),l={};module.exports=c(l);var d=require("child_process"),u=o(require("fs")),m=o(require("os")),f=o(require("path")),p=o(require("lodash")),y=o(require("inquirer")),g=o(require("miniprogram-ci")),h=o(require("ora")),$=o(require("../compiled/commander")),b=o(require("../compiled/glob")),x=o(require("../compiled/minimatch")),v=o(require("../compiled/mkdirp")),S=o(require("../compiled/mustache")),j=require("../compiled/prettier"),k=o(require("../compiled/rimraf")),w=o(require("../package.json")),O=require("../compiled/staged-git-files"),q=process.cwd(),P="##### CREATED BY YOLK #####",_={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},D="utf-8",F=20,I=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],E=(0,h.default)(),N=e=>e&&E.warn(Buffer.from(e,D).toString()),B=e=>e&&E.fail(Buffer.from(e,D).toString()),K=e=>e&&E.succeed(Buffer.from(e,D).toString()),U=e=>e&&E.info(Buffer.from(e,D).toString()),Q=e=>"win32"===process.platform?`${e}.cmd`:e,R=()=>{K("yolk complete!"),process.exit(0)},T=()=>{N("yolk break!"),process.exit(0)},Y=({command:e,args:t,complete:s,close:a,exit:n=!0})=>{const i=(0,d.spawn)(Q(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(a&&a(),B("yolk close!"),process.exit(e)):(s&&s(),n&&R())}));process.on("SIGINT",(()=>{$.default.runningCommand&&$.default.runningCommand.kill("SIGKILL"),i.kill(),T()}))},W=(e,t,s)=>{y.default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:f.default.basename(f.default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((a=>{const n={projectName:a.projectName,dependenciesInstallType:a.dependenciesInstallType,yolkVersion:w.default.version},i=t||f.default.join(__dirname,`../templates/${a.type}`);K(`\u590d\u5236\u6a21\u7248 ${f.default.basename(i)}`);const r=b.default.sync("**/*",{cwd:i,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(r.forEach((t=>{if(!i)return;const s=f.default.join(i,t);if(!u.default.statSync(s).isDirectory())if(t.endsWith(".tpl")){const a=u.default.readFileSync(s,D),i=f.default.join(e,t.replace(/\.tpl$/,"")),r=S.default.render(a,n);v.default.sync(f.default.dirname(i)),K(`\u521b\u5efa ${f.default.relative(e,i)}`),u.default.writeFileSync(i,r,D)}else{K(`\u521b\u5efa ${t}`);const a=f.default.join(e,t);v.default.sync(f.default.dirname(a)),u.default.copyFileSync(s,a)}})),K("\u590d\u5236\u6a21\u7248 success!"),s&&u.default.existsSync(i)&&(0,k.default)(i,(()=>{K(`\u7f13\u5b58\u5220\u9664 success! ${f.default.basename(i||"")}`)})),a.dependenciesInstallType)switch(K("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),a.dependenciesInstallType){case"default":case"pnpm":Y({command:"pnpm",args:["install"]});break;case"yarn":Y({command:"yarn",args:["install"]});break;case"npm":Y({command:"npm",args:["install"]});break;default:}K("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},L=(e,t)=>W(e,t,!0),A=()=>{const e=b.default.sync("*.yolkrc*",{cwd:q,dot:!0});if(!e.length)return{};const t=f.default.join(q,e[0]);if(!u.default.existsSync(t))return{};try{return JSON.parse(u.default.readFileSync(t,D))||{}}catch(s){return B(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},J=()=>{const e=f.default.join(q,".prettierrc");if(u.default.existsSync(e))try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},C=()=>{const e=f.default.join(q,"project.config.json");if(!u.default.existsSync(e))return{};try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>{const e=f.default.join(q,"package.json");if(!u.default.existsSync(e))return{};try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>u.default.existsSync(f.default.join(q,"project.config.json")),G=()=>{let e=u.default.existsSync(f.default.join(q,"node_modules/.bin/max"));if(!e)try{e=u.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,d.execSync)("umi -v").toString())}catch(t){}if(!e){const s=f.default.join(q,"node_modules","umi","package.json");if(u.default.existsSync(s))try{const t=JSON.parse(u.default.readFileSync(s,D))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},H=()=>{const e=f.default.join(q,"project.config.json");if(u.default.existsSync(e)){const t=require(e);return t.appid}return""},X=()=>u.default.existsSync(f.default.join(q,"project.tt.json"))&&0===H().indexOf("tt"),z=()=>0===H().indexOf("20"),Z=()=>{const e=A();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(n){}const s=b.default.sync("*.eslintrc*",{cwd:q,dot:!0}),a=s[0];return!1===e.strict&&a&&u.default.existsSync(a)?a:u.default.existsSync(t)?t:a},ee=()=>{const e=A();let t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(n){}const s=b.default.sync("*.stylelintrc*",{cwd:q,dot:!0}),a=s[0];return!1===e.strict&&a&&u.default.existsSync(a)?a:u.default.existsSync(t)?t:a},te=()=>{const e=f.default.join(q,".git/"),t=f.default.join(q,".git/hooks"),s=f.default.join(t,"pre-commit"),a=u.default.existsSync(e),n=u.default.existsSync(s),i=n&&u.default.readFileSync(s,D).includes(P);if(a&&(!n||!i)){v.default.sync(t),u.default.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",P].join(m.default.EOL),D);try{u.default.chmodSync(s,"777")}catch(r){B(`chmod ${s} failed: ${r.message}`)}K("Create pre-commit hook")}},se=()=>{const e=A(),t=!1!==e.strict,s=e.eslintIgnore,a=e.stylelintIgnore;O().then((e=>{const n=s=>new Promise(((n,i)=>{const r=ee();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[s].test(e)))).filter((e=>{const t=f.default.join(q,e);return u.default.existsSync(t)})).filter((e=>I.every((t=>!(0,x.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof a?!(0,x.default)(e,a,{matchBase:!0}):a instanceof RegExp?!a.test(e):!Array.isArray(a)||a.every((t=>"string"===typeof t?!(0,x.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&u.default.existsSync(e)){const t=f.default.extname(e).replace(/^\./,""),s=u.default.readFileSync(e,D),a=(0,j.format)(s,{parser:_[t],...J()});u.default.writeFileSync(e,a,D)}})),K(`${s} - ${o.length} files prettier success!`),o.length>=F){const e=[];p.default.chunk(o,F).forEach((a=>{e.push(new Promise(((e,n)=>{Y({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...a],complete:e,close:n,exit:!1})})))}));let a=0;const c=()=>{a<e.length?e[a].then((()=>{a++,c()})).catch(i):(K(`${s} - ${o.length} files stylelint success!`),n())};c()}else o.length&&Y({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...o],complete:()=>{K(`${s} - ${o.length} files stylelint success!`),n()},close:i,exit:!1});else n()}else B(`\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c${s} files prettier fail!`),n()})),i=a=>new Promise(((n,i)=>{const r=Z();if(r){const o=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[a].test(e)))).filter((e=>{const t=f.default.join(q,e);return u.default.existsSync(t)})).filter((e=>I.every((t=>!(0,x.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!(0,x.default)(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!(0,x.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&u.default.existsSync(e)){const t=f.default.extname(e).replace(/^\./,""),s=u.default.readFileSync(e,D),a=(0,j.format)(s,{parser:_[t],...J()});u.default.writeFileSync(e,a,D)}})),K(`${a} - ${o.length} files prettier success!`),o.length>=F){const e=[];p.default.chunk(o,F).forEach((s=>{e.push(new Promise(((e,a)=>{Y({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...s],complete:e,close:a,exit:!1})})))}));let s=0;const c=()=>{s<e.length?e[s].then((()=>{s++,c()})).catch(i):(K(`${a} - ${o.length} files eslint success!`),n())};c()}else o.length&&Y({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...o],complete:()=>{K(`${a} - ${o.length} files eslint success!`),n()},close:i,exit:!1});else n()}else B(`\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c${a} files eslint fail!`),n()}));N("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(N("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),a&&N(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${a}\u3002`),s&&N(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${s}\u3002`)),n("css").then((()=>n("less"))).then((()=>n("sass"))).then((()=>n("scss"))).then((()=>i("js"))).then((()=>i("jsx"))).then((()=>i("ts"))).then((()=>i("tsx"))).then(R).catch(R)}))},ae=({mProject:e,mPrivateKeyPath:t,mVersion:s,mDesc:a,mRobot:n,mQrcodeFormat:i,mQrcodeOutputDest:r,mPagePath:o,mSearchQuery:c})=>{const l=u.default.existsSync(f.default.join(q,".git"))?(0,d.execSync)("git log -1 --pretty=format:%H").toString():"",m=C(),p=m.appid,y=e||f.default.join(q,"dist"),h=t||f.default.join(q,`private.${p}.key`);if(u.default.existsSync(y)){if(u.default.existsSync(h)){const e=M(),t=s||e.version||m.version||"1.0.0",d=a||e.description||m.description,u=`version: ${t};${l?` commit: ${l};`:""}${d?` description: ${d};`:""}`;l&&U(`commit: ${l}`),U(`dist: ${y}`),U(`key: ${h}`),U(`appid: ${p}`),U(`version: ${t}`),U(`desc: ${u}`);const f=new g.Project({appid:p,type:"miniProgram",projectPath:y,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:p,options:{project:f,version:t,desc:u,setting:m.setting,robot:n,qrcodeFormat:i,qrcodeOutputDest:r,pagePath:o,searchQuery:c}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${h})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${y})`)},ne=()=>{te(),process.argv.length>2?$.default.version(w.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,t)=>{const[s,...a]=t,{clone:n,template:i,docs:r}=e;if(s)switch(U(`yolk version: ${w.default.version}`),U(`node version: ${process.version}`),U(`platform: ${m.default.platform()}`),U(`memory: ${p.default.floor(m.default.freemem()/1024/1024)} MB(${p.default.floor(m.default.totalmem()/1024/1024)} MB)`),s){case"init":if(K(`yolk ${s} \u5f00\u59cb`),n)if(i){const e=".yolk",t=f.default.join(q,e);u.default.existsSync(t)&&(0,k.default)(t,(()=>{K(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),Y({command:"git",args:["clone","-b","master","--depth","1",i,e].concat(a)}),L(q,t)}else B("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else W(q);break;case"start":V()?X()?Y({command:"taro",args:["build","--type","tt","--watch"].concat(a)}):z()?Y({command:"taro",args:["build","--type","alipay","--watch"].concat(a)}):Y({command:"taro",args:["build","--type","weapp","--watch"].concat(a)}):r?(process.env.DID_YOU_KNOW="none",Y({command:"dumi",args:["dev"].concat(a)})):G()?(process.env.DID_YOU_KNOW="none",Y({command:"max",args:["dev"].concat(a)})):(process.env.DID_YOU_KNOW="none",Y({command:"umi",args:["dev"].concat(a)}));break;case"build":V()?X()?Y({command:"taro",args:["build","--type","tt"].concat(a)}):z()?Y({command:"taro",args:["build","--type","alipay"].concat(a)}):Y({command:"taro",args:["build","--type","weapp"].concat(a)}):r?(process.env.DID_YOU_KNOW="none",Y({command:"dumi",args:["build"].concat(a)})):G()?(process.env.DID_YOU_KNOW="none",Y({command:"max",args:["setup"].concat(a),complete:()=>Y({command:"max",args:["build"].concat(a)}),exit:!1})):(process.env.DID_YOU_KNOW="none",Y({command:"umi",args:["build"].concat(a)}));break;case"pre-commit":se();break;case"miniprogram-upload":if(V())if(X());else if(z());else{const{appid:t,options:s}=ae(e);U(`${t}\u4e0a\u4f20\u5f00\u59cb`),g.upload({...p.default.pick(s,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if(p.default.isString(e))U(`task: ${e}`);else{const{status:t,message:s}=e;U(`task(${t}): ${s}`)}}}).then((()=>{K(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniprogram-preview":if(V())if(X());else if(z());else{const{appid:t,options:s}=ae(e);U(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),g.preview({...p.default.pick(s,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if(p.default.isString(e))U(`task: ${e}`);else{const{status:t,message:s}=e;U(`task(${t}): ${s}`)}}}).then((()=>{K(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:T()}})).parse(process.argv):T()};ne();
|
package/package.json
CHANGED
|
@@ -1,44 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baic/yolk-cli",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"yolk": "lib/index.js"
|
|
3
|
+
"version": "2.1.0-alpha.110",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/303394539/yolk.git"
|
|
8
7
|
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Baic <303394539@qq.com>",
|
|
9
10
|
"main": "lib/index.js",
|
|
10
11
|
"module": "es/index.js",
|
|
11
12
|
"typings": "lib/index.d.ts",
|
|
13
|
+
"bin": {
|
|
14
|
+
"yolk": "lib/index.js"
|
|
15
|
+
},
|
|
12
16
|
"files": [
|
|
17
|
+
"compiled",
|
|
13
18
|
"lib",
|
|
14
19
|
"es",
|
|
15
20
|
"templates"
|
|
16
21
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "father build",
|
|
24
|
+
"ncu": "ncu",
|
|
25
|
+
"prebundle": "father prebundle"
|
|
20
26
|
},
|
|
21
27
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@types/inquirer": "~8.
|
|
24
|
-
"@types/lodash": "4.x",
|
|
25
|
-
"@types/
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"@babel/runtime": "~7.x",
|
|
29
|
+
"@types/inquirer": "~8.x",
|
|
30
|
+
"@types/lodash": "~4.x",
|
|
31
|
+
"@types/prettier": "~2.x",
|
|
32
|
+
"inquirer": "~8.x",
|
|
33
|
+
"lodash": "~4.x",
|
|
34
|
+
"miniprogram-ci": "~1.9.x",
|
|
35
|
+
"ora": "5.4.1",
|
|
36
|
+
"prettier": "~2.x",
|
|
37
|
+
"v8-compile-cache": "~2.3.x"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/glob": "~8.x",
|
|
41
|
+
"@types/minimatch": "~5.1.x",
|
|
42
|
+
"@types/mkdirp": "~1.0.x",
|
|
43
|
+
"@types/mustache": "~4.2.x",
|
|
44
|
+
"@types/rimraf": "~3.0.x",
|
|
45
|
+
"commander": "~6.x",
|
|
46
|
+
"glob": "~8.x",
|
|
47
|
+
"minimatch": "~5.1.x",
|
|
48
|
+
"mkdirp": "~1.0.x",
|
|
49
|
+
"mustache": "~4.2.x",
|
|
50
|
+
"rimraf": "~3.0.x",
|
|
51
|
+
"staged-git-files": "~1.3.x"
|
|
39
52
|
},
|
|
40
53
|
"publishConfig": {
|
|
41
54
|
"access": "public"
|
|
42
55
|
},
|
|
43
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "3e4119986f5ef14d116915926982c4b9eb493356"
|
|
44
57
|
}
|