@baic/yolk-cli 2.1.0-alpha.8 → 2.1.0-github.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2218 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/minimatch/index.d.ts +312 -0
- package/compiled/minimatch/index.js +1254 -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 +892 -0
- package/compiled/prettier/index.js +48593 -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 +13 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -1
- package/es/yolk.js +1 -1
- package/lib/.prettierrc.js +13 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/yolk.js +1 -1
- package/package.json +38 -26
- package/templates/ice-mobile/.eslintrc +1 -1
- package/templates/ice-mobile/.gitignore.tpl +10 -3
- package/templates/ice-mobile/.icerc.ts +2 -2
- package/templates/ice-mobile/.npmrc.tpl +2 -0
- package/templates/ice-mobile/.prettierignore +4 -5
- package/templates/ice-mobile/.prettierrc.js +1 -0
- package/templates/ice-mobile/README.md.tpl +1 -1
- package/templates/ice-mobile/package.json.tpl +5 -0
- package/templates/ice-mobile/public/index.html +15 -0
- package/templates/ice-mobile/src/app.tsx +1 -1
- package/templates/ice-mobile/src/pages/demo/examples/Input.tsx +1 -2
- package/templates/ice-mobile/src/pages/demo/examples/List/4.tsx +2 -2
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/1.tsx +1 -2
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/2.tsx +1 -2
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/3.tsx +1 -2
- package/templates/ice-mobile/src/pages/demo/examples/NumberInput/4.tsx +1 -2
- package/templates/ice-mobile/src/routes.ts +2 -1
- package/templates/ice-mobile-h5+app/.eslintrc +6 -0
- package/templates/ice-mobile-h5+app/.gitignore.tpl +37 -0
- package/templates/ice-mobile-h5+app/.icerc.ts +6 -0
- package/templates/ice-mobile-h5+app/.npmrc.tpl +2 -0
- package/templates/ice-mobile-h5+app/.prettierignore +8 -0
- package/templates/ice-mobile-h5+app/.prettierrc.js +1 -0
- package/templates/ice-mobile-h5+app/.stylelintrc +3 -0
- package/templates/ice-mobile-h5+app/README.md.tpl +34 -0
- package/templates/ice-mobile-h5+app/h5+app/manifest.json +87 -0
- package/templates/ice-mobile-h5+app/package.json.tpl +16 -0
- package/templates/ice-mobile-h5+app/public/favicon.ico +0 -0
- package/templates/ice-mobile-h5+app/public/index.html +15 -0
- package/templates/ice-mobile-h5+app/src/app.tsx +5 -0
- package/templates/ice-mobile-h5+app/src/common/request.ts +3 -0
- package/templates/ice-mobile-h5+app/src/common/util.ts +7 -0
- package/templates/ice-mobile-h5+app/src/components/index.ts +0 -0
- package/templates/ice-mobile-h5+app/src/global.less +3 -0
- package/templates/ice-mobile-h5+app/src/layouts/index.tsx +5 -0
- package/templates/ice-mobile-h5+app/src/pages/404.tsx +10 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Input.tsx +16 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/1.tsx +12 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/2.tsx +29 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/3.tsx +29 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/4.tsx +55 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/List/mock.ts +30 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +16 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +16 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +16 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +16 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +6 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/ice-mobile-h5+app/src/pages/demo/index.tsx +87 -0
- package/templates/ice-mobile-h5+app/src/pages/index.tsx +3 -0
- package/templates/ice-mobile-h5+app/src/routes.ts +29 -0
- package/templates/ice-mobile-h5+app/src/types/user.d.ts +3 -0
- package/templates/ice-mobile-h5+app/tsconfig.json +3 -0
- package/templates/ice-mobile-h5+app/typings.d.ts +1 -0
- package/templates/ice-mobile-native/.eslintrc +6 -0
- package/templates/ice-mobile-native/.gitignore.tpl +42 -0
- package/templates/ice-mobile-native/.icerc.ts +8 -0
- package/templates/ice-mobile-native/.npmrc.tpl +2 -0
- package/templates/ice-mobile-native/.prettierignore +8 -0
- package/templates/ice-mobile-native/.prettierrc.js +1 -0
- package/templates/ice-mobile-native/.stylelintrc +3 -0
- package/templates/ice-mobile-native/README.md.tpl +34 -0
- package/templates/ice-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
- package/templates/ice-mobile-native/android/app/build.gradle +66 -0
- 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 +303 -0
- package/templates/ice-mobile-native/android/app/src/main/AndroidManifest.xml +98 -0
- package/templates/ice-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +89 -0
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +6 -0
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_error.html +92 -0
- package/templates/ice-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +19 -0
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +119 -0
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +17 -0
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +17 -0
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +26 -0
- package/templates/ice-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +265 -0
- 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 +5 -0
- package/templates/ice-mobile-native/android/app/src/main/res/values/strings.xml +3 -0
- package/templates/ice-mobile-native/android/build.gradle +9 -0
- package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/ice-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/templates/ice-mobile-native/android/gradle.properties +22 -0
- package/templates/ice-mobile-native/android/gradlew +185 -0
- package/templates/ice-mobile-native/android/gradlew.bat +89 -0
- package/templates/ice-mobile-native/android/settings.gradle +16 -0
- package/templates/ice-mobile-native/ios/HBuilder/HBuilder.entitlements +5 -0
- 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 +62 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +6 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +20 -0
- 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 +26 -0
- package/templates/ice-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +21 -0
- 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 +22 -0
- 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 +22 -0
- 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 +22 -0
- 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 +21 -0
- 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 +22 -0
- 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 +22 -0
- 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 +23 -0
- 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 +23 -0
- 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 +23 -0
- 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 +23 -0
- 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 +22 -0
- 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 +22 -0
- 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 +22 -0
- 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 +16 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/AppDelegate.m +225 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +65 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +13 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +486 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +16 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +67 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +79 -0
- 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 +19 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/ViewController.m +161 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.h +19 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/Xprinter.m +235 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/control.xml +107 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +4 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +12 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/main.m +18 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +4 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +3 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +13 -0
- package/templates/ice-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +1607 -0
- package/templates/ice-mobile-native/package.json.tpl +16 -0
- package/templates/ice-mobile-native/public/favicon.ico +0 -0
- package/templates/ice-mobile-native/public/index.html +15 -0
- package/templates/ice-mobile-native/src/app.tsx +5 -0
- package/templates/ice-mobile-native/src/common/Xprinter.ts +58 -0
- package/templates/ice-mobile-native/src/common/bluetooth.ts +354 -0
- package/templates/ice-mobile-native/src/common/bridge.ts +59 -0
- package/templates/ice-mobile-native/src/common/request.ts +3 -0
- package/templates/ice-mobile-native/src/common/util.ts +7 -0
- package/templates/ice-mobile-native/src/components/index.ts +0 -0
- package/templates/ice-mobile-native/src/global.less +3 -0
- package/templates/ice-mobile-native/src/layouts/index.tsx +5 -0
- package/templates/ice-mobile-native/src/pages/404.tsx +10 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Input.tsx +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/List/1.tsx +12 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/List/2.tsx +29 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/List/3.tsx +29 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/List/4.tsx +55 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/List/mock.ts +30 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/PagingList/1.tsx +6 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +64 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/Xprinter/style.less +16 -0
- package/templates/ice-mobile-native/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/ice-mobile-native/src/pages/demo/index.tsx +89 -0
- package/templates/ice-mobile-native/src/pages/index.tsx +3 -0
- package/templates/ice-mobile-native/src/routes.ts +29 -0
- package/templates/ice-mobile-native/src/types/user.d.ts +3 -0
- package/templates/ice-mobile-native/tsconfig.json +3 -0
- package/templates/ice-mobile-native/typings.d.ts +1 -0
- package/templates/ice-web/.eslintrc +1 -1
- package/templates/ice-web/.gitignore.tpl +10 -3
- package/templates/ice-web/.icerc.ts +1 -1
- package/templates/ice-web/.npmrc.tpl +2 -0
- package/templates/ice-web/.prettierignore +4 -5
- package/templates/ice-web/.prettierrc.js +1 -0
- package/templates/ice-web/README.md.tpl +1 -1
- package/templates/ice-web/package.json.tpl +5 -0
- package/templates/ice-web/public/index.html +15 -0
- package/templates/ice-web/src/app.tsx +1 -1
- package/templates/ice-web/src/pages/demo/examples/BankInput.tsx +1 -2
- package/templates/ice-web/src/pages/demo/examples/Grid/5.tsx +1 -2
- package/templates/ice-web/src/pages/demo/examples/Input/2.tsx +2 -1
- package/templates/ice-web/src/pages/demo/examples/RangeNumber/2.tsx +1 -2
- package/templates/ice-web/src/pages/demo/examples/SearchLayout.tsx +2 -2
- package/templates/ice-web/src/pages/demo/examples/Wrapper.tsx +1 -1
- package/templates/ice-web/src/routes.ts +2 -1
- package/templates/ice-web-screen/.eslintrc +6 -0
- package/templates/ice-web-screen/.gitignore.tpl +37 -0
- package/templates/ice-web-screen/.icerc.ts +3 -0
- package/templates/ice-web-screen/.npmrc.tpl +2 -0
- package/templates/ice-web-screen/.prettierignore +8 -0
- package/templates/ice-web-screen/.prettierrc.js +1 -0
- package/templates/ice-web-screen/.stylelintrc +3 -0
- package/templates/ice-web-screen/README.md.tpl +34 -0
- package/templates/ice-web-screen/package.json.tpl +17 -0
- package/templates/ice-web-screen/public/favicon.ico +0 -0
- package/templates/ice-web-screen/public/index.html +15 -0
- package/templates/ice-web-screen/src/app.tsx +5 -0
- package/templates/ice-web-screen/src/common/request.ts +3 -0
- package/templates/ice-web-screen/src/common/util.ts +15 -0
- package/templates/ice-web-screen/src/components/index.ts +1 -0
- package/templates/ice-web-screen/src/components/resize-container/index.tsx +95 -0
- package/templates/ice-web-screen/src/components/resize-container/style.module.less +3 -0
- package/templates/ice-web-screen/src/constants.ts +7 -0
- package/templates/ice-web-screen/src/global.less +31 -0
- package/templates/ice-web-screen/src/hooks/use-size.ts +18 -0
- package/templates/ice-web-screen/src/layouts/16_9/fixed.less +18 -0
- package/templates/ice-web-screen/src/layouts/16_9/index.tsx +34 -0
- package/templates/ice-web-screen/src/layouts/16_9/style.module.less +19 -0
- package/templates/ice-web-screen/src/layouts/components/index.ts +0 -0
- package/templates/ice-web-screen/src/layouts/controller/index.tsx +79 -0
- package/templates/ice-web-screen/src/layouts/index.tsx +11 -0
- package/templates/ice-web-screen/src/pages/404.tsx +17 -0
- package/templates/ice-web-screen/src/pages/index.tsx +3 -0
- package/templates/ice-web-screen/src/pages/template/16_9/index.tsx +13 -0
- package/templates/ice-web-screen/src/pages/template/16_9/style.module.less +7 -0
- package/templates/ice-web-screen/src/pages/template/components/charts/demo-line/index.tsx +274 -0
- package/templates/ice-web-screen/src/pages/template/components/charts/index.ts +1 -0
- package/templates/ice-web-screen/src/pages/template/components/index.ts +1 -0
- package/templates/ice-web-screen/src/pages/template/controller/index.tsx +85 -0
- package/templates/ice-web-screen/src/pages/template/index.tsx +15 -0
- package/templates/ice-web-screen/src/pages/template/style.module.less +3 -0
- package/templates/ice-web-screen/src/routes.ts +29 -0
- package/templates/ice-web-screen/src/styles/vars.less +5 -0
- package/templates/ice-web-screen/src/types/user.d.ts +3 -0
- package/templates/ice-web-screen/tsconfig.json +3 -0
- package/templates/ice-web-screen/typings.d.ts +1 -0
- package/templates/miniprogram/.eslintrc +1 -1
- package/templates/miniprogram/.gitignore.tpl +12 -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 +6 -2
- package/templates/miniprogram/src/pages/demo/examples/Input.tsx +11 -2
- package/templates/miniprogram/src/pages/demo/{index.module.scss → style.scss} +0 -0
- package/templates/miniprogram/src/pages/index/index.tsx +3 -1
- package/templates/miniprogram/src/pages/index/{index.module.scss → style.scss} +0 -0
- 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 -1
- package/templates/umi-mobile/README.md.tpl +2 -2
- package/templates/umi-mobile/package.json.tpl +5 -0
- package/templates/umi-mobile/src/app.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +2 -2
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +1 -2
- package/templates/umi-mobile-h5+app/.eslintrc +6 -0
- package/templates/umi-mobile-h5+app/.gitignore.tpl +37 -0
- package/templates/umi-mobile-h5+app/.npmrc.tpl +2 -0
- package/templates/umi-mobile-h5+app/.prettierignore +12 -0
- package/templates/umi-mobile-h5+app/.prettierrc.js +1 -0
- package/templates/umi-mobile-h5+app/.stylelintrc +3 -0
- package/templates/umi-mobile-h5+app/.umirc.ts.tpl +8 -0
- package/templates/umi-mobile-h5+app/LICENSE +21 -0
- package/templates/umi-mobile-h5+app/README.md.tpl +34 -0
- package/templates/umi-mobile-h5+app/h5+app/manifest.json +87 -0
- package/templates/umi-mobile-h5+app/package.json.tpl +16 -0
- package/templates/umi-mobile-h5+app/public/favicon.ico +0 -0
- package/templates/umi-mobile-h5+app/src/app.tsx +19 -0
- package/templates/umi-mobile-h5+app/src/common/request.ts +3 -0
- package/templates/umi-mobile-h5+app/src/common/util.ts +7 -0
- package/templates/umi-mobile-h5+app/src/components/index.ts +0 -0
- package/templates/umi-mobile-h5+app/src/global.less +3 -0
- package/templates/umi-mobile-h5+app/src/layouts/index.tsx +3 -0
- package/templates/umi-mobile-h5+app/src/pages/404.tsx +10 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/Input.tsx +16 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/1.tsx +12 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/2.tsx +29 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/3.tsx +29 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/4.tsx +55 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/mock.ts +30 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/1.tsx +16 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/2.tsx +16 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/3.tsx +16 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/NumberInput/4.tsx +16 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/PagingList/1.tsx +6 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +87 -0
- package/templates/umi-mobile-h5+app/src/pages/index.tsx +3 -0
- package/templates/umi-mobile-h5+app/src/types/user.d.ts +3 -0
- package/templates/umi-mobile-h5+app/tsconfig.json +3 -0
- package/templates/umi-mobile-h5+app/typings.d.ts +1 -0
- package/templates/umi-mobile-native/.eslintrc +6 -0
- package/templates/umi-mobile-native/.gitignore.tpl +42 -0
- package/templates/umi-mobile-native/.npmrc.tpl +2 -0
- package/templates/umi-mobile-native/.prettierignore +12 -0
- package/templates/umi-mobile-native/.prettierrc.js +1 -0
- package/templates/umi-mobile-native/.stylelintrc +3 -0
- package/templates/umi-mobile-native/.umirc.ts.tpl +10 -0
- package/templates/umi-mobile-native/LICENSE +21 -0
- package/templates/umi-mobile-native/README.md.tpl +34 -0
- package/templates/umi-mobile-native/android/app/6209ba977ffec7d62675a4e254ebc209.keystore +0 -0
- package/templates/umi-mobile-native/android/app/build.gradle +66 -0
- package/templates/umi-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
- package/templates/umi-mobile-native/android/app/libs/PosPrinterSDK.jar +0 -0
- package/templates/umi-mobile-native/android/app/libs/android-gif-drawable-release@1.2.23.aar +0 -0
- package/templates/umi-mobile-native/android/app/libs/lib.5plus.base-release.aar +0 -0
- package/templates/umi-mobile-native/android/app/libs/oaid_sdk_1.0.25.aar +0 -0
- package/templates/umi-mobile-native/android/app/libs/webview-x5-release.aar +0 -0
- package/templates/umi-mobile-native/android/app/proguard-rules.pro +303 -0
- package/templates/umi-mobile-native/android/app/src/main/AndroidManifest.xml +98 -0
- package/templates/umi-mobile-native/android/app/src/main/assets/apps/H5ECA1DEE/www/manifest.json +89 -0
- package/templates/umi-mobile-native/android/app/src/main/assets/data/dcloud_control.xml +6 -0
- package/templates/umi-mobile-native/android/app/src/main/assets/data/dcloud_error.html +92 -0
- package/templates/umi-mobile-native/android/app/src/main/assets/data/dcloud_properties.xml +19 -0
- package/templates/umi-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/JSBridge/FunctionCreator.java +119 -0
- package/templates/umi-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/MPandoraEntryActivity.java +17 -0
- package/templates/umi-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Creator.java +17 -0
- package/templates/umi-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/FunctionFactory/Error.java +26 -0
- package/templates/umi-mobile-native/android/app/src/main/java/plus/H5ECA1DEE/Xprinter/JSPlugin.java +265 -0
- package/templates/umi-mobile-native/android/app/src/main/res/drawable/icon.png +0 -0
- package/templates/umi-mobile-native/android/app/src/main/res/values/colors.xml +5 -0
- package/templates/umi-mobile-native/android/app/src/main/res/values/strings.xml +3 -0
- package/templates/umi-mobile-native/android/build.gradle +9 -0
- package/templates/umi-mobile-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/umi-mobile-native/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/templates/umi-mobile-native/android/gradle.properties +22 -0
- package/templates/umi-mobile-native/android/gradlew +185 -0
- package/templates/umi-mobile-native/android/gradlew.bat +89 -0
- package/templates/umi-mobile-native/android/settings.gradle +16 -0
- package/templates/umi-mobile-native/ios/HBuilder/HBuilder.entitlements +5 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120-1.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/120x120.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/180x180.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/40x40.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/58x58.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/60x60.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/80x80.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/87x87.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/Contents.json +6 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/Image.imageset/Contents.json +20 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/120x120.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/180x180.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/60x60.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/app.imageset/Contents.json +26 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/Contents.json +21 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/control_brightness.imageset/brightness@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exitfullscreen.imageset/shrinkscreen@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211-1.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/exposure_slider_max.imageset//346/233/235/345/205/211.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206-1.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_border.imageset//345/257/271/347/204/246/346/241/206.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset/Contents.json +21 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_line.imageset//345/257/271/347/204/246/347/272/277.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset/Contents.json +22 -0
- package/templates/umi-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/umi-mobile-native/ios/HBuilder/Images.xcassets/focus_slider_thumb.imageset//345/257/271/347/204/246/345/272/225.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/full-screen.imageset/fullscreen@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/Contents.json +23 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/play.imageset/play@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/Contents.json +23 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_back.imageset/player_back@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/Contents.json +23 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_play.imageset/play@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/Contents.json +23 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/player_stop.imageset/player-stop@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteoff.imageset/video_ic_muteoff@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_ic_muteon.imageset/video_ic_muteon@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/Contents.json +22 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@2x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder/Images.xcassets/video_volume.imageset/video_volume@3x.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/120x120.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/180x180.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/AppDelegate.h +16 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/AppDelegate.m +225 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Base.lproj/LaunchScreen.storyboard +65 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/English.lproj/Localizable.strings +13 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Info.plist +486 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch +16 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/LaunchScreen.storyboard +67 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/manifest.json +79 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/1024x1024.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/120x120.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/144x144.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/152x152.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/167x167.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/180x180.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/192x192.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/20x20.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/29x29.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/40x40.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/58x58.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/60x60.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/72x72.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/76x76.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/80x80.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/87x87.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Pandora/apps/H5ECA1DEE/www/unpackage/res/icons/96x96.png +0 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/ViewController.h +19 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/ViewController.m +161 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Xprinter.h +19 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/Xprinter.m +235 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/control.xml +107 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/en.lproj/InfoPlist.strings +4 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/en.lproj/Localizable.strings +12 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/main.m +18 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/InfoPlist.strings +4 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/LaunchScreen.strings +3 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello/zh-Hans.lproj/Localizable.strings +13 -0
- package/templates/umi-mobile-native/ios/HBuilder-Hello.xcodeproj/project.pbxproj +1607 -0
- package/templates/umi-mobile-native/package.json.tpl +16 -0
- package/templates/umi-mobile-native/public/favicon.ico +0 -0
- package/templates/umi-mobile-native/src/app.tsx +19 -0
- package/templates/umi-mobile-native/src/common/Xprinter.ts +58 -0
- package/templates/umi-mobile-native/src/common/bluetooth.ts +354 -0
- package/templates/umi-mobile-native/src/common/bridge.ts +59 -0
- package/templates/umi-mobile-native/src/common/request.ts +3 -0
- package/templates/umi-mobile-native/src/common/util.ts +7 -0
- package/templates/umi-mobile-native/src/components/index.ts +0 -0
- package/templates/umi-mobile-native/src/global.less +3 -0
- package/templates/umi-mobile-native/src/images/head.png +0 -0
- package/templates/umi-mobile-native/src/layouts/index.tsx +3 -0
- package/templates/umi-mobile-native/src/pages/404.tsx +10 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Input.tsx +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/List/1.tsx +12 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/List/2.tsx +29 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/List/3.tsx +29 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/List/4.tsx +55 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/List/mock.ts +30 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/1.tsx +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/2.tsx +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/3.tsx +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/NumberInput/4.tsx +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/PagingList/1.tsx +6 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Xprinter/index.tsx +64 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/Xprinter/style.less +16 -0
- package/templates/umi-mobile-native/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/umi-mobile-native/src/pages/demo/index.tsx +89 -0
- package/templates/umi-mobile-native/src/pages/index.tsx +9 -0
- package/templates/umi-mobile-native/src/pages/style.less +6 -0
- package/templates/umi-mobile-native/src/types/user.d.ts +3 -0
- package/templates/umi-mobile-native/tsconfig.json +3 -0
- package/templates/umi-mobile-native/typings.d.ts +1 -0
- 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 -1
- package/templates/umi-web/README.md.tpl +1 -1
- package/templates/umi-web/package.json.tpl +5 -0
- package/templates/umi-web/src/app.tsx +1 -1
- 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/examples/Wrapper.tsx +1 -1
- package/templates/umi-web-screen/.eslintrc +6 -0
- package/templates/umi-web-screen/.gitignore.tpl +37 -0
- package/templates/umi-web-screen/.npmrc.tpl +2 -0
- package/templates/umi-web-screen/.prettierignore +12 -0
- package/templates/umi-web-screen/.prettierrc.js +1 -0
- package/templates/umi-web-screen/.stylelintrc +3 -0
- package/templates/umi-web-screen/.umirc.ts.tpl +8 -0
- package/templates/umi-web-screen/LICENSE +21 -0
- package/templates/umi-web-screen/README.md.tpl +34 -0
- package/templates/umi-web-screen/package.json.tpl +17 -0
- package/templates/umi-web-screen/public/favicon.ico +0 -0
- package/templates/umi-web-screen/src/app.tsx +19 -0
- package/templates/umi-web-screen/src/common/request.ts +3 -0
- package/templates/umi-web-screen/src/common/util.ts +15 -0
- package/templates/umi-web-screen/src/components/index.ts +1 -0
- package/templates/umi-web-screen/src/components/resize-container/index.tsx +95 -0
- package/templates/umi-web-screen/src/components/resize-container/style.less +3 -0
- package/templates/umi-web-screen/src/constants.ts +7 -0
- package/templates/umi-web-screen/src/global.less +28 -0
- package/templates/umi-web-screen/src/hooks/use-size.ts +18 -0
- package/templates/umi-web-screen/src/layouts/16_9/fixed.less +16 -0
- package/templates/umi-web-screen/src/layouts/16_9/index.tsx +30 -0
- package/templates/umi-web-screen/src/layouts/16_9/style.less +17 -0
- package/templates/umi-web-screen/src/layouts/components/index.ts +0 -0
- package/templates/umi-web-screen/src/layouts/controller/index.tsx +79 -0
- package/templates/umi-web-screen/src/layouts/index.tsx +11 -0
- package/templates/umi-web-screen/src/pages/404.tsx +17 -0
- package/templates/umi-web-screen/src/pages/index.tsx +3 -0
- package/templates/umi-web-screen/src/pages/template/16_9/index.tsx +13 -0
- package/templates/umi-web-screen/src/pages/template/16_9/style.less +7 -0
- package/templates/umi-web-screen/src/pages/template/components/charts/demo-line/index.tsx +274 -0
- package/templates/umi-web-screen/src/pages/template/components/charts/index.ts +1 -0
- package/templates/umi-web-screen/src/pages/template/components/index.ts +1 -0
- package/templates/umi-web-screen/src/pages/template/controller/index.tsx +85 -0
- package/templates/umi-web-screen/src/pages/template/index.tsx +15 -0
- package/templates/umi-web-screen/src/pages/template/style.less +3 -0
- package/templates/umi-web-screen/src/styles/vars.less +5 -0
- package/templates/umi-web-screen/src/types/user.d.ts +3 -0
- package/templates/umi-web-screen/tsconfig.json +3 -0
- package/templates/umi-web-screen/typings.d.ts +1 -0
- package/templates/ice-mobile/.prettierrc +0 -11
- package/templates/ice-web/.eslintcache +0 -1
- package/templates/ice-web/.prettierrc +0 -11
- 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-web/.prettierrc +0 -11
|
@@ -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","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"printWidth": 80,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"trailingComma": "all",
|
|
5
|
+
"proseWrap": "never",
|
|
6
|
+
"overrides": [{
|
|
7
|
+
"files": ".prettierrc",
|
|
8
|
+
"options": {
|
|
9
|
+
"parser": "json"
|
|
10
|
+
}
|
|
11
|
+
}],
|
|
12
|
+
// "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
|
|
13
|
+
}
|
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.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 s from"lodash/pick";import r from"lodash/floor";import i from"lodash/chunk";function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function c(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?n(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}import{execSync as a,spawn as m}from"child_process";import p from"commander";import l from"fs";import d from"glob";import u from"inquirer";import y from"minimatch";import*as f 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 x from"rimraf";import v from"../package.json";const w=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:s,exit:r=!0})=>{const i=m(T(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(s&&s(),q("yolk close!"),process.exit(e)):(o&&o(),r&&L())}));process.on("SIGINT",(()=>{p.runningCommand&&p.runningCommand.kill("SIGKILL"),i.kill(),N()}))},A=(e,t,o)=>{u.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"web template(ice framework)",value:"ice-web"},{name:"mobile template(ice framework)",value:"ice-mobile"},{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:"yarn install",value:"yarn"},{name:"npm install",value:"npm"},{name:"\u4e0d\u521d\u59cb\u5316",value:!1}]}]).then((s=>{const r={projectName:s.projectName,mobile:"umi-mobile"===s.type,dependenciesInstallType:s.dependenciesInstallType,yolkVersion:v.version};t||(t=S.join(__dirname,`../templates/${s.type}`)),Q(`\u590d\u5236\u6a21\u7248 ${S.basename(t)}`);const i=d.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((o=>{if(!t)return;const s=S.join(t,o);if(!l.statSync(s).isDirectory())if(o.endsWith(".tpl")){const t=l.readFileSync(s,E),i=S.join(e,o.replace(/\.tpl$/u,"")),n=h.render(t,r);g.sync(S.dirname(i)),Q(`\u521b\u5efa ${S.relative(e,i)}`),l.writeFileSync(i,n,E)}else{Q(`\u521b\u5efa ${o}`);const t=S.join(e,o);g.sync(S.dirname(t)),l.copyFileSync(s,t)}})),Q("\u590d\u5236\u6a21\u7248 success!"),o&&l.existsSync(t)&&x(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${S.basename(t||"")}`)})),s.dependenciesInstallType)switch(Q("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),s.dependenciesInstallType){case"npm":_({command:"npm",args:["install"]});break;case"yarn":default:_({command:"yarn",args:["install"]});break}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=d.sync("*.yolkrc*",{cwd:$,dot:!0});if(!e.length)return{};const t=S.join($,e[0]);if(!l.existsSync(t))return{};try{return JSON.parse(l.readFileSync(t,E))||{}}catch(o){return q(o.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},J=()=>{const e=S.join($,".prettierrc");if(l.existsSync(e))try{return JSON.parse(l.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"}}]}},M=()=>{const e=S.join($,"project.config.json");if(!l.existsSync(e))return{};try{return JSON.parse(l.readFileSync(e,E))||{}}catch(t){return q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>{const e=S.join($,"package.json");if(!l.existsSync(e))return{};try{return JSON.parse(l.readFileSync(e,E))||{}}catch(t){return q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>l.existsSync(S.join($,"project.config.json")),G=()=>l.existsSync(S.join($,".icerc.ts"))||l.existsSync(S.join($,".icerc.js"))||l.existsSync(S.join($,".ice.ts"))||l.existsSync(S.join($,".ice.js")),H=()=>l.existsSync(require.resolve("@umijs/max")),W=()=>l.existsSync(S.join($,".icerc.ts"))?".icerc.ts":l.existsSync(S.join($,".icerc.js"))?".icerc.js":l.existsSync(S.join($,".ice.ts"))?".ice.ts":".ice.js",Y=()=>{const e=S.join($,"project.config.json");if(l.existsSync(e)){const t=require(e);return t.appid}return""},z=()=>l.existsSync(S.join($,"project.tt.json"))&&0===Y().indexOf("tt"),X=()=>0===Y().indexOf("20"),Z=()=>{const e=C(),t=V()?require.resolve("@baic/eslint-config-yolk-miniprogram"):require.resolve("@baic/eslint-config-yolk"),o=d.sync("*.eslintrc*",{cwd:$,dot:!0}),s=o[0];return!1===e.strict&&s&&l.existsSync(s)?s:t},ee=()=>{const e=d.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"),s=l.existsSync(e),r=l.existsSync(o),i=r&&l.readFileSync(o,"utf8").includes(P);if(s&&(!r||!i)){g.sync(t),l.writeFileSync(o,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",P].join(j.EOL),"utf8");try{l.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,s=e.stylelintIgnore;w().then((e=>{const r=new Promise(((o,r)=>{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=>!y(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!y(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!y(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=S.join($,e);return l.existsSync(t)?t:null})).filter((e=>!!e));if(a.forEach((e=>{if(e&&l.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),o=l.readFileSync(e,"utf8"),s=k(o,c({parser:O[t]},J()));l.writeFileSync(e,s,"utf8")}})),Q("style prettier success!"),a.length>=F){const e=[];i(a,20).forEach((o=>{e.push(new Promise(((e,s)=>{_({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...o],complete:e,close:s,exit:!1})})))}));const s=process.getMaxListeners(),c=i(e,s?s/2:2);let m=0;const p=()=>{m<c.length?Promise.all(c[m]).then((()=>{m++,p()})).catch(r):o()};p()}else a.length&&_({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",n,...a],complete:o,close:r,exit:!1})}else o()})),n=()=>{const s=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 l.existsSync(t)?t:null})).filter((e=>!!e));if(s.length){s.forEach((e=>{if(e&&l.existsSync(e)){const t=S.extname(e).replace(/^\./u,""),o=l.readFileSync(e,"utf8"),s=k(o,c({parser:O[t]},J()));l.writeFileSync(e,s,"utf8")}})),Q("script prettier success!");const e=Z();if(e){const r=s.filter((e=>B.every((t=>!y(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof o?!y(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((t=>"string"===typeof t?!y(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`)),r.length>=F){const o=[];i(r,20).forEach((s=>{o.push(new Promise((o=>{_({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...s],complete:o,exit:!1})})))}));const s=process.getMaxListeners(),n=i(o,s?s/2:2);let c=0;const a=()=>{c<n.length?Promise.all(n[c]).then((()=>{c++,a()})):L()};a()}else r.length&&_({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...r]})}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"),r.then(n)}))},se=({mProject:e,mPrivateKeyPath:t,mVersion:o,mDesc:s,mRobot:r,mQrcodeFormat:i,mQrcodeOutputDest:n,mPagePath:c,mSearchQuery:m})=>{const p=l.existsSync(S.join($,".git"))?a("git log -1 --pretty=format:%H").toString():"",d=M(),u=d.appid,y=e||S.join($,"dist"),g=t||S.join($,`private.${u}.key`);if(l.existsSync(y)){if(l.existsSync(g)){const e=U(),t=o||e.version||d.version||"1.0.0",a=s||e.description||d.description,l=`version: ${t};${p?` commit: ${p};`:""}${a?` description: ${a};`:""}`;p&&R(`commit: ${p}`),R(`dist: ${y}`),R(`key: ${g}`),R(`appid: ${u}`),R(`version: ${t}`),R(`desc: ${l}`);const h=new f.Project({appid:u,type:"miniProgram",projectPath:y,privateKeyPath:g,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:u,options:{project:h,version:t,desc:l,setting:d.setting,robot:r,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(${y})`)},re=()=>{te(),process.argv.length>2?p.version(v.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),p=t.clone,d=t.template,u=t.docs;if(a)switch(R(`yolk version: ${v.version}`),R(`node version: ${process.version}`),R(`platform: ${j.platform()}`),R(`memory: ${r(j.freemem()/1024/1024)} MB(${r(j.totalmem()/1024/1024)} MB)`),a){case"init":if(Q(`yolk ${a} \u5f00\u59cb`),p)if(d){const e=".yolk",t=S.join($,e);l.existsSync(t)&&x(t,(()=>{Q(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),_({command:"git",args:["clone","-b","master","--depth","1",d,e].concat(m)}),K($,t)}else q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else A($);break;case"start":V()?z()?_({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):X()?_({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):_({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):u?_({command:"dumi",args:["dev"].concat(m)}):G()?_({command:"icejs",args:["start","--config",W()].concat(m)}):H()?_({command:"max",args:["dev"].concat(m)}):_({command:"umi",args:["dev"].concat(m)});break;case"build":V()?z()?_({command:"taro",args:["build","--type","tt"].concat(m)}):X()?_({command:"taro",args:["build","--type","alipay"].concat(m)}):_({command:"taro",args:["build","--type","weapp"].concat(m)}):u?_({command:"dumi",args:["build"].concat(m)}):G()?_({command:"icejs",args:["build","--config",W()].concat(m)}):H()?_({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(V())if(z());else if(X());else{const e=se(t),r=e.appid,i=e.options;R(`${r}\u4e0a\u4f20\u5f00\u59cb`),f.upload(c(c({},s(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(`${r}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(V())if(z());else if(X());else{const e=se(t),r=e.appid,i=e.options;R(`${r}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),f.preview(c(c({},s(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(`${r}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:N()}})).parse(process.argv):N()};re();
|
|
2
|
+
function e(e){return n(e)||i(e)||o(e)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e){if(Array.isArray(e))return e}function r(e){return a(e)||i(e)||o(e)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){if(e){if("string"===typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function i(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e){if(Array.isArray(e))return s(e)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}import{execSync as p,spawn as f}from"child_process";import d from"fs";import y from"os";import g from"path";import h from"inquirer";import v from"lodash";import*as b from"miniprogram-ci";import j from"ora";import S from"../compiled/commander";import x from"../compiled/glob";import w from"../compiled/minimatch";import k from"../compiled/mkdirp";import O from"../compiled/mustache";import{format as P}from"../compiled/prettier";import E from"../compiled/rimraf";import F from"../package.json";var I=require("../compiled/staged-git-files"),B=process.cwd(),A="##### CREATED BY YOLK #####",D={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},q="utf-8",$=20,T=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],N=j(),Q=function(e){return e&&N.warn(Buffer.from(e,q).toString())},R=function(e){return e&&N.fail(Buffer.from(e,q).toString())},_=function(e){return e&&N.succeed(Buffer.from(e,q).toString())},K=function(e){return e&&N.info(Buffer.from(e,q).toString())},L=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},C=function(){_("yolk complete!"),process.exit(0)},J=function(){Q("yolk break!"),process.exit(0)},U=function(e){var t=e.command,n=e.args,r=e.complete,c=e.close,o=e.exit,i=void 0===o||o,a=f(L(t),n||[],{stdio:"inherit"}).on("close",(function(e){e?(c&&c(),R("yolk close!"),process.exit(e)):(r&&r(),i&&C())}));process.on("SIGINT",(function(){S.runningCommand&&S.runningCommand.kill("SIGKILL"),a.kill(),J()}))},H=function(e,t,n){h.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:g.basename(g.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 c={projectName:r.projectName,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:F.version};t||(t=g.join(__dirname,"../templates/".concat(r.type))),_("\u590d\u5236\u6a21\u7248 ".concat(g.basename(t)));var o=x.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(o.forEach((function(n){if(t){var r=g.join(t,n);if(!d.statSync(r).isDirectory())if(n.endsWith(".tpl")){var o=d.readFileSync(r,q),i=g.join(e,n.replace(/\.tpl$/,"")),a=O.render(o,c);k.sync(g.dirname(i)),_("\u521b\u5efa ".concat(g.relative(e,i))),d.writeFileSync(i,a,q)}else{_("\u521b\u5efa ".concat(n));var s=g.join(e,n);k.sync(g.dirname(s)),d.copyFileSync(r,s)}}})),_("\u590d\u5236\u6a21\u7248 success!"),n&&d.existsSync(t)&&E(t,(function(){_("\u7f13\u5b58\u5220\u9664 success! ".concat(g.basename(t||"")))})),r.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"default":case"pnpm":U({command:"pnpm",args:["install"]});break;case"yarn":U({command:"yarn",args:["install"]});break;case"npm":U({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},M=function(e,t){return H(e,t,!0)},V=function(){var e=x.sync("*.yolkrc*",{cwd:B,dot:!0});if(!e.length)return{};var t=g.join(B,e[0]);if(!d.existsSync(t))return{};try{return JSON.parse(d.readFileSync(t,q))||{}}catch(n){return R(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},G=function(){var e=g.join(B,".prettierrc");if(d.existsSync(e))try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},X=function(){var e=g.join(B,"project.config.json");if(!d.existsSync(e))return{};try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},Y=function(){var e=g.join(B,"package.json");if(!d.existsSync(e))return{};try{return JSON.parse(d.readFileSync(e,q))||{}}catch(t){return R(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},W=function(){return d.existsSync(g.join(B,"project.config.json"))},z=function(){return d.existsSync(g.join(B,".icerc.ts"))||d.existsSync(g.join(B,".icerc.js"))||d.existsSync(g.join(B,".ice.ts"))||d.existsSync(g.join(B,".ice.js"))},Z=function(){var e=d.existsSync(g.join(B,"node_modules/.bin/max"));if(!e)try{e=d.existsSync(require.resolve("@umijs/max"))}catch(r){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(p("umi -v").toString())}catch(r){}if(!e){var t=g.join(B,"node_modules","umi","package.json");if(d.existsSync(t))try{var n=JSON.parse(d.readFileSync(t,q))||{};e=n.version&&+n.version.split(".")[0]>3}catch(r){}}return e},ee=function(){return d.existsSync(g.join(B,".icerc.ts"))?".icerc.ts":d.existsSync(g.join(B,".icerc.js"))?".icerc.js":d.existsSync(g.join(B,".ice.ts"))?".ice.ts":".ice.js"},te=function(){var e=g.join(B,"project.config.json");if(d.existsSync(e)){var t=require(e);return t.appid}return""},ne=function(){return d.existsSync(g.join(B,"project.tt.json"))&&0===te().indexOf("tt")},re=function(){return 0===te().indexOf("20")},ce=function(){var e=V(),t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(c){}var n=x.sync("*.eslintrc*",{cwd:B,dot:!0}),r=n[0];return!1===e.strict&&r&&d.existsSync(r)?r:d.existsSync(t)?t:r},oe=function(){var e=V(),t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(c){}var n=x.sync("*.stylelintrc*",{cwd:B,dot:!0}),r=n[0];return!1===e.strict&&r&&d.existsSync(r)?r:d.existsSync(t)?t:r},ie=function(){var e=g.join(B,".git/"),t=g.join(B,".git/hooks"),n=g.join(t,"pre-commit"),r=d.existsSync(e),c=d.existsSync(n),o=c&&d.readFileSync(n,q).includes(A);if(r&&(!c||!o)){k.sync(t),d.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",A].join(y.EOL),q);try{d.chmodSync(n,"777")}catch(i){R("chmod ".concat(n," failed: ").concat(i.message))}_("Create pre-commit hook")}},ae=function(){var e=V(),t=!1!==e.strict,n=e.eslintIgnore,c=e.stylelintIgnore;I().then((function(e){var o=function(n){return new Promise((function(o,i){var a=oe();if(a){var s=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}[n].test(e)})).filter((function(e){var t=g.join(B,e);return d.existsSync(t)})).filter((function(e){return T.every((function(t){return!w(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof c?!w(e,c,{matchBase:!0}):c instanceof RegExp?!c.test(e):!Array.isArray(c)||c.every((function(t){return"string"===typeof t?!w(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(s.length)if(s.forEach((function(e){if(e&&d.existsSync(e)){var t=g.extname(e).replace(/^\./,""),n=d.readFileSync(e,q),r=P(n,l({parser:D[t]},G()));d.writeFileSync(e,r,q)}})),_("".concat(n," - ").concat(s.length," files prettier success!")),s.length>=$){var m=[];v.chunk(s,$).forEach((function(e){m.push(new Promise((function(c,o){U({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(n),"--config",a].concat(r(e)),complete:c,close:o,exit:!1})})))}));var u=0,p=function e(){u<m.length?m[u].then((function(){u++,e()})).catch(i):(_("".concat(n," - ").concat(s.length," files stylelint success!")),o())};p()}else s.length&&U({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(n),"--config",a].concat(r(s)),complete:function(){_("".concat(n," - ").concat(s.length," files stylelint success!")),o()},close:i,exit:!1});else o()}else R("\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c".concat(n," files prettier fail!")),o()}))},i=function(c){return new Promise((function(o,i){var a=ce();if(a){var s=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}[c].test(e)})).filter((function(e){var t=g.join(B,e);return d.existsSync(t)})).filter((function(e){return T.every((function(t){return!w(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof n?!w(e,n,{matchBase:!0}):n instanceof RegExp?!n.test(e):!Array.isArray(n)||n.every((function(t){return"string"===typeof t?!w(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(s.length)if(s.forEach((function(e){if(e&&d.existsSync(e)){var t=g.extname(e).replace(/^\./,""),n=d.readFileSync(e,q),r=P(n,l({parser:D[t]},G()));d.writeFileSync(e,r,q)}})),_("".concat(c," - ").concat(s.length," files prettier success!")),s.length>=$){var m=[];v.chunk(s,$).forEach((function(e){m.push(new Promise((function(n,c){U({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",a].concat(r(e)),complete:n,close:c,exit:!1})})))}));var u=0,p=function e(){u<m.length?m[u].then((function(){u++,e()})).catch(i):(_("".concat(c," - ").concat(s.length," files eslint success!")),o())};p()}else s.length&&U({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",a].concat(r(s)),complete:function(){_("".concat(c," - ").concat(s.length," files eslint success!")),o()},close:i,exit:!1});else o()}else R("\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c".concat(c," files eslint fail!")),o()}))};Q("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(Q("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),c&&Q("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(c,"\u3002")),n&&Q("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(n,"\u3002"))),o("css").then((function(){return o("less")})).then((function(){return o("sass")})).then((function(){return o("scss")})).then((function(){return i("js")})).then((function(){return i("jsx")})).then((function(){return i("ts")})).then((function(){return i("tsx")})).then(C).catch(C)}))},se=function(e){var t=e.mProject,n=e.mPrivateKeyPath,r=e.mVersion,c=e.mDesc,o=e.mRobot,i=e.mQrcodeFormat,a=e.mQrcodeOutputDest,s=e.mPagePath,m=e.mSearchQuery,l=d.existsSync(g.join(B,".git"))?p("git log -1 --pretty=format:%H").toString():"",u=X(),f=u.appid,y=t||g.join(B,"dist"),h=n||g.join(B,"private.".concat(f,".key"));if(d.existsSync(y)){if(d.existsSync(h)){var v=Y(),j=r||v.version||u.version||"1.0.0",S=c||v.description||u.description,x="version: ".concat(j,";").concat(l?" commit: ".concat(l,";"):"").concat(S?" description: ".concat(S,";"):"");l&&K("commit: ".concat(l)),K("dist: ".concat(y)),K("key: ".concat(h)),K("appid: ".concat(f)),K("version: ".concat(j)),K("desc: ".concat(x));var w=new b.Project({appid:f,type:"miniProgram",projectPath:y,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:f,options:{project:w,version:j,desc:x,setting:u.setting,robot:o,qrcodeFormat:i,qrcodeOutputDest:a,pagePath:s,searchQuery:m}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(h,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(y,")"))},me=function(){ie(),process.argv.length>2?S.version(F.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((function(t,n){var r=e(n),c=r[0],o=r.slice(1),i=t.clone,a=t.template,s=t.docs;if(c)switch(K("yolk version: ".concat(F.version)),K("node version: ".concat(process.version)),K("platform: ".concat(y.platform())),K("memory: ".concat(v.floor(y.freemem()/1024/1024)," MB(").concat(v.floor(y.totalmem()/1024/1024)," MB)")),c){case"init":if(_("yolk ".concat(c," \u5f00\u59cb")),i)if(a){var m=".yolk",u=g.join(B,m);d.existsSync(u)&&E(u,(function(){_("\u7f13\u5b58\u5220\u9664 success! ".concat(u))})),U({command:"git",args:["clone","-b","master","--depth","1",a,m].concat(o)}),M(B,u)}else R("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else H(B);break;case"start":W()?ne()?U({command:"taro",args:["build","--type","tt","--watch"].concat(o)}):re()?U({command:"taro",args:["build","--type","alipay","--watch"].concat(o)}):U({command:"taro",args:["build","--type","weapp","--watch"].concat(o)}):s?U({command:"dumi",args:["dev"].concat(o)}):z()?U({command:"icejs",args:["start","--config",ee()].concat(o)}):Z()?U({command:"max",args:["dev"].concat(o)}):U({command:"umi",args:["dev"].concat(o)});break;case"build":W()?ne()?U({command:"taro",args:["build","--type","tt"].concat(o)}):re()?U({command:"taro",args:["build","--type","alipay"].concat(o)}):U({command:"taro",args:["build","--type","weapp"].concat(o)}):s?U({command:"dumi",args:["build"].concat(o)}):z()?U({command:"icejs",args:["build","--config",ee()].concat(o)}):Z()?U({command:"max",args:["setup"].concat(o),complete:function(){return U({command:"max",args:["build"].concat(o)})},exit:!1}):U({command:"umi",args:["build"].concat(o)});break;case"pre-commit":ae();break;case"test":U({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(o)});break;case"miniapp-upload":case"miniprogram-upload":if(W())if(ne());else if(re());else{var p=se(t),f=p.appid,h=p.options;K("".concat(f,"\u4e0a\u4f20\u5f00\u59cb")),b.upload(l(l({},v.pick(h,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(v.isString(e))K("task: ".concat(e));else{var t=e.status,n=e.message;K("task(".concat(t,"): ").concat(n))}}})).then((function(){_("".concat(f,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniapp-preview":case"miniprogram-preview":if(W())if(ne());else if(re());else{var j=se(t),S=j.appid,x=j.options;K("".concat(S,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),b.preview(l(l({},v.pick(x,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(v.isString(e))K("task: ".concat(e));else{var t=e.status,n=e.message;K("task(".concat(t,"): ").concat(n))}}})).then((function(){_("".concat(S,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:J()}})).parse(process.argv):J()};me();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"printWidth": 80,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"trailingComma": "all",
|
|
5
|
+
"proseWrap": "never",
|
|
6
|
+
"overrides": [{
|
|
7
|
+
"files": ".prettierrc",
|
|
8
|
+
"options": {
|
|
9
|
+
"parser": "json"
|
|
10
|
+
}
|
|
11
|
+
}],
|
|
12
|
+
// "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
|
|
13
|
+
}
|
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.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 o(){const t=e(require("lodash/pick"));return o=function(){return t},t}function i(){const t=e(require("lodash/floor"));return i=function(){return t},t}function s(){const t=e(require("lodash/chunk"));return s=function(){return t},t}function a(){const e=require("child_process");return a=function(){return e},e}function c(){const t=e(require("commander"));return c=function(){return t},t}function u(){const t=e(require("fs"));return u=function(){return t},t}function l(){const t=e(require("glob"));return l=function(){return t},t}function f(){const t=e(require("inquirer"));return f=function(){return t},t}function d(){const t=e(require("minimatch"));return d=function(){return t},t}function m(){const e=x(require("miniprogram-ci"));return m=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 h(){const t=e(require("os"));return h=function(){return t},t}function b(){const t=e(require("path"));return b=function(){return t},t}function j(){const e=require("prettier");return j=function(){return e},e}function S(){const t=e(require("rimraf"));return S=function(){return t},t}var k=e(require("../package.json"));function v(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function w(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?w(Object(r),!0).forEach((function(t){(0,n().default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(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()),T=e=>e&&I.succeed(Buffer.from(e,F).toString()),_=e=>e&&I.info(Buffer.from(e,F).toString()),L=e=>"win32"===process.platform?`${e}.cmd`:e,M=()=>{T("yolk complete!"),process.exit(0)},N=()=>{Q("yolk break!"),process.exit(0)},A=({command:e,args:t,complete:n,close:r,exit:o=!0})=>{const i=(0,a().spawn)(L(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(r&&r(),R("yolk close!"),process.exit(e)):(n&&n(),o&&M())}));process.on("SIGINT",(()=>{c().default.runningCommand&&c().default.runningCommand.kill("SIGKILL"),i.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:"mobile template(umi framework)",value:"umi-mobile"},{name:"web template(ice framework)",value:"ice-web"},{name:"mobile template(ice framework)",value:"ice-mobile"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:b().default.basename(b().default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:!1,choices:[{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"},{name:"\u4e0d\u521d\u59cb\u5316",value:!1}]}]).then((r=>{const o={projectName:r.projectName,mobile:"umi-mobile"===r.type,dependenciesInstallType:r.dependenciesInstallType,yolkVersion:k.default.version};t||(t=b().default.join(__dirname,`../templates/${r.type}`)),T(`\u590d\u5236\u6a21\u7248 ${b().default.basename(t)}`);const i=l().default.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((n=>{if(!t)return;const r=b().default.join(t,n);if(!u().default.statSync(r).isDirectory())if(n.endsWith(".tpl")){const t=u().default.readFileSync(r,F),i=b().default.join(e,n.replace(/\.tpl$/u,"")),s=y().default.render(t,o);p().default.sync(b().default.dirname(i)),T(`\u521b\u5efa ${b().default.relative(e,i)}`),u().default.writeFileSync(i,s,F)}else{T(`\u521b\u5efa ${n}`);const t=b().default.join(e,n);p().default.sync(b().default.dirname(t)),u().default.copyFileSync(r,t)}})),T("\u590d\u5236\u6a21\u7248 success!"),n&&u().default.existsSync(t)&&(0,S().default)(t,(()=>{T(`\u7f13\u5b58\u5220\u9664 success! ${b().default.basename(t||"")}`)})),r.dependenciesInstallType)switch(T("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),r.dependenciesInstallType){case"npm":A({command:"npm",args:["install"]});break;case"yarn":default:A({command:"yarn",args:["install"]});break}T("\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=l().default.sync("*.yolkrc*",{cwd:P,dot:!0});if(!e.length)return{};const t=b().default.join(P,e[0]);if(!u().default.existsSync(t))return{};try{return JSON.parse(u().default.readFileSync(t,F))||{}}catch(n){return R(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},J=()=>{const e=b().default.join(P,".prettierrc");if(u().default.existsSync(e))try{return JSON.parse(u().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"}}]}},U=()=>{const e=b().default.join(P,"project.config.json");if(!u().default.existsSync(e))return{};try{return JSON.parse(u().default.readFileSync(e,F))||{}}catch(t){return R(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>{const e=b().default.join(P,"package.json");if(!u().default.existsSync(e))return{};try{return JSON.parse(u().default.readFileSync(e,F))||{}}catch(t){return R(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},G=()=>u().default.existsSync(b().default.join(P,"project.config.json")),H=()=>u().default.existsSync(b().default.join(P,".icerc.ts"))||u().default.existsSync(b().default.join(P,".icerc.js"))||u().default.existsSync(b().default.join(P,".ice.ts"))||u().default.existsSync(b().default.join(P,".ice.js")),Y=()=>u().default.existsSync(require.resolve("@umijs/max")),z=()=>u().default.existsSync(b().default.join(P,".icerc.ts"))?".icerc.ts":u().default.existsSync(b().default.join(P,".icerc.js"))?".icerc.js":u().default.existsSync(b().default.join(P,".ice.ts"))?".ice.ts":".ice.js",X=()=>{const e=b().default.join(P,"project.config.json");if(u().default.existsSync(e)){const t=require(e);return t.appid}return""},Z=()=>u().default.existsSync(b().default.join(P,"project.tt.json"))&&0===X().indexOf("tt"),ee=()=>0===X().indexOf("20"),te=()=>{const e=W(),t=G()?require.resolve("@baic/eslint-config-yolk-miniprogram"):require.resolve("@baic/eslint-config-yolk"),n=l().default.sync("*.eslintrc*",{cwd:P,dot:!0}),r=n[0];return!1===e.strict&&r&&u().default.existsSync(r)?r:t},ne=()=>{const e=l().default.sync("*.stylelintrc*",{cwd:P,dot:!0}),t=e[0];return t},re=()=>{const e=b().default.join(P,".git/"),t=b().default.join(P,".git/hooks"),n=b().default.join(t,"pre-commit"),r=u().default.existsSync(e),o=u().default.existsSync(n),i=o&&u().default.readFileSync(n,"utf8").includes(q);if(r&&(!o||!i)){p().default.sync(t),u().default.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(h().default.EOL),"utf8");try{u().default.chmodSync(n,"777")}catch(s){R(`chmod ${n} failed: ${s.message}`)}T("Create pre-commit hook")}},oe=()=>{const e=W(),t=!1!==e.strict,n=e.eslintIgnore,r=e.stylelintIgnore;O().then((e=>{const o=new Promise(((n,o)=>{const i=ne();if(i){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=>!(0,d().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof r?!(0,d().default)(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((t=>"string"===typeof t?!(0,d().default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e))))).map((e=>{const t=b().default.join(P,e);return u().default.existsSync(t)?t:null})).filter((e=>!!e));if(a.forEach((e=>{if(e&&u().default.existsSync(e)){const t=b().default.extname(e).replace(/^\./u,""),n=u().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:E[t]},J()));u().default.writeFileSync(e,r,"utf8")}})),T("style prettier success!"),a.length>=D){const e=[];(0,s().default)(a,20).forEach((n=>{e.push(new Promise(((e,r)=>{A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",i,...n],complete:e,close:r,exit:!1})})))}));const r=process.getMaxListeners(),c=(0,s().default)(e,r?r/2:2);let u=0;const l=()=>{u<c.length?Promise.all(c[u]).then((()=>{u++,l()})).catch(o):n()};l()}else a.length&&A({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--config",i,...a],complete:n,close:o,exit:!1})}else n()})),i=()=>{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=b().default.join(P,e);return u().default.existsSync(t)?t:null})).filter((e=>!!e));if(r.length){r.forEach((e=>{if(e&&u().default.existsSync(e)){const t=b().default.extname(e).replace(/^\./u,""),n=u().default.readFileSync(e,"utf8"),r=(0,j().format)(n,$({parser:E[t]},J()));u().default.writeFileSync(e,r,"utf8")}})),T("script prettier success!");const e=te();if(e){const o=r.filter((e=>B.every((t=>!(0,d().default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof n?!(0,d().default)(e,n,{matchBase:!0}):n instanceof RegExp?!n.test(e):!Array.isArray(n)||n.every((t=>"string"===typeof t?!(0,d().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`)),o.length>=D){const n=[];(0,s().default)(o,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(),i=(0,s().default)(n,r?r/2:2);let a=0;const c=()=>{a<i.length?Promise.all(i[a]).then((()=>{a++,c()})):M()};c()}else o.length&&A({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",e,...o]})}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"),o.then(i)}))},ie=({mProject:e,mPrivateKeyPath:t,mVersion:n,mDesc:r,mRobot:o,mQrcodeFormat:i,mQrcodeOutputDest:s,mPagePath:c,mSearchQuery:l})=>{const f=u().default.existsSync(b().default.join(P,".git"))?(0,a().execSync)("git log -1 --pretty=format:%H").toString():"",d=U(),p=d.appid,y=e||b().default.join(P,"dist"),g=t||b().default.join(P,`private.${p}.key`);if(u().default.existsSync(y)){if(u().default.existsSync(g)){const e=V(),t=n||e.version||d.version||"1.0.0",a=r||e.description||d.description,u=`version: ${t};${f?` commit: ${f};`:""}${a?` description: ${a};`:""}`;f&&_(`commit: ${f}`),_(`dist: ${y}`),_(`key: ${g}`),_(`appid: ${p}`),_(`version: ${t}`),_(`desc: ${u}`);const h=new(m().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:h,version:t,desc:u,setting:d.setting,robot:o,qrcodeFormat:i,qrcodeOutputDest:s,pagePath:c,searchQuery:l}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${g})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${y})`)},se=()=>{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 s=(0,t().default)(n),a=s[0],c=s.slice(1),l=e.clone,f=e.template,d=e.docs;if(a)switch(_(`yolk version: ${k.default.version}`),_(`node version: ${process.version}`),_(`platform: ${h().default.platform()}`),_(`memory: ${(0,i().default)(h().default.freemem()/1024/1024)} MB(${(0,i().default)(h().default.totalmem()/1024/1024)} MB)`),a){case"init":if(T(`yolk ${a} \u5f00\u59cb`),l)if(f){const e=".yolk",t=b().default.join(P,e);u().default.existsSync(t)&&(0,S().default)(t,(()=>{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":G()?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)}):d?A({command:"dumi",args:["dev"].concat(c)}):H()?A({command:"icejs",args:["start","--config",z()].concat(c)}):Y()?A({command:"max",args:["dev"].concat(c)}):A({command:"umi",args:["dev"].concat(c)});break;case"build":G()?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)}):d?A({command:"dumi",args:["build"].concat(c)}):H()?A({command:"icejs",args:["build","--config",z()].concat(c)}):Y()?A({command:"max",args:["build"].concat(c)}):A({command:"umi",args:["build"].concat(c)});break;case"pre-commit":oe();break;case"test":A({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(c)});break;case"miniapp-upload":case"miniprogram-upload":if(G())if(Z());else if(ee());else{const t=ie(e),n=t.appid,i=t.options;_(`${n}\u4e0a\u4f20\u5f00\u59cb`),m().upload($($({},(0,o().default)(i,["project","version","desc","setting","robot"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))_(`task: ${e}`);else{const t=e.status,n=e.message;_(`task(${t}): ${n}`)}}})).then((()=>{T(`${n}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(G())if(Z());else if(ee());else{const t=ie(e),n=t.appid,i=t.options;_(`${n}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),m().preview($($({},(0,o().default)(i,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:e=>{if((0,r().default)(e))_(`task: ${e}`);else{const t=e.status,n=e.message;_(`task(${t}): ${n}`)}}})).then((()=>{T(`${n}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:N()}})).parse(process.argv):N()};se();
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,r=(e,i,r,o)=>{if(i&&"object"===typeof i||"function"===typeof i)for(let c of a(i))n.call(e,c)||c===r||t(e,c,{get:()=>i[c],enumerable:!(o=s(i,c))||o.enumerable});return e},o=(s,a,n)=>(n=null!=s?e(i(s)):{},r(!a&&s&&s.__esModule?n:t(n,"default",{value:s,enumerable:!0}),s)),c=require("child_process"),l=o(require("fs")),d=o(require("os")),u=o(require("path")),m=o(require("inquirer")),f=o(require("lodash")),p=o(require("miniprogram-ci")),y=o(require("ora")),g=o(require("../compiled/commander")),h=o(require("../compiled/glob")),b=o(require("../compiled/minimatch")),j=o(require("../compiled/mkdirp")),x=o(require("../compiled/mustache")),S=require("../compiled/prettier"),$=o(require("../compiled/rimraf")),v=o(require("../package.json")),k=require("../compiled/staged-git-files"),w=process.cwd(),q="##### CREATED BY YOLK #####",P={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},O="utf-8",F=20,B=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/.ice/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],E=(0,y.default)(),I=e=>e&&E.warn(Buffer.from(e,O).toString()),D=e=>e&&E.fail(Buffer.from(e,O).toString()),_=e=>e&&E.succeed(Buffer.from(e,O).toString()),N=e=>e&&E.info(Buffer.from(e,O).toString()),Q=e=>"win32"===process.platform?`${e}.cmd`:e,R=()=>{_("yolk complete!"),process.exit(0)},T=()=>{I("yolk break!"),process.exit(0)},K=({command:e,args:t,complete:s,close:a,exit:i=!0})=>{const n=(0,c.spawn)(Q(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(a&&a(),D("yolk close!"),process.exit(e)):(s&&s(),i&&R())}));process.on("SIGINT",(()=>{g.default.runningCommand&&g.default.runningCommand.kill("SIGKILL"),n.kill(),T()}))},L=(e,t,s)=>{m.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:u.default.basename(u.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 i={projectName:a.projectName,dependenciesInstallType:a.dependenciesInstallType,yolkVersion:v.default.version};t||(t=u.default.join(__dirname,`../templates/${a.type}`)),_(`\u590d\u5236\u6a21\u7248 ${u.default.basename(t)}`);const n=h.default.sync("**/*",{cwd:t,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(n.forEach((s=>{if(!t)return;const a=u.default.join(t,s);if(!l.default.statSync(a).isDirectory())if(s.endsWith(".tpl")){const t=l.default.readFileSync(a,O),n=u.default.join(e,s.replace(/\.tpl$/,"")),r=x.default.render(t,i);j.default.sync(u.default.dirname(n)),_(`\u521b\u5efa ${u.default.relative(e,n)}`),l.default.writeFileSync(n,r,O)}else{_(`\u521b\u5efa ${s}`);const t=u.default.join(e,s);j.default.sync(u.default.dirname(t)),l.default.copyFileSync(a,t)}})),_("\u590d\u5236\u6a21\u7248 success!"),s&&l.default.existsSync(t)&&(0,$.default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${u.default.basename(t||"")}`)})),a.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),a.dependenciesInstallType){case"default":case"pnpm":K({command:"pnpm",args:["install"]});break;case"yarn":K({command:"yarn",args:["install"]});break;case"npm":K({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},A=(e,t)=>L(e,t,!0),J=()=>{const e=h.default.sync("*.yolkrc*",{cwd:w,dot:!0});if(!e.length)return{};const t=u.default.join(w,e[0]);if(!l.default.existsSync(t))return{};try{return JSON.parse(l.default.readFileSync(t,O))||{}}catch(s){return D(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},C=()=>{const e=u.default.join(w,".prettierrc");if(l.default.existsSync(e))try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},H=()=>{const e=u.default.join(w,"project.config.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},U=()=>{const e=u.default.join(w,"package.json");if(!l.default.existsSync(e))return{};try{return JSON.parse(l.default.readFileSync(e,O))||{}}catch(t){return D(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>l.default.existsSync(u.default.join(w,"project.config.json")),V=()=>l.default.existsSync(u.default.join(w,".icerc.ts"))||l.default.existsSync(u.default.join(w,".icerc.js"))||l.default.existsSync(u.default.join(w,".ice.ts"))||l.default.existsSync(u.default.join(w,".ice.js")),G=()=>{let e=l.default.existsSync(u.default.join(w,"node_modules/.bin/max"));if(!e)try{e=l.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,c.execSync)("umi -v").toString())}catch(t){}if(!e){const s=u.default.join(w,"node_modules","umi","package.json");if(l.default.existsSync(s))try{const t=JSON.parse(l.default.readFileSync(s,O))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},X=()=>l.default.existsSync(u.default.join(w,".icerc.ts"))?".icerc.ts":l.default.existsSync(u.default.join(w,".icerc.js"))?".icerc.js":l.default.existsSync(u.default.join(w,".ice.ts"))?".ice.ts":".ice.js",Y=()=>{const e=u.default.join(w,"project.config.json");if(l.default.existsSync(e)){const t=require(e);return t.appid}return""},W=()=>l.default.existsSync(u.default.join(w,"project.tt.json"))&&0===Y().indexOf("tt"),z=()=>0===Y().indexOf("20"),Z=()=>{const e=J();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(i){}const s=h.default.sync("*.eslintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},ee=()=>{const e=J();let t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(i){}const s=h.default.sync("*.stylelintrc*",{cwd:w,dot:!0}),a=s[0];return!1===e.strict&&a&&l.default.existsSync(a)?a:l.default.existsSync(t)?t:a},te=()=>{const e=u.default.join(w,".git/"),t=u.default.join(w,".git/hooks"),s=u.default.join(t,"pre-commit"),a=l.default.existsSync(e),i=l.default.existsSync(s),n=i&&l.default.readFileSync(s,O).includes(q);if(a&&(!i||!n)){j.default.sync(t),l.default.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",q].join(d.default.EOL),O);try{l.default.chmodSync(s,"777")}catch(r){D(`chmod ${s} failed: ${r.message}`)}_("Create pre-commit hook")}},se=()=>{const e=J(),t=!1!==e.strict,s=e.eslintIgnore,a=e.stylelintIgnore;k().then((e=>{const i=s=>new Promise(((i,n)=>{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=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>B.every((t=>!(0,b.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof a?!(0,b.default)(e,a,{matchBase:!0}):a instanceof RegExp?!a.test(e):!Array.isArray(a)||a.every((t=>"string"===typeof t?!(0,b.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${s} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((a=>{e.push(new Promise(((e,i)=>{K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...a],complete:e,close:i,exit:!1})})))}));let a=0;const c=()=>{a<e.length?e[a].then((()=>{a++,c()})).catch(n):(_(`${s} - ${o.length} files stylelint success!`),i())};c()}else o.length&&K({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",r,...o],complete:()=>{_(`${s} - ${o.length} files stylelint success!`),i()},close:n,exit:!1});else i()}else D(`\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c${s} files prettier fail!`),i()})),n=a=>new Promise(((i,n)=>{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=u.default.join(w,e);return l.default.existsSync(t)})).filter((e=>B.every((t=>!(0,b.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!(0,b.default)(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!(0,b.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(o.length)if(o.forEach((e=>{if(e&&l.default.existsSync(e)){const t=u.default.extname(e).replace(/^\./,""),s=l.default.readFileSync(e,O),a=(0,S.format)(s,{parser:P[t],...C()});l.default.writeFileSync(e,a,O)}})),_(`${a} - ${o.length} files prettier success!`),o.length>=F){const e=[];f.default.chunk(o,F).forEach((s=>{e.push(new Promise(((e,a)=>{K({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(n):(_(`${a} - ${o.length} files eslint success!`),i())};c()}else o.length&&K({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",r,...o],complete:()=>{_(`${a} - ${o.length} files eslint success!`),i()},close:n,exit:!1});else i()}else D(`\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c${a} files eslint fail!`),i()}));I("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(I("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),a&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${a}\u3002`),s&&I(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${s}\u3002`)),i("css").then((()=>i("less"))).then((()=>i("sass"))).then((()=>i("scss"))).then((()=>n("js"))).then((()=>n("jsx"))).then((()=>n("ts"))).then((()=>n("tsx"))).then(R).catch(R)}))},ae=({mProject:e,mPrivateKeyPath:t,mVersion:s,mDesc:a,mRobot:i,mQrcodeFormat:n,mQrcodeOutputDest:r,mPagePath:o,mSearchQuery:d})=>{const m=l.default.existsSync(u.default.join(w,".git"))?(0,c.execSync)("git log -1 --pretty=format:%H").toString():"",f=H(),y=f.appid,g=e||u.default.join(w,"dist"),h=t||u.default.join(w,`private.${y}.key`);if(l.default.existsSync(g)){if(l.default.existsSync(h)){const e=U(),t=s||e.version||f.version||"1.0.0",c=a||e.description||f.description,l=`version: ${t};${m?` commit: ${m};`:""}${c?` description: ${c};`:""}`;m&&N(`commit: ${m}`),N(`dist: ${g}`),N(`key: ${h}`),N(`appid: ${y}`),N(`version: ${t}`),N(`desc: ${l}`);const u=new p.Project({appid:y,type:"miniProgram",projectPath:g,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:y,options:{project:u,version:t,desc:l,setting:f.setting,robot:i,qrcodeFormat:n,qrcodeOutputDest:r,pagePath:o,searchQuery:d}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${h})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${g})`)},ie=()=>{te(),process.argv.length>2?g.default.version(v.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,t)=>{const[s,...a]=t,{clone:i,template:n,docs:r}=e;if(s)switch(N(`yolk version: ${v.default.version}`),N(`node version: ${process.version}`),N(`platform: ${d.default.platform()}`),N(`memory: ${f.default.floor(d.default.freemem()/1024/1024)} MB(${f.default.floor(d.default.totalmem()/1024/1024)} MB)`),s){case"init":if(_(`yolk ${s} \u5f00\u59cb`),i)if(n){const e=".yolk",t=u.default.join(w,e);l.default.existsSync(t)&&(0,$.default)(t,(()=>{_(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),K({command:"git",args:["clone","-b","master","--depth","1",n,e].concat(a)}),A(w,t)}else D("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else L(w);break;case"start":M()?W()?K({command:"taro",args:["build","--type","tt","--watch"].concat(a)}):z()?K({command:"taro",args:["build","--type","alipay","--watch"].concat(a)}):K({command:"taro",args:["build","--type","weapp","--watch"].concat(a)}):r?K({command:"dumi",args:["dev"].concat(a)}):V()?K({command:"icejs",args:["start","--config",X()].concat(a)}):G()?K({command:"max",args:["dev"].concat(a)}):K({command:"umi",args:["dev"].concat(a)});break;case"build":M()?W()?K({command:"taro",args:["build","--type","tt"].concat(a)}):z()?K({command:"taro",args:["build","--type","alipay"].concat(a)}):K({command:"taro",args:["build","--type","weapp"].concat(a)}):r?K({command:"dumi",args:["build"].concat(a)}):V()?K({command:"icejs",args:["build","--config",X()].concat(a)}):G()?K({command:"max",args:["setup"].concat(a),complete:()=>K({command:"max",args:["build"].concat(a)}),exit:!1}):K({command:"umi",args:["build"].concat(a)});break;case"pre-commit":se();break;case"test":K({command:"umi-test",args:["--no-cache","--update-snapshot","--runInBand","--detectOpenHandles"].concat(a)});break;case"miniapp-upload":case"miniprogram-upload":if(M())if(W());else if(z());else{const{appid:t,options:s}=ae(e);N(`${t}\u4e0a\u4f20\u5f00\u59cb`),p.upload({...f.default.pick(s,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniapp-preview":case"miniprogram-preview":if(M())if(W());else if(z());else{const{appid:t,options:s}=ae(e);N(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),p.preview({...f.default.pick(s,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if(f.default.isString(e))N(`task: ${e}`);else{const{status:t,message:s}=e;N(`task(${t}): ${s}`)}}}).then((()=>{_(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:T()}})).parse(process.argv):T()};ie();
|
package/package.json
CHANGED
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baic/yolk-cli",
|
|
3
|
-
"version": "2.1.0-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"yolk": "lib/index.js"
|
|
3
|
+
"version": "2.1.0-github.0",
|
|
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
|
-
"@types/
|
|
23
|
-
"@types/
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"@types/inquirer": "~8.x",
|
|
29
|
+
"@types/lodash": "~4.x",
|
|
30
|
+
"inquirer": "~8.x",
|
|
31
|
+
"lodash": "~4.x",
|
|
32
|
+
"miniprogram-ci": "~1.8.x",
|
|
33
|
+
"ora": "5.4.1",
|
|
34
|
+
"v8-compile-cache": "~2.3.x"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/glob": "~8.x",
|
|
38
|
+
"@types/minimatch": "~5.1.x",
|
|
39
|
+
"@types/mkdirp": "~1.0.x",
|
|
40
|
+
"@types/mustache": "~4.2.x",
|
|
41
|
+
"@types/prettier": "~2.x",
|
|
42
|
+
"@types/rimraf": "~3.0.x",
|
|
43
|
+
"commander": "~6.x",
|
|
44
|
+
"glob": "~8.x",
|
|
45
|
+
"minimatch": "~5.1.x",
|
|
46
|
+
"mkdirp": "~1.0.x",
|
|
47
|
+
"mustache": "~4.2.x",
|
|
48
|
+
"prettier": "~2.x",
|
|
49
|
+
"rimraf": "~3.0.x",
|
|
50
|
+
"staged-git-files": "~1.3.x"
|
|
39
51
|
},
|
|
40
52
|
"publishConfig": {
|
|
41
53
|
"access": "public"
|
|
42
54
|
},
|
|
43
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "af7d1dfc9f8b1a13ef83bad4a03a7560f0c6e277"
|
|
44
56
|
}
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# dependencies
|
|
4
4
|
node_modules/
|
|
5
|
+
npm-debug.log*
|
|
6
|
+
npm-error.log*
|
|
7
|
+
package-lock.json
|
|
8
|
+
yarn.lock
|
|
9
|
+
yarn-debug.log*
|
|
10
|
+
yarn-error.log*
|
|
11
|
+
pnpm-lock.yaml
|
|
5
12
|
|
|
6
13
|
# production
|
|
7
14
|
build/
|
|
@@ -17,9 +24,9 @@ lib/
|
|
|
17
24
|
*.dia~
|
|
18
25
|
.ice
|
|
19
26
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
# ide
|
|
28
|
+
.vscode
|
|
29
|
+
|
|
23
30
|
*less.d.ts*
|
|
24
31
|
*scss.d.ts*
|
|
25
32
|
.eslintcache
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { defineConfig } from '@baic/yolk-ice
|
|
1
|
+
import { defineConfig } from '@baic/yolk-ice';
|
|
2
2
|
|
|
3
|
-
export default defineConfig({});
|
|
3
|
+
export default defineConfig({ hd: {} });
|