diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5066c4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,735 @@ +packages/lowcode-preset-plugin/node_modules/prop-types +packages/lowcode-preset-plugin/node_modules/react +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/package.json +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/README.md +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/bin/build-scripts.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/bin/build.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/bin/child-process-start.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/bin/start.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/bin/test.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/index.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/index.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/build.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/build.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/start.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/start.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/test.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/commands/test.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/core/Context.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/core/Context.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/types/index.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/types/index.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/checkNodeVersion.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/checkNodeVersion.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/getCliOptions.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/getCliOptions.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/hijackWebpack.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/hijackWebpack.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/log.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/log.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/prepareURLs.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/prepareURLs.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/webpackStats.d.ts +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/lib/utils/webpackStats.js +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/address +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/camelcase +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/commander +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/deepmerge +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/json5 +packages/lowcode-preset-plugin/node_modules/_@alib_build-scripts@0.1.32@@alib/build-scripts/node_modules/.bin/json5 +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/.fusion +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/index-noreset.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/LICENSE +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/affix/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/animate/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/avatar/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/badge/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/balloon/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/box/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/breadcrumb/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/button/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/calendar/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/calendar2/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/card/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/cascader/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/cascader-select/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/checkbox/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/collapse/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/config-provider/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/base/_accessibility.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/base/_normalize.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/base/_reset.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/base/_typography.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_color.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_corner.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_font.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_global.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_icon.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_line.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_motion.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_shadow.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/style/_size.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/utility/_form-element.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/utility/_mask.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/core2/utility/_popup.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/date-picker/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/date-picker2/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/dialog/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/divider/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/drawer/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/dropdown/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/field/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/form/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/grid/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/icon/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/input/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/list/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/loading/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/menu/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/menu-button/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/message/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/nav/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/notification/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/number-picker/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/overlay/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/pagination/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/paragraph/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/progress/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/radio/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/range/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/rating/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/responsive-grid/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/search/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/es/select/index.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/index-noreset.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/base/_accessibility.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/base/_normalize.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/base/_reset.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/base/_typography.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_color.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_corner.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_font.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_global.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_icon.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_line.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_motion.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_shadow.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/style/_size.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/utility/_form-element.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/utility/_mask.css +packages/lowcode-preset-plugin/node_modules/_@alifd_next@1.26.4@@alifd/next/lib/core2/utility/_popup.css +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/History.md +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/LICENSE.txt +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/package.json +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/README.md +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/lib/address.d.ts +packages/lowcode-preset-plugin/node_modules/_address@1.1.2@address/lib/address.js +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/History.md +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/LICENSE.txt +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/package.json +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/README.md +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/lib/address.d.ts +packages/lowcode-preset-plugin/node_modules/_address@1.2.1@address/lib/address.js +packages/lowcode-preset-plugin/node_modules/_ansi-styles@3.2.1@ansi-styles/index.js +packages/lowcode-preset-plugin/node_modules/_ansi-styles@3.2.1@ansi-styles/license +packages/lowcode-preset-plugin/node_modules/_ansi-styles@3.2.1@ansi-styles/package.json +packages/lowcode-preset-plugin/node_modules/_ansi-styles@3.2.1@ansi-styles/readme.md +packages/lowcode-preset-plugin/node_modules/_are-we-there-yet@1.1.7@are-we-there-yet/index.js +packages/lowcode-preset-plugin/node_modules/_are-we-there-yet@1.1.7@are-we-there-yet/LICENSE +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/index.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/LICENSE +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/package.json +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/README.md +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/compile.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/constants.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/expand.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/parse.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/stringify.js +packages/lowcode-preset-plugin/node_modules/_braces@3.0.2@braces/lib/utils.js +packages/lowcode-preset-plugin/node_modules/_camelcase@5.3.1@camelcase/index.d.ts +packages/lowcode-preset-plugin/node_modules/_camelcase@5.3.1@camelcase/index.js +packages/lowcode-preset-plugin/node_modules/_camelcase@5.3.1@camelcase/license +packages/lowcode-preset-plugin/node_modules/_camelcase@5.3.1@camelcase/package.json +packages/lowcode-preset-plugin/node_modules/_camelcase@5.3.1@camelcase/readme.md +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/index.js +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/index.js.flow +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/license +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/package.json +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/readme.md +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/templates.js +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/node_modules/escape-string-regexp +packages/lowcode-preset-plugin/node_modules/_chalk@2.4.2@chalk/types/index.d.ts +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/index.js +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/LICENSE +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/package.json +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/README.md +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/lib/constants.js +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/lib/fsevents-handler.js +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/lib/nodefs-handler.js +packages/lowcode-preset-plugin/node_modules/_chokidar@3.5.3@chokidar/types/index.d.ts +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/index.js +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/LICENSE +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/package.json +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/Readme.md +packages/lowcode-preset-plugin/node_modules/_commander@2.20.3@commander/typings/index.d.ts +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/LICENSE +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/package.json +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/README.md +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/src/browser.js +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/src/common.js +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/src/index.js +packages/lowcode-preset-plugin/node_modules/_debug@4.3.4@debug/src/node.js +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/changelog.md +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/index.d.ts +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/index.js +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/license.txt +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/package.json +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/readme.md +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/rollup.config.js +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/dist/cjs.js +packages/lowcode-preset-plugin/node_modules/_deepmerge@4.2.2@deepmerge/dist/umd.js +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/index.js +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/LICENSE +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/package.json +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/README.md +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/bin/detect-port.js +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/lib/detect-port.js +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/lib/wait-port.js +packages/lowcode-preset-plugin/node_modules/_detect-port@1.5.1@detect-port/node_modules/address +packages/lowcode-preset-plugin/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/index.js +packages/lowcode-preset-plugin/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/license +packages/lowcode-preset-plugin/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/package.json +packages/lowcode-preset-plugin/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/readme.md +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/LICENSE +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/package.json +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/README.md +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/copy/copy.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/copy/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/copy-sync/copy-sync.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/copy-sync/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/empty/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/file.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/link.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/symlink-paths.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/symlink-type.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/ensure/symlink.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/fs/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/json/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/json/jsonfile.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/json/output-json-sync.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/json/output-json.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/mkdirs/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/mkdirs/mkdirs-sync.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/mkdirs/mkdirs.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/mkdirs/win32.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/move/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/move/move.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/move-sync/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/move-sync/move-sync.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/output/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/path-exists/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/remove/index.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/remove/rimraf.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/util/buffer.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/util/stat.js +packages/lowcode-preset-plugin/node_modules/_fs-extra@8.1.0@fs-extra/lib/util/utimes.js +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/fsevents.d.ts +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/fsevents.js +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/fsevents.node +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/LICENSE +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/package.json +packages/lowcode-preset-plugin/node_modules/_fsevents@2.3.2@fsevents/README.md +packages/lowcode-preset-plugin/node_modules/_gauge@2.7.4@gauge/package.json +packages/lowcode-preset-plugin/node_modules/_gauge@2.7.4@gauge/README.md +packages/lowcode-preset-plugin/node_modules/_glob-parent@5.1.2@glob-parent/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_glob-parent@5.1.2@glob-parent/index.js +packages/lowcode-preset-plugin/node_modules/_glob-parent@5.1.2@glob-parent/LICENSE +packages/lowcode-preset-plugin/node_modules/_glob-parent@5.1.2@glob-parent/package.json +packages/lowcode-preset-plugin/node_modules/_glob-parent@5.1.2@glob-parent/README.md +packages/lowcode-preset-plugin/node_modules/_is-binary-path@2.1.0@is-binary-path/index.d.ts +packages/lowcode-preset-plugin/node_modules/_is-binary-path@2.1.0@is-binary-path/index.js +packages/lowcode-preset-plugin/node_modules/_is-binary-path@2.1.0@is-binary-path/license +packages/lowcode-preset-plugin/node_modules/_is-binary-path@2.1.0@is-binary-path/package.json +packages/lowcode-preset-plugin/node_modules/_is-binary-path@2.1.0@is-binary-path/readme.md +packages/lowcode-preset-plugin/node_modules/_is-glob@4.0.3@is-glob/index.js +packages/lowcode-preset-plugin/node_modules/_is-glob@4.0.3@is-glob/LICENSE +packages/lowcode-preset-plugin/node_modules/_is-glob@4.0.3@is-glob/package.json +packages/lowcode-preset-plugin/node_modules/_is-glob@4.0.3@is-glob/README.md +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/LICENSE +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/package.json +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/README.md +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/bin/jest.js +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/build/jest.d.ts +packages/lowcode-preset-plugin/node_modules/_jest@26.6.3@jest/build/jest.js +packages/lowcode-preset-plugin/node_modules/_js-tokens@4.0.0@js-tokens/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_js-tokens@4.0.0@js-tokens/index.js +packages/lowcode-preset-plugin/node_modules/_js-tokens@4.0.0@js-tokens/LICENSE +packages/lowcode-preset-plugin/node_modules/_js-tokens@4.0.0@js-tokens/package.json +packages/lowcode-preset-plugin/node_modules/_js-tokens@4.0.0@js-tokens/README.md +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/LICENSE.md +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/package.json +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/README.md +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/dist/index.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/dist/index.min.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/dist/index.min.mjs +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/dist/index.mjs +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/cli.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/index.d.ts +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/index.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/parse.d.ts +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/parse.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/register.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/require.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/stringify.d.ts +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/stringify.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/unicode.d.ts +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/unicode.js +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/util.d.ts +packages/lowcode-preset-plugin/node_modules/_json5@2.2.1@json5/lib/util.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_apply.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayAggregator.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayEach.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayEachRight.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayEvery.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayFilter.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayIncludes.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayIncludesWith.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayLikeKeys.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayMap.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayPush.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayReduce.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayReduceRight.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arraySample.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arraySampleSize.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arrayShuffle.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_arraySome.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_asciiSize.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_asciiToArray.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_asciiWords.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_assignMergeValue.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_assignValue.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_assocIndexOf.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseAggregator.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseAssign.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseAssignIn.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseAssignValue.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseAt.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseClamp.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseClone.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseConforms.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseConformsTo.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseCreate.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseDelay.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseDifference.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseEach.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseEachRight.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseEvery.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseExtremum.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFill.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFilter.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFindIndex.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFindKey.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFlatten.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFor.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseForOwn.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseForOwnRight.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseForRight.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseFunctions.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseGet.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseGetAllKeys.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseGetTag.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseGt.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseHas.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseHasIn.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIndexOf.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIndexOfWith.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseInRange.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIntersection.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseInverter.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseInvoke.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsArguments.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsArrayBuffer.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsDate.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsEqual.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsEqualDeep.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsMap.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsMatch.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsNaN.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsNative.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsRegExp.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsSet.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIsTypedArray.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseIteratee.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseKeys.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseKeysIn.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseLodash.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseLt.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMap.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMatches.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMatchesProperty.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMean.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMerge.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseMergeDeep.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseNth.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseOrderBy.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_basePick.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_basePickBy.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_baseProperty.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_basePropertyDeep.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/_basePropertyOf.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/LICENSE +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/fp/__.js +packages/lowcode-preset-plugin/node_modules/_lodash@4.17.21@lodash/fp/_baseConvert.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/cli.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/custom.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/index.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/LICENSE +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/loose-envify.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/package.json +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/README.md +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/replace.js +packages/lowcode-preset-plugin/node_modules/_loose-envify@1.4.0@loose-envify/node_modules/js-tokens +packages/lowcode-preset-plugin/node_modules/_ms@2.1.2@ms/index.js +packages/lowcode-preset-plugin/node_modules/_ms@2.1.2@ms/license.md +packages/lowcode-preset-plugin/node_modules/_ms@2.1.2@ms/package.json +packages/lowcode-preset-plugin/node_modules/_ms@2.1.2@ms/readme.md +packages/lowcode-preset-plugin/node_modules/_normalize-path@3.0.0@normalize-path/index.js +packages/lowcode-preset-plugin/node_modules/_normalize-path@3.0.0@normalize-path/LICENSE +packages/lowcode-preset-plugin/node_modules/_normalize-path@3.0.0@normalize-path/package.json +packages/lowcode-preset-plugin/node_modules/_normalize-path@3.0.0@normalize-path/README.md +packages/lowcode-preset-plugin/node_modules/_npmlog@4.1.2@npmlog/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_npmlog@4.1.2@npmlog/LICENSE +packages/lowcode-preset-plugin/node_modules/_npmlog@4.1.2@npmlog/log.js +packages/lowcode-preset-plugin/node_modules/_npmlog@4.1.2@npmlog/package.json +packages/lowcode-preset-plugin/node_modules/_npmlog@4.1.2@npmlog/README.md +packages/lowcode-preset-plugin/node_modules/_object-assign@4.1.1@object-assign/index.js +packages/lowcode-preset-plugin/node_modules/_object-assign@4.1.1@object-assign/license +packages/lowcode-preset-plugin/node_modules/_object-assign@4.1.1@object-assign/package.json +packages/lowcode-preset-plugin/node_modules/_object-assign@4.1.1@object-assign/readme.md +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/checkPropTypes.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/factory.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/factoryWithThrowingShims.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/factoryWithTypeCheckers.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/index.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/LICENSE +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/package.json +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/prop-types.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/prop-types.min.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/README.md +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/lib/has.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/lib/ReactPropTypesSecret.js +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/node_modules/loose-envify +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/node_modules/object-assign +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/node_modules/react-is +packages/lowcode-preset-plugin/node_modules/_prop-types@15.8.1@prop-types/node_modules/.bin/loose-envify +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/browsersHelper.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/chalk.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/checkRequiredFiles.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/clearConsole.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/crossSpawn.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/errorOverlayMiddleware.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/eslintFormatter.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/evalSourceMapMiddleware.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/FileSizeReporter.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/ForkTsCheckerWebpackPlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/formatWebpackMessages.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/getCacheIdentifier.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/getCSSModuleLocalIdent.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/getProcessForPort.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/globby.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/ignoredFiles.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/immer.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/InlineChunkHtmlPlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/inquirer.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/InterpolateHtmlPlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/launchEditor.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/launchEditorEndpoint.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/LICENSE +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/ModuleNotFoundPlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/ModuleScopePlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/noopServiceWorkerMiddleware.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/openBrowser.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/openChrome.applescript +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/package.json +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/printBuildError.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/printHostingInstructions.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/README.md +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/typescriptFormatter.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/WatchMissingNodeModulesPlugin.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/WebpackDevServerUtils.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/webpackHotDevClient.js +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/node_modules/chalk +packages/lowcode-preset-plugin/node_modules/_react-dev-utils@9.1.0@react-dev-utils/node_modules/escape-string-regexp +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/build-info.json +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/index.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/LICENSE +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/package.json +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/profiling.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/README.md +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/server.browser.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/server.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/server.node.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/test-utils.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/unstable-fizz.browser.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/unstable-fizz.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/unstable-fizz.node.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/unstable-native-dependencies.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-server.browser.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-server.browser.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-server.node.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-server.node.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-test-utils.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-test-utils.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-fizz.browser.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-fizz.browser.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-fizz.node.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-fizz.node.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-native-dependencies.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/cjs/react-dom.profiling.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-server.browser.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-server.browser.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-test-utils.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-test-utils.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-unstable-fizz.browser.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-unstable-fizz.browser.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-unstable-native-dependencies.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom-unstable-native-dependencies.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom.development.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-dom@16.14.0@react-dom/umd/react-dom.profiling.min.js +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/build-info.json +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/index.js +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/LICENSE +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/package.json +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/README.md +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/cjs/react-is.development.js +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/cjs/react-is.production.min.js +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/umd/react-is.development.js +packages/lowcode-preset-plugin/node_modules/_react-is@16.13.1@react-is/umd/react-is.production.min.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/build-info.json +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/index.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/jsx-dev-runtime.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/jsx-runtime.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/LICENSE +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/package.json +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/README.md +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react-jsx-dev-runtime.development.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react-jsx-dev-runtime.production.min.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react-jsx-runtime.development.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react-jsx-runtime.production.min.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react.development.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/cjs/react.production.min.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/node_modules/loose-envify +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/node_modules/object-assign +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/node_modules/prop-types +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/node_modules/.bin/loose-envify +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/umd/react.development.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/umd/react.production.min.js +packages/lowcode-preset-plugin/node_modules/_react@16.14.0@react/umd/react.profiling.min.js +packages/lowcode-preset-plugin/node_modules/_readdirp@3.6.0@readdirp/index.d.ts +packages/lowcode-preset-plugin/node_modules/_readdirp@3.6.0@readdirp/index.js +packages/lowcode-preset-plugin/node_modules/_readdirp@3.6.0@readdirp/LICENSE +packages/lowcode-preset-plugin/node_modules/_readdirp@3.6.0@readdirp/package.json +packages/lowcode-preset-plugin/node_modules/_readdirp@3.6.0@readdirp/README.md +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/index.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/LICENSE +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/package.json +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/preload.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/range.bnf +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/README.md +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/bin/semver.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/classes/comparator.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/classes/index.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/classes/range.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/classes/semver.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/clean.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/cmp.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/coerce.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/compare-build.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/compare-loose.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/compare.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/diff.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/eq.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/gt.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/gte.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/inc.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/lt.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/lte.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/major.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/minor.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/neq.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/parse.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/patch.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/prerelease.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/rcompare.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/rsort.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/satisfies.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/sort.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/functions/valid.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/internal/constants.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/internal/debug.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/internal/identifiers.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/internal/parse-options.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/internal/re.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/gtr.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/intersects.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/ltr.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/max-satisfying.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/min-satisfying.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/min-version.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/outside.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/simplify.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/subset.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/to-comparators.js +packages/lowcode-preset-plugin/node_modules/_semver@7.3.8@semver/ranges/valid.js +packages/lowcode-preset-plugin/node_modules/_set-blocking@2.0.0@set-blocking/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_set-blocking@2.0.0@set-blocking/index.js +packages/lowcode-preset-plugin/node_modules/_set-blocking@2.0.0@set-blocking/package.json +packages/lowcode-preset-plugin/node_modules/_set-blocking@2.0.0@set-blocking/README.md +packages/lowcode-preset-plugin/node_modules/_supports-color@5.5.0@supports-color/browser.js +packages/lowcode-preset-plugin/node_modules/_supports-color@5.5.0@supports-color/index.js +packages/lowcode-preset-plugin/node_modules/_supports-color@5.5.0@supports-color/license +packages/lowcode-preset-plugin/node_modules/_supports-color@5.5.0@supports-color/package.json +packages/lowcode-preset-plugin/node_modules/_supports-color@5.5.0@supports-color/readme.md +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/LICENSE +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/package.json +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/bin/cli-flags.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/bin/options.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/bin/webpack-dev-server.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/index.bundle.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/index.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/live.bundle.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/live.html +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/overlay.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/socket.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/sockjs.bundle.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/clients/BaseClient.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/clients/SockJSClient.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/clients/WebsocketClient.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/utils/createSocketUrl.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/utils/getCurrentScriptSource.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/utils/log.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/utils/reloadApp.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client/utils/sendMessage.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/options.json +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/Server.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/servers/BaseServer.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/servers/SockJSServer.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/servers/WebsocketServer.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/addEntries.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/colors.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/createCertificate.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/createConfig.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/createDomain.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/createLogger.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/defaultPort.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/defaultTo.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/findPort.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/getCertificate.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/getSocketClientPath.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/getSocketServerImplementation.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/getVersions.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/normalizeOptions.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/processOptions.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/routes.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/runBonjour.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/runOpen.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/setupExitSignals.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/status.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/tryParseInt.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/lib/utils/updateCompiler.js +packages/lowcode-preset-plugin/node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/ssl/.gitkeep +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/LICENSE +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/buildin/amd-define.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/buildin/amd-options.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/hot/dev-server.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/AbstractMethodError.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/AmdMainTemplatePlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/APIPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/AsyncDependenciesBlock.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/AsyncDependencyToInitialChunkError.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/AutomaticPrefetchPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/BannerPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/BasicEvaluatedExpression.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/buildChunkGraph.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/CachePlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/CaseSensitiveModulesWarning.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/Chunk.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ChunkGroup.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ChunkRenderError.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ChunkTemplate.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/CommentCompilationWarning.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/CommonJsStuffPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/compareLocations.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/CompatibilityPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/Compilation.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/Compiler.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ConcurrentCompilationError.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ConstPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ContextExclusionPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ContextModule.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ContextModuleFactory.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/ContextReplacementPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DefinePlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DelegatedModule.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DelegatedModuleFactoryPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DelegatedPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DependenciesBlock.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DependenciesBlockVariable.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/Dependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DllEntryPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DllModule.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DllModuleFactory.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/DllPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDDefineDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDDefineDependencyParserPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireArrayDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireContextDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireDependenciesBlock.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/AMDRequireItemDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/CommonJsPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/CommonJsRequireContextDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/CommonJsRequireDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ConstDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ContextDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ContextDependencyHelpers.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ContextDependencyTemplateAsId.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/ContextElementDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/CriticalDependencyWarning.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/DelegatedExportsDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/DelegatedSourceDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/DependencyReference.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/dependencies/DllEntryDependency.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/logging/createConsoleLogger.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/optimize/AggressiveMergingPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/optimize/AggressiveSplittingPlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/optimize/ChunkModuleIdRangePlugin.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/optimize/ConcatenatedModule.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/performance/AssetsOverSizeLimitWarning.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/util/cachedMerge.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/util/cleverMerge.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/util/createHash.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/lib/util/deterministicGrouping.js +packages/lowcode-preset-plugin/node_modules/_webpack@4.46.0@webpack/schemas/ajv.absolutePath.js +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/CHANGELOG.md +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/index.js +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/LICENSE.txt +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/package.json +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/README.md +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/lib/tokenize-arg-string.js +packages/lowcode-preset-plugin/node_modules/_yargs-parser@14.0.0@yargs-parser/node_modules/camelcase +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index ea28023..53f0b23 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ ## 使用文档 -https://www.yuque.com/lce/doc/ulvlkz \ No newline at end of file +https://lowcode-engine.cn/site/docs/guide/expand/editor/cli \ No newline at end of file diff --git a/packages/build-plugin-alt/CHANGELOG.md b/packages/build-plugin-alt/CHANGELOG.md index ec70f7d..672c3c8 100644 --- a/packages/build-plugin-alt/CHANGELOG.md +++ b/packages/build-plugin-alt/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## 1.3.4 + +- `fix` 修复注入模式某些情况下监听异常导致报错的问题 + +## 1.3.3 + +- `fix` 修复本地调试问题 + +## 1.3.2 + +- `fix` 修改默认打开浏览器地址,修复丢失 debug 参数问题 + +## 1.3.1 + +- `fix` 启动时报找不到 moment + +## 1.3.0 + +- `feat` 新增配置项 usePrivateIp,为 true 时 injectInfo 使用 private ip 而非 local ip。 +- `fix` babelPluginMeta 对 package 中一部分 meta 未定义的情况处理错误 + +## 1.2.2 + +- `fix` inject 接口监听 0.0.0.0,避免 localhost 和 127.0.0.1 没有匹配的情况 + +## 1.2.1 + +- `refactor` 删除无用 console +- `fix` inject 模式下,为配置 openUrl 的情况下,打开 lowcode-engine demo。 + +## 1.2.0 + +- `feat` 在 inject 模式下不使用 miniCssExtract + +## 1.1.0 + +- `feat` 支持配置 library + ## 1.0.9 - `fix` openUrl 配置在组件状态下不生效 diff --git a/packages/build-plugin-alt/README.md b/packages/build-plugin-alt/README.md index 9e692ca..38bf8ec 100644 --- a/packages/build-plugin-alt/README.md +++ b/packages/build-plugin-alt/README.md @@ -1,5 +1,3 @@ # 低代码引擎生态元素开发插件(build-scripts) -使用文档见:https://www.yuque.com/lce/doc/ulvlkz - - +使用文档见:https://lowcode-engine.cn/site/docs/guide/expand/editor/cli diff --git a/packages/build-plugin-alt/package.json b/packages/build-plugin-alt/package.json index 5ec457b..7572747 100644 --- a/packages/build-plugin-alt/package.json +++ b/packages/build-plugin-alt/package.json @@ -1,11 +1,16 @@ { "name": "@alilc/build-plugin-alt", - "version": "1.0.9", + "version": "1.3.4", "description": "build-scripts plugin template for developers", "main": "lib/index.js", "files": [ "lib" ], + "repository": { + "type": "git", + "url": "https://github.com/alibaba/lowcode-tools.git", + "directory": "packages/build-plugin-alt" + }, "scripts": { "start": "npm run copy && tsc -w", "build": "rm -rf lib && tsc && npm run copy", @@ -59,12 +64,15 @@ "build-scripts-config": "^3.0.3", "fs-extra": "^9.1.0", "html-webpack-plugin": "^4.0.0", + "ip": "^1.1.8", "is-wsl": "^2.2.0", "koa": "^2.13.4", "kolorist": "^1.5.0", "lodash": "^4.17.21", + "moment": "^2.29.4", "moment-locales-webpack-plugin": "^1.2.0", - "react-dev-utils": "^11.0.4" + "react-dev-utils": "^11.0.4", + "style-loader": "^2.0.0" }, "publishConfig": { "access": "public", diff --git a/packages/build-plugin-alt/src/babelPluginMeta.ts b/packages/build-plugin-alt/src/babelPluginMeta.ts index 1781d2a..7fde198 100644 --- a/packages/build-plugin-alt/src/babelPluginMeta.ts +++ b/packages/build-plugin-alt/src/babelPluginMeta.ts @@ -11,7 +11,7 @@ interface IMeta { interface IVisitorPass { opts?: { filename: string; - meta: IMeta; + meta?: IMeta; } filename?: string; } @@ -40,10 +40,10 @@ const injectMetaVisitor: Visitor = { (BabelTypes.isStringLiteral(property) && property.value === 'pluginName') ) { const meta = pass.meta; - if (meta.pluginName) { + pass.cache.pluginNameAssignmentExists = true; + if (meta?.pluginName) { path.node.right = BabelTypes.stringLiteral(meta.pluginName); addInfoComment(path.node); - pass.cache.pluginNameAssignmentExists = true; } } if ( @@ -51,11 +51,11 @@ const injectMetaVisitor: Visitor = { (BabelTypes.isStringLiteral(property) && property.value === 'meta') ) { const meta = pass.meta; - if (meta.meta) { + pass.cache.metaAssignmentExists = true; + if (meta?.meta) { const generateAst = template(`const a = ${JSON.stringify(meta.meta)}`)() as BabelTypes.VariableDeclaration; path.node.right = generateAst.declarations[0].init; addInfoComment(path.node); - pass.cache.metaAssignmentExists = true; } } } @@ -78,13 +78,13 @@ export default function (babel: { types: typeof BabelTypes }): { if (t.isIdentifier(path.node.declaration)) { const declarationName = path.node.declaration.name; path.parentPath.traverse(injectMetaVisitor, { ...state.opts, declarationName, cache }) - if (!cache.pluginNameAssignmentExists) { - const generatedNode = template(`${declarationName}.pluginName = "${state.opts.meta.pluginName}"`)(); + if (!cache.pluginNameAssignmentExists && state.opts?.meta?.pluginName) { + const generatedNode = template(`${declarationName}.pluginName = "${state.opts?.meta?.pluginName}"`)(); addInfoComment(generatedNode); path.insertBefore(generatedNode); } - if (!cache.metaAssignmentExists) { - const generatedNode = template(`${declarationName}.meta = ${JSON.stringify(state.opts.meta.meta)}`)(); + if (!cache.metaAssignmentExists && state.opts?.meta?.meta) { + const generatedNode = template(`${declarationName}.meta = ${JSON.stringify(state.opts?.meta?.meta)}`)(); addInfoComment(generatedNode); path.insertBefore(generatedNode); } diff --git a/packages/build-plugin-alt/src/baseConfig.ts b/packages/build-plugin-alt/src/baseConfig.ts index 7bc9810..49dc5ba 100644 --- a/packages/build-plugin-alt/src/baseConfig.ts +++ b/packages/build-plugin-alt/src/baseConfig.ts @@ -54,6 +54,8 @@ export default (config: WebpackChain, { rootDir, entry, type, pkg, mainFile, gen "@alilc/lowcode-designer": "var window.AliLowCodeEngine.common.designerCabin", }); + + // see https://github.com/webpack/webpack/releases/tag/v4.0.0 for details config.module.rule('mjs2js') .test(/\.mjs$/) .include diff --git a/packages/build-plugin-alt/src/entry/setter.ts b/packages/build-plugin-alt/src/entry/setter.ts index 4a1330b..d3faa5d 100644 --- a/packages/build-plugin-alt/src/entry/setter.ts +++ b/packages/build-plugin-alt/src/entry/setter.ts @@ -12,12 +12,5 @@ import './universal/global.scss'; init(document.getElementById('lce-container'), { enableCondition: true, enableCanvasLock: true, - disableDefaultSettingPanel: false, - disableDefaultSetters: false, - stayOnTheSameSettingTab: false, - simulatorUrl: [ - 'https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@^1.0.0/dist/js/react-simulator-renderer.js', - 'https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@^1.0.0/dist/css/react-simulator-renderer.css' - ], }); })() \ No newline at end of file diff --git a/packages/build-plugin-alt/src/entry/universal/plugin.tsx b/packages/build-plugin-alt/src/entry/universal/plugin.tsx index d8519b2..9a67507 100644 --- a/packages/build-plugin-alt/src/entry/universal/plugin.tsx +++ b/packages/build-plugin-alt/src/entry/universal/plugin.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; import { - ILowCodePluginContext, plugins, skeleton, } from '@alilc/lowcode-engine'; +import { IPublicModelPluginContext } from '@alilc/lowcode-types'; import Logo from '../../builtIn/logo'; import UndoRedo from '@alilc/lowcode-plugin-undo-redo'; import ComponentsPane from '@alilc/lowcode-plugin-components-pane'; @@ -13,24 +13,21 @@ import CodeEditor from "@alilc/lowcode-plugin-code-editor"; import { getPageSchema, saveSchema, resetSchema, preview } from './utils'; import assets from '../../public/assets.json'; - +; export default async ({ type, demoPlugin = undefined }) => { const registerPlugin = async (plugin) => { - if (!demoPlugin) { - return plugin; - } - if (plugin.pluginName !== demoPlugin.pluginName) { - await plugins.register(plugin); + // 避免要调试的插件被二次注册 + if (demoPlugin?.pluginName && plugin.pluginName === demoPlugin?.pluginName) { + return; } + await plugins.register(plugin); } - // plugin API 见 https://yuque.antfin.com/ali-lowcode/docs/cdukce - (SchemaPlugin as any).pluginName = 'SchemaPlugin'; + // plugin API 见 https://lowcode-engine.cn/site/docs/api/plugins await registerPlugin(SchemaPlugin); - (CodeEditor as any).pluginName = 'CodeEditor'; await registerPlugin(CodeEditor); - const editorInit = (ctx: ILowCodePluginContext) => { + const editorInit = (ctx: IPublicModelPluginContext) => { return { name: 'editor-init', @@ -99,7 +96,7 @@ export default async ({ type, demoPlugin = undefined }) => { // 设置物料描述 const { material, project } = ctx; - material.setAssets(assets); + material.setAssets(assets as any); const schema = await getPageSchema(type); @@ -112,7 +109,7 @@ export default async ({ type, demoPlugin = undefined }) => { await registerPlugin(editorInit); - const builtinPluginRegistry = (ctx: ILowCodePluginContext) => { + const builtinPluginRegistry = (ctx: IPublicModelPluginContext) => { return { name: 'builtin-plugin-registry', async init() { @@ -153,104 +150,47 @@ export default async ({ type, demoPlugin = undefined }) => { await registerPlugin(builtinPluginRegistry); - // 将新版本setter覆盖内置引擎setter (新版本部分setter处于内测状态,如果有问题可以将该插件注册移除,或者联系@度城) - const setterRegistry = (ctx: ILowCodePluginContext) => { - const { setterMap, pluginMap } = window.AliLowCodeEngineExt; - return { - name: 'ext-setters-registry', - async init() { - // 注册setterMap - window.AliLowCodeEngine.setters.registerSetter(setterMap); - // 注册插件 - // 注册事件绑定面板 - window.AliLowCodeEngine.skeleton.add({ - area: 'centerArea', - type: 'Widget', - content: pluginMap.EventBindDialog, - name: 'eventBindDialog', - props: {}, - }); - - // 注册变量绑定面板 - skeleton.add({ - area: 'centerArea', - type: 'Widget', - content: pluginMap.VariableBindDialog, - name: 'variableBindDialog', - props: {}, - }); - } - } - } - setterRegistry.pluginName = 'setterRegistry'; - await registerPlugin(setterRegistry); - // 注册回退/前进 await registerPlugin(UndoRedo); // 注册中英文切换 await registerPlugin(ZhEn); - // 注册保存面板 - const saveSample = (ctx: ILowCodePluginContext) => { - return { - name: 'saveSample', - async init() { - ctx.skeleton.add({ - name: 'saveSample', - area: 'topArea', - type: 'Widget', - props: { - align: 'right', - }, - content: - }); - // ctx.skeleton.add({ - // name: 'resetSchema', - // area: 'topArea', - // type: 'Widget', - // props: { - // align: 'right', - // }, - // content: - // }); - ctx.hotkey.bind('command+s', (e) => { - e.preventDefault(); - saveSchema(); - }); - }, - }; - } - saveSample.pluginName = 'saveSample'; - await registerPlugin(saveSample); - - const previewSample = (ctx: ILowCodePluginContext) => { - return { - name: 'previewSample', - async init() { - ctx.skeleton.add({ - name: 'previewSample', - area: 'topArea', - type: 'Widget', - props: { - align: 'right', - }, - content: , - }); - }, - }; - } - - previewSample.pluginName = 'previewSample'; - - await registerPlugin(previewSample); + // 注册保存面板 + const saveSample = (ctx: IPublicModelPluginContext) => { + return { + name: 'saveSample', + async init() { + ctx.skeleton.add({ + name: 'saveSample', + area: 'topArea', + type: 'Widget', + props: { + align: 'right', + }, + content: + }); + ctx.skeleton.add({ + name: 'resetSchema', + area: 'topArea', + type: 'Widget', + props: { + align: 'right', + }, + content: + }); + ctx.hotkey.bind('command+s', (e) => { + e.preventDefault(); + saveSchema(); + }); + }, + }; + } + saveSample.pluginName = 'saveSample'; + await registerPlugin(saveSample); } - diff --git a/packages/build-plugin-alt/src/index.ts b/packages/build-plugin-alt/src/index.ts index 35bee12..27627e6 100644 --- a/packages/build-plugin-alt/src/index.ts +++ b/packages/build-plugin-alt/src/index.ts @@ -11,16 +11,20 @@ import builtinConfig from './builtinConfig'; import injectConfig from './inject/config'; import makeInjectInfo from './inject/makeInjectInfo'; import injectApis from './inject/apis'; +import dropMinicss from './utils/dropMinicss'; +import { getIp } from './utils/getIp'; interface IOpitons { type: 'setter' | 'plugin' | 'component'; inject: boolean; openUrl: string; generateMeta: boolean; + library: string; + usePrivateIp: boolean; } const plugin: IPlugin = ({ context, registerTask, onGetWebpackConfig, onHook, log }, options) => { - const { type, inject, openUrl, generateMeta = true } = options as unknown as IOpitons; + const { type, inject, openUrl, generateMeta = true, library, usePrivateIp } = options as unknown as IOpitons; const { command, rootDir, userConfig, pkg } = context; const mainFilePrefix = path.join(rootDir, 'src', (pkg.main as string).replace(/lib\/(.*).js/, "$1")); let mainFile = `${mainFilePrefix}.tsx`; @@ -46,6 +50,7 @@ const plugin: IPlugin = ({ context, registerTask, onGetWebpackConfig, onHook, lo }); devConfig(config, { pkg }); if (inject) { + dropMinicss(config); injectConfig(config, { rootDir, pkg, type }) } }); @@ -67,22 +72,33 @@ const plugin: IPlugin = ({ context, registerTask, onGetWebpackConfig, onHook, lo builtinConfig(config); }); } - + } else { - onGetWebpackConfig('lowcode-dev', (config) => { - // console.log(config.toConfig()); - }) + // onGetWebpackConfig('lowcode-dev', (config) => { + // console.log(config.toConfig()); + // }) } + onHook('after.start.devServer', ({ url }) => { - if (inject && openUrl) { - openBrowser(openUrl); + if (inject) { + if (openUrl) { + openBrowser(openUrl); + } else { + openBrowser('https://lowcode-engine.cn/demo/demo-general/index.html?debug'); + } } else { openBrowser(openUrl || url); } }) + onHook('before.start.load', ({ args }) => { if (inject) { - makeInjectInfo({ pkg, port: args.port, type }); + let host = '127.0.0.1'; + if (usePrivateIp) { + host = getIp(); + } + console.log(host); + makeInjectInfo({ pkg, host, port: args.port, type, library }); injectApis(); } }); diff --git a/packages/build-plugin-alt/src/inject/apis.ts b/packages/build-plugin-alt/src/inject/apis.ts index 940747b..ec2c0c0 100644 --- a/packages/build-plugin-alt/src/inject/apis.ts +++ b/packages/build-plugin-alt/src/inject/apis.ts @@ -26,8 +26,8 @@ function makeJsonpStr(cbName, data) { return `;${cbName}(${JSON.stringify(data)})` } -async function portIsOccupied(_port) { - const server = net.createServer().listen(_port); +async function portIsOccupied(_port, _host) { + const server = net.createServer().listen(_port, _host); // eslint-disable-next-line no-shadow return new Promise((resolve) => { server.on('listening', () => { @@ -43,12 +43,13 @@ async function portIsOccupied(_port) { } const PORT = 8899; +const HOST = '0.0.0.0'; const init = async () => { - if (await portIsOccupied(PORT)) { + if (await portIsOccupied(PORT, HOST)) { const timer = setInterval(async () => { - const isOccupied = await portIsOccupied(PORT); + const isOccupied = await portIsOccupied(PORT, HOST); if (!isOccupied) { logger.info('Original inject server is down, start another') clearInterval(timer); @@ -91,7 +92,7 @@ const init = async () => { app .use(router.routes()) .use(router.allowedMethods()) - .listen(PORT, () => { + .listen(PORT, HOST, () => { logger.info('Inject server started', { needBreak: true }); }); }; diff --git a/packages/build-plugin-alt/src/inject/config.ts b/packages/build-plugin-alt/src/inject/config.ts index 860fb8a..358f56d 100644 --- a/packages/build-plugin-alt/src/inject/config.ts +++ b/packages/build-plugin-alt/src/inject/config.ts @@ -15,7 +15,7 @@ export default (config: WebpackChain, { pkg, type }: IOptions) => { }); config.output.library('__injectComponent'); config.output.libraryTarget('jsonp'); - config.devServer.host('127.0.0.1'); + config.devServer.host('0.0.0.0'); config.plugin('define').tap((args) => { return [{ ...args[0], @@ -24,4 +24,4 @@ export default (config: WebpackChain, { pkg, type }: IOptions) => { name: JSON.stringify(pkg.name), }] }); -} \ No newline at end of file +} diff --git a/packages/build-plugin-alt/src/inject/makeInjectInfo.ts b/packages/build-plugin-alt/src/inject/makeInjectInfo.ts index 40bbe59..e9b8ab4 100644 --- a/packages/build-plugin-alt/src/inject/makeInjectInfo.ts +++ b/packages/build-plugin-alt/src/inject/makeInjectInfo.ts @@ -1,7 +1,7 @@ import * as fs from 'fs-extra'; import { getFilePath } from './utils'; -export default ({ pkg, port, type }) => { +export default ({ pkg, host, port, type, library}) => { const cacheFilePath = getFilePath(); fs.ensureFileSync(cacheFilePath); let cache = {}; @@ -12,21 +12,24 @@ export default ({ pkg, port, type }) => { cache[`${port}-utils`] = { packageName: pkg.name, type: type === 'plugin' ? 'designerPlugin' : 'setter', + library, subType: '', - url: `http://127.0.0.1:${port}/js/utils.js?name=${pkg.name}`, + url: `http://${host}:${port}/js/utils.js?name=${pkg.name}`, }; } else { cache[`${port}-view`] = { packageName: pkg.name, + library, type: 'view', - url: `http://127.0.0.1:${port}/view.js?name=${pkg.name}`, + url: `http://${host}:${port}/view.js?name=${pkg.name}`, }; cache[`${port}-meta`] = { packageName: pkg.name, + library, type: 'meta', - url: `http://127.0.0.1:${port}/meta.js?name=${pkg.name}`, + url: `http://${host}:${port}/meta.js?name=${pkg.name}`, } } fs.writeFileSync(cacheFilePath, JSON.stringify(cache, null, ' ')); -} \ No newline at end of file +} diff --git a/packages/build-plugin-alt/src/public/assets.json b/packages/build-plugin-alt/src/public/assets.json index 388e5a4..ab8e7b3 100644 --- a/packages/build-plugin-alt/src/public/assets.json +++ b/packages/build-plugin-alt/src/public/assets.json @@ -26,116 +26,14 @@ "https://g.alicdn.com/code/lib/alifd__next/1.24.18/next-with-locales.min.js" ], "library": "Next" - }, - { - "title": "NextTable", - "package": "NextTable", - "version": "1.0.1", - "urls": [ - "https://g.alicdn.com/fusion-platform/pro-table/1.0.1/next-table.js", - "https://g.alicdn.com/fusion-platform/pro-table/1.0.1/next-table.css" - ], - "library": "NextTable" - }, - { - "package": "@alilc/lowcode-materials", - "version": "latest", - "library": "AlilcLowcodeMaterials", - "urls": [ - "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/dist/AlilcLowcodeMaterials.js", - "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/dist/AlilcLowcodeMaterials.css" - ], - "editUrls": [ - "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/build/lowcode/view.js", - "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/build/lowcode/view.css" - ] - }, - { - "package": "@alifd/pro-layout", - "version": "1.0.1-beta.1", - "library": "AlifdProLayout", - "urls": [ - "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/dist/AlifdProLayout.js", - "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/dist/AlifdProLayout.css" - ], - "editUrls": [ - "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/build/lowcode/view.js", - "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/build/lowcode/view.css" - ] - }, - { - "package": "@alifd/fusion-ui", - "version": "1.0.1", - "library": "AlifdFusionUi", - "urls": [ - "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/dist/AlifdFusionUi.js", - "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/dist/AlifdFusionUi.css" - ], - "editUrls": [ - "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/build/lowcode/view.js", - "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/build/lowcode/view.css" - ] } ], "components": [ - { - "exportName": "AlilcLowcodeMaterialsMeta", - "npm": { - "package": "@alilc/lowcode-materials" - }, - "url": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/build/lowcode/meta.js", - "urls": { - "default": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/build/lowcode/meta.js", - "design": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials/build/lowcode/meta.design.js" - } - }, - { - "exportName": "AlifdProLayoutMeta", - "npm": { - "package": "@alifd/pro-layout", - "version": "1.0.1-beta.1" - }, - "url": "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/build/lowcode/meta.js", - "urls": { - "default": "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/build/lowcode/meta.js", - "design": "https://alifd.alicdn.com/npm/@alifd/pro-layout@1.0.1-beta.1/build/lowcode/meta.design.js" - } - }, - { - "exportName": "AlifdFusionUiMeta", - "npm": { - "package": "@alifd/fusion-ui" - }, - "url": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/build/lowcode/meta.js", - "urls": { - "default": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/build/lowcode/meta.js", - "design": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@1.0.2/build/lowcode/meta.design.js" - } - } ], "sort": { - "groupList": [ - "精选组件", - "原子组件" - ], - "categoryList": [ - "基础元素", - "布局容器类", - "表格类", - "表单详情类", - "帮助类", - "对话框类", - "业务类", - "通用", - "引导", - "信息输入", - "信息展示", - "信息反馈" - ] + }, "groupList": [ - "精选组件", - "原子组件" ], "ignoreComponents": {} } \ No newline at end of file diff --git a/packages/build-plugin-alt/src/public/index.html b/packages/build-plugin-alt/src/public/index.html index 82df882..ac6da38 100644 --- a/packages/build-plugin-alt/src/public/index.html +++ b/packages/build-plugin-alt/src/public/index.html @@ -12,9 +12,9 @@ - + - + @@ -30,9 +30,9 @@ - + - + diff --git a/packages/build-plugin-alt/src/public/schema.json b/packages/build-plugin-alt/src/public/schema.json index 575db79..c0614eb 100644 --- a/packages/build-plugin-alt/src/public/schema.json +++ b/packages/build-plugin-alt/src/public/schema.json @@ -12,32 +12,14 @@ "list": [] }, "state": { - "text": "outer", - "isShowDialog": false }, "css": "body {font-size: 12px;} .button{width:100px;color:#ff00ff}", "lifeCycles": { - "componentDidMount": { - "type": "JSFunction", - "value": "function() {\n console.log('did mount');\n }" - }, - "componentWillUnmount": { - "type": "JSFunction", - "value": "function() {\n console.log('will unmount');\n }" - } }, "methods": { "testFunc": { "type": "JSFunction", "value": "function() {\n console.log('test func');\n }" - }, - "onClick": { - "type": "JSFunction", - "value": "function() {\n this.setState({\n isShowDialog: true\n })\n }" - }, - "closeDialog": { - "type": "JSFunction", - "value": "function() {\n this.setState({\n isShowDialog: false\n })\n }" } }, "children": [ diff --git a/packages/build-plugin-alt/src/utils/dropMinicss.ts b/packages/build-plugin-alt/src/utils/dropMinicss.ts new file mode 100644 index 0000000..1d6ccc2 --- /dev/null +++ b/packages/build-plugin-alt/src/utils/dropMinicss.ts @@ -0,0 +1,19 @@ +import Config from "webpack-chain" + +/** + * 去除 minicss 的逻辑 + * @param {*} config + */ +export default (config: Config) => { + config.plugins.delete('MiniCssExtractPlugin'); + ['scss', 'css', 'less'].forEach((ruleName) => { + ['', '-module'].forEach((suffix) => { + const finalRuleName = `${ruleName}${suffix}`; + config.module.rule(finalRuleName).uses.delete('MiniCssExtractPlugin.loader'); + config.module.rule(finalRuleName) + .use('style-loader') + .before('css-loader') + .loader(require.resolve('style-loader')); + }); + }); +} \ No newline at end of file diff --git a/packages/build-plugin-alt/src/utils/getIp.ts b/packages/build-plugin-alt/src/utils/getIp.ts new file mode 100644 index 0000000..2c5e901 --- /dev/null +++ b/packages/build-plugin-alt/src/utils/getIp.ts @@ -0,0 +1,7 @@ +import * as ip from 'ip'; + +const getIp = () => { + return ip.address('private'); +} + +export { getIp }; \ No newline at end of file diff --git a/packages/build-plugin-lce/CHANGELOG.md b/packages/build-plugin-lce/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/build-plugin-lce/README.md b/packages/build-plugin-lce/README.md new file mode 100644 index 0000000..3bd2934 --- /dev/null +++ b/packages/build-plugin-lce/README.md @@ -0,0 +1 @@ +this is a build-scripts plugin for LowCodeEngine development only. \ No newline at end of file diff --git a/packages/build-plugin-lce/package.json b/packages/build-plugin-lce/package.json new file mode 100644 index 0000000..5a7aa92 --- /dev/null +++ b/packages/build-plugin-lce/package.json @@ -0,0 +1,80 @@ +{ + "name": "@alilc/build-plugin-lce", + "version": "0.0.5", + "description": "build plugin for LowCodeEngine", + "main": "src/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "engines": { + "node": ">=12" + }, + "keywords": [ + "plugin" + ], + "author": "", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.1.2", + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.3", + "@babel/plugin-proposal-class-properties": "^7.16.0", + "@babel/plugin-proposal-private-methods": "^7.16.0", + "@babel/plugin-proposal-private-property-in-object": "^7.16.0", + "@babel/plugin-transform-runtime": "^7.6.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", + "babel-plugin-import": "^1.12.2", + "babel-plugin-module-resolver": "^4.0.0", + "babel-plugin-transform-define": "^2.0.0", + "build-scripts-config": "^3.0.0", + "camelcase": "^6.2.0", + "case-sensitive-paths-webpack-plugin": "^2.3.0", + "chalk": "^4.1.0", + "chokidar": "^3.3.1", + "console-clear": "^1.1.1", + "core-js": "^3.6.4", + "error-stack-tracey": "^0.1.3", + "fs-extra": "^8.1.0", + "handlebars": "^4.5.3", + "handlebars-loader": "^1.7.1", + "html-webpack-plugin": "^4.5.0", + "ice-npm-utils": "^3.0.0", + "image-source-loader": "^0.6.5", + "ip": "^1.1.5", + "js-yaml": "^4.0.0", + "json-loader": "^0.5.7", + "jsx2mp-runtime": "^0.4.15", + "loader-utils": "^1.4.0", + "marked": "^2.0.0", + "miniapp-builder-shared": "^0.2.10", + "miniapp-compile-config": "^0.2.5", + "optimize-css-assets-webpack-plugin": "^5.0.4", + "postcss-plugin-rpx2vw": "^0.0.2", + "postcss-preset-env": "^6.7.0", + "prismjs": "^1.17.1", + "qrcode-terminal": "^0.12.0", + "react-dev-utils": "^10.0.0", + "react-docgen": "^5.4.0", + "react-docgen-typescript": "^2.2.2", + "sass-loader": "^10.0.5", + "style-loader": "^1.2.1", + "template-component-demo": "^2.0.0", + "terser-webpack-plugin": "^4.1.0", + "time-fix-plugin": "^2.0.7", + "typescript": "^4.0.0", + "url-join": "^4.0.1", + "user-home": "^2.0.0", + "rax-babel-config": "^2.0.4", + "utils": "^0.3.1", + "webpack": "^4.41.1", + "webpack-chain": "^6.5.1", + "webpack-dev-server": "^3.11.2", + "webpack-node-externals": "^2.5.2", + "webpackbar": "^5.0.0-3" + }, + "devDependencies": { + "@types/node": "^12.12.18" + }, + "repository": "https://github.com/alibaba/lowcode-tools.git" +} \ No newline at end of file diff --git a/packages/build-plugin-lce/src/common/babelPluginCorejsLock.js b/packages/build-plugin-lce/src/common/babelPluginCorejsLock.js new file mode 100644 index 0000000..2422e43 --- /dev/null +++ b/packages/build-plugin-lce/src/common/babelPluginCorejsLock.js @@ -0,0 +1,23 @@ +const path = require('path'); + +const coreJSPath = path.dirname(require.resolve('core-js/package.json')); +// eslint-disable-next-line no-unused-vars +module.exports = ({ types }, { fileList }) => { + return { + visitor: { + ImportDeclaration(nodePath, state) { + const entryFile = fileList.find((filePath) => { + // filePath may not have an extension + return filePath.includes((state.filename || '').replace(/\.[^/.]+$/, '')); + }); + if (entryFile) { + const { node } = nodePath; + // only replace core-js/modules/xxx added by @babel/preset-env + if (node.source.value.startsWith('core-js/modules')) { + node.source.value = node.source.value.replace('core-js/', `${coreJSPath}/`); + } + } + }, + }, + }; +}; diff --git a/packages/build-plugin-lce/src/common/formatPathForWin.js b/packages/build-plugin-lce/src/common/formatPathForWin.js new file mode 100644 index 0000000..c04bc6c --- /dev/null +++ b/packages/build-plugin-lce/src/common/formatPathForWin.js @@ -0,0 +1,5 @@ +const path = require('path'); + +module.exports = function formatPathForWin(filepath) { + return process.platform === 'win32' ? filepath.split(path.sep).join('/') : filepath; +}; diff --git a/packages/build-plugin-lce/src/common/getCompileBabel.js b/packages/build-plugin-lce/src/common/getCompileBabel.js new file mode 100644 index 0000000..6024632 --- /dev/null +++ b/packages/build-plugin-lce/src/common/getCompileBabel.js @@ -0,0 +1,46 @@ +const { getBabelConfig } = require('build-scripts-config'); +const formatPathForWin = require('./formatPathForWin'); + +module.exports = (options = {}, { babelPlugins, babelOptions, rootDir }) => { + const { modules } = options; + + const defaultBabel = getBabelConfig(); + + const additionalPlugins = [ + [require.resolve('@babel/plugin-transform-runtime'), { + corejs: false, + helpers: true, + regenerator: true, + useESModules: false, + }], + [require.resolve('@babel/plugin-proposal-class-properties'), { loose: true }], + [require.resolve('@babel/plugin-proposal-private-methods'), { loose: true }], + [require.resolve('@babel/plugin-proposal-private-property-in-object'), { loose: true }], + ]; + + const formatedBabelPlugins = (babelPlugins || []).map((plugin) => { + const [pluginName, pluginOptions, ...restOptions] = Array.isArray(plugin) ? plugin : [plugin]; + // 用户自定义的 babelPlugins 需要从项目目录寻址 + const pluginPath = require.resolve(pluginName, { paths: [rootDir] }); + return pluginOptions ? [pluginPath, pluginOptions, ...(restOptions || [])] : pluginPath; + }); + + defaultBabel.plugins = [...defaultBabel.plugins, ...additionalPlugins, ...formatedBabelPlugins]; + + // modify @babel/preset-env options + defaultBabel.presets = defaultBabel.presets.map((preset) => { + const [presetPath, presetOptions] = Array.isArray(preset) ? preset : [preset]; + const targetConfig = babelOptions.find(({ name }) => (formatPathForWin(presetPath).indexOf(name) > -1)); + const modifyOptions = targetConfig && targetConfig.options; + + if (formatPathForWin(presetPath).indexOf('@babel/preset-env') > -1) { + // default preset-env options for component compile + return [presetPath, { modules, loose: true, ...(modifyOptions || {}) }]; + } + if (presetOptions && modifyOptions) { + return [presetPath, { ...presetOptions, ...modifyOptions }]; + } + return preset; + }); + return defaultBabel; +}; diff --git a/packages/build-plugin-lce/src/common/getRightEntryExtname.js b/packages/build-plugin-lce/src/common/getRightEntryExtname.js new file mode 100644 index 0000000..fa32638 --- /dev/null +++ b/packages/build-plugin-lce/src/common/getRightEntryExtname.js @@ -0,0 +1,36 @@ +/** + * get the index file ext name for the right entry file + * + * @param {*} cwd current dir + * @returns + */ +const path = require('path'); +const glob = require('glob'); +const { + REG_JS_INDEX, + REG_SASS_INDEX, + REG_LESS_INDEX, +} = require('../configs/reg'); + +module.exports = cwd => { + const rootFilePaths = glob.sync('*', { + cwd, + }); + const extNames = {}; + rootFilePaths.forEach(i => { + if (REG_JS_INDEX.test(i) && !extNames.jsExt) { + extNames.jsExt = path.extname(i); + } + if (!extNames.styleExt) { + if (REG_SASS_INDEX.test(i)) { + extNames.styleExt = path.extname(i); + extNames.isSassLike = true; + } else if (REG_LESS_INDEX.test(i)) { + extNames.styleExt = path.extname(i); + extNames.isLessLike = true; + } + } + }); + + return Object.keys(extNames).length && extNames; +}; diff --git a/packages/build-plugin-lce/src/common/getUMDWebpack.js b/packages/build-plugin-lce/src/common/getUMDWebpack.js new file mode 100644 index 0000000..6a889bf --- /dev/null +++ b/packages/build-plugin-lce/src/common/getUMDWebpack.js @@ -0,0 +1,158 @@ +const path = require('path'); +const { upperFirst, camelCase } = require('lodash'); +const { getWebpackConfig } = require('build-scripts-config'); +const { defaultDynamicImportLibraries } = require('../compiler/depAnalyze'); +const setDefine = require('../useConfig/define'); +const setSassStyleExpanded = require('./setSassStyleExpanded'); + +module.exports = ({ context, compileOptions, extNames, hasMain }) => { + const mode = 'production'; + const config = getWebpackConfig(mode); + const { rootDir } = context; + const { + // dist minify + minify, + // dist sourceMap + sourceMap, + // library name + library, + // library target + libraryTarget = 'umd', + // library export, default is undefined + libraryExport, + // externals dependencies + externals = { + react: { + root: 'React', + commonjs: 'react', + commonjs2: 'react', + amd: 'react', + }, + 'react-dom': { + root: 'ReactDOM', + commonjs: 'react-dom', + commonjs2: 'react-dom', + amd: 'react-dom', + }, + '@alifd/next': { + root: 'Next', + commonjs: '@alifd/next', + commonjs2: '@alifd/next', + amd: '@alifd/next', + }, + moment: { + root: 'moment', + commonjs: 'moment', + commonjs2: 'moment', + amd: 'moment', + }, + }, + basicComponents = [], + define, + } = compileOptions; + const { jsExt, styleExt } = extNames; + // file name + const filename = compileOptions.filename || library; + const jsPath = path.resolve(rootDir, `src/index${jsExt}`); + + config.context(rootDir); + + // - set entry + const entryName = filename; + if (hasMain || styleExt) { + const cssPath = path.resolve( + rootDir, + hasMain ? 'src/main.scss' : `src/index${styleExt}`, + ); + config.entry(entryName).add(cssPath); + } + config.entry(entryName).add(jsPath); + + // - output library files + config.output + .path(path.resolve(rootDir, 'dist')) + .filename('[name].js') + .publicPath('./dist/') + .library(library) + .libraryExport(libraryExport) + .libraryTarget(libraryTarget); + + // - set externals + if (externals) { + const localExternals = [].concat(externals); + + /** + * see [rfc](https://github.com/ice-lab/iceworks-cli/issues/153). + * if `basicComponents` is `undefined`,concat `defaultDynamicImportLibraries`. + * if `basicComponents` is `false`, escape all default behavior. + * otherwise, merge `defaultDynamicImportLibraries` to `basicComponets` and deduplicate. + */ + const validBasicComponent = (basicComponents ? [...basicComponents, ...defaultDynamicImportLibraries] : []) + // if `external` item is a function,one have to deal with it himself + .filter((externalKey) => Object.keys(externals).includes(externalKey) && typeof externals[externalKey] !== 'function'); + + if (validBasicComponent.length) { + const regexs = validBasicComponent.map((name) => ({ + name, + regex: new RegExp(`${name.replace('/', '\\/') }\\/(es|lib)\\/([-\\w+]+)$`), + })); + + localExternals.push((_context, request, callback) => { + for (let i = 0; i < regexs.length; i++) { + const { name, regex } = regexs[i]; + if (regex.test(request)) { + const componentName = request.match(regex)[2]; + const externalKey = typeof externals[name] === 'string' ? externals[name] : externals[name].root; + + if (componentName) { + const externalInfo = [externalKey, upperFirst(camelCase(componentName))]; + const commonExternal = [name, upperFirst(camelCase(componentName))]; + + return callback(null, { + root: externalInfo, + amd: commonExternal, + commonjs: commonExternal, + commonjs2: commonExternal, + }); + } + } else if (regex.test(_context) && /\.(scss|less|css)$/.test(request)) { + /** + * to exclude styles of externals. As a side effect, a unused varible is generated. + */ + const externalKey = typeof externals[name] === 'string' ? externals[name] : externals[name].root; + return callback(null, externalKey); + } + } + return callback(); + }); + } + + + // set externals + config.externals(localExternals); + } + + // sourceMap + if (sourceMap) { + config.devtool(typeof sourceMap === 'string' ? sourceMap : 'source-map'); + config.optimization + .minimizer('TerserPlugin') + .tap(([options]) => [ + { ...options, sourceMap: true }, + ]); + } + // minify + if (!minify) { + // disable minify code + config.optimization.minimize(minify); + } + + if (define) { + setDefine(config, define, context); + } + + // prevent minify + setSassStyleExpanded(config); + + return config; +}; diff --git a/packages/build-plugin-lce/src/common/htmlInjection.js b/packages/build-plugin-lce/src/common/htmlInjection.js new file mode 100644 index 0000000..3914cb8 --- /dev/null +++ b/packages/build-plugin-lce/src/common/htmlInjection.js @@ -0,0 +1,194 @@ +const cloneDeep = require('lodash.clonedeep'); + +const htmlContentStorage = {}; +const multiHTMLContentStorage = {}; +const HTML_POSITIONS = { + headAppend: { + defaultValue: [], + type: 'array', + }, + headPrepend: { + defaultValue: [], + type: 'array', + }, + bodyAppend: { + defaultValue: [], + type: 'array', + }, + bodyPrepend: { + defaultValue: [], + type: 'array', + }, + htmlAttrs: { + defaultValue: '', + type: 'object', + }, + headAttrs: { + defaultValue: '', + type: 'object', + }, + bodyAttrs: { + defaultValue: '', + type: 'object', + }, + rootContainer: { + defaultValue: [], + type: 'string', + }, +}; +const TAGS_INFO = { + meta: { + selfClosing: true, + }, + title: {}, + link: { + selfClosing: true, + }, + style: {}, + script: {}, +}; + +function injectHTML(callback, position) { + if (!Object.keys(HTML_POSITIONS).includes(position)) { + console.warn('[user config]', `unknown position ${position}.`); + } + // store html content added by applyMethod + htmlContentStorage[position] = callback(htmlContentStorage[position]); +} + +function parseHTMLContent(content) { + if (Object.prototype.toString.call(content) === '[object Object]') { + const { tag, innerHTML, tagId, ...attrs } = content; + const { selfClosing } = TAGS_INFO[tag]; + const attrStr = parseHTMLAttrs(attrs); + return selfClosing && !innerHTML ? `<${tag}${attrStr}/>` : `<${tag}${attrStr}>${innerHTML}`; + } + return content; +} + +function parseHTMLAttrs(attrs) { + const attrKeys = Object.keys(attrs); + return attrKeys.length ? ` ${attrKeys.map((attrKey) => `${attrKey}="${attrs[attrKey]}"`).join(' ')}` : ''; +} + +function getHTMLParams(htmlContent) { + const htmlParams = {}; + Object.keys(htmlContent).forEach((htmlPosition) => { + const htmlTags = htmlContent[htmlPosition]; + htmlParams[htmlPosition] = Array.isArray(htmlTags) ? htmlTags.map((htmlTag) => parseHTMLContent(htmlTag)).join('\n') : parseHTMLContent(htmlTags); + }); + return htmlParams; +} + +function modifyHTMLPluginOptions(config, pluginName, options, params) { + if (config.plugins.get(pluginName)) { + // spa HtmlWebpackPlugin + config.plugin(pluginName).tap(([args]) => { + const defaultValues = {}; + Object.keys(HTML_POSITIONS).forEach((positionKey) => { + defaultValues[positionKey] = HTML_POSITIONS[positionKey].defaultValue; + }); + + /** + * for getDemoConfig needs extra info to inject to html. + * merge htmlAppendInjection to params for getDemoConfig. + */ + const { htmlAppendInjection } = args || {}; + + const _params = { + ...params, + }; + + if (htmlAppendInjection) { + Object.keys(htmlAppendInjection).forEach((position) => { + // eslint-disable-next-line no-param-reassign + _params[position] = (_params[position] || '').concat(htmlAppendInjection[position]); + }); + } + + const pluginOptions = { + ...args, + templateParameters: { + ...(args.templateParameters || {}), + ...defaultValues, // default value of html positions + ..._params, + }, + ...options, + }; + return [pluginOptions]; + }); + } +} + +function configHTMLPlugin(config) { + const htmlParams = getHTMLParams(htmlContentStorage); + const htmlPluginOptions = { + inject: false, + }; + const entry = config.entryPoints.entries(); + // mpa HtmlWebpackPlugin + if (Object.prototype.toString.call(entry) === '[object Object]' && Object.keys(entry).length > 1) { + // delete multi HtmlWebpackPlugin + Object.keys(entry).forEach((entryKey) => { + const pluginName = `HtmlWebpackPlugin_${entryKey}`; + modifyHTMLPluginOptions( + config, + pluginName, + htmlPluginOptions, + multiHTMLContentStorage[entryKey] ? getHTMLParams(multiHTMLContentStorage[entryKey]) : htmlParams, + ); + }); + } else { + modifyHTMLPluginOptions(config, 'HtmlWebpackPlugin', htmlPluginOptions, htmlParams); + } +} + +function configHTMLContent(htmlInjection, entryKey) { + let storage = htmlContentStorage; + if (entryKey) { + multiHTMLContentStorage[entryKey] = cloneDeep(htmlContentStorage); + storage = multiHTMLContentStorage[entryKey]; + } + Object.keys(htmlInjection).forEach((optionKey) => { + if (HTML_POSITIONS[optionKey]) { + const { type } = HTML_POSITIONS[optionKey]; + const value = htmlInjection[optionKey]; + if (type === 'array') { + const newValue = []; + // overwrite content by tagId / unique tag + value.forEach((tagInfo) => { + const { tagId, tag } = tagInfo; + let index = -1; + if (tag === 'title') { + index = (storage[optionKey] || []).findIndex((item) => item.tag === tag); + } else if (tagId) { + index = (storage[optionKey] || []).findIndex((item) => item.tagId === tagId); + } + + if (index > -1) { + storage[optionKey][index] = tagInfo; + } else { + newValue.push(tagInfo); + } + }); + storage[optionKey] = (storage[optionKey] || []).concat(newValue); + } else if (type === 'object') { + storage[optionKey] = { + ...(storage[optionKey] || {}), + ...value, + }; + } else { + storage[optionKey] = value; + } + } + }); +} + +exports.configWebpack = (htmlInjection) => { + if (htmlInjection) { + configHTMLContent(htmlInjection); + } +}; + +exports.configHTMLPlugin = configHTMLPlugin; +exports.configHTMLContent = configHTMLContent; diff --git a/packages/build-plugin-lce/src/common/mergeBabelPlugins.js b/packages/build-plugin-lce/src/common/mergeBabelPlugins.js new file mode 100644 index 0000000..58ddb0d --- /dev/null +++ b/packages/build-plugin-lce/src/common/mergeBabelPlugins.js @@ -0,0 +1,25 @@ +function mergeBabelPlugins(defaultPlugins = [], customPlugins = []) { + const plugins = {}; + // Use the plugin name as the key. If the pluginsMap does not exist, + // the plugin will be added, and if it exists, the plugin will be + // overwritten. + const addPlugin = (plugin) => { + if (typeof plugin === 'string') { + plugins[plugin] = plugin; + } else if (Array.isArray(plugin)) { + const key = plugin[0]; + plugins[key] = plugin; + } else { + console.warn('Unknown plugin description:', plugin); + } + } + + // Default plugins. + defaultPlugins.forEach(addPlugin); + // Custom plugins. + customPlugins.forEach(addPlugin); + + return Object.values(plugins); +} + +module.exports = mergeBabelPlugins; diff --git a/packages/build-plugin-lce/src/common/setAssetsPath.js b/packages/build-plugin-lce/src/common/setAssetsPath.js new file mode 100644 index 0000000..163671d --- /dev/null +++ b/packages/build-plugin-lce/src/common/setAssetsPath.js @@ -0,0 +1,20 @@ +const path = require('path'); +const { last } = require('lodash'); + +function getFilename(filePath) { + return last((filePath || '').split('/')); +} + +module.exports = function setAssetsPath( + config, + outputAssetsPath = { js: '', css: '' }, +) { + const filename = getFilename(config.output.get('filename')); + config.output.filename(path.join(outputAssetsPath.js, filename)); + const options = config.plugin('MiniCssExtractPlugin').get('args')[0]; + config.plugin('MiniCssExtractPlugin').tap(args => [ + Object.assign(...args, { + filename: path.join(outputAssetsPath.css, getFilename(options.filename)), + }), + ]); +}; diff --git a/packages/build-plugin-lce/src/common/setDevLog.js b/packages/build-plugin-lce/src/common/setDevLog.js new file mode 100644 index 0000000..595b5e2 --- /dev/null +++ b/packages/build-plugin-lce/src/common/setDevLog.js @@ -0,0 +1,39 @@ +const chalk = require('chalk'); +const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); + +module.exports = ({ urls, stats, log, context }) => { + const { port } = context.commandArgs; + + const statsJson = stats.toJson({ + all: false, + errors: true, + warnings: true, + timings: true, + }); + + const messages = formatWebpackMessages(statsJson); + const hasError = messages.errors.length; + + // compatible with webpack 5 + ['errors', 'warnings'].forEach((jsonKey) => { + statsJson[jsonKey] = (statsJson[jsonKey] || []).map((item) => (item.message || item)); + }); + + log.info(stats.toString({ + errors: true, + warnings: false, + colors: true, + assets: true, + chunks: false, + entrypoints: false, + modules: false, + timings: false, + })); + + if (!hasError) { + log.info(''); + log.info(chalk.green(' Starting the development server at:')); + log.info(' - Local : ', chalk.underline.white(urls.localUrlForBrowser)); + log.info(' - Network: ', chalk.underline.white(urls.lanUrlForTerminal)); + } +}; diff --git a/packages/build-plugin-lce/src/common/setSassStyleExpanded.js b/packages/build-plugin-lce/src/common/setSassStyleExpanded.js new file mode 100644 index 0000000..9eea1af --- /dev/null +++ b/packages/build-plugin-lce/src/common/setSassStyleExpanded.js @@ -0,0 +1,17 @@ +module.exports = (config) => { + ['scss', 'sass'].forEach((ruleName) => { + if (config.module.rules.get(ruleName) && config.module.rules.get(ruleName).uses.has('sass-loader')) { + config + .module + .rules + .get(ruleName) + .use('sass-loader') + .tap((opts) => ({ + ...opts, + sassOptions: { + outputStyle: 'expanded', + }, + })); + } + }); +}; diff --git a/packages/build-plugin-lce/src/compiler/babel.js b/packages/build-plugin-lce/src/compiler/babel.js new file mode 100644 index 0000000..e50587b --- /dev/null +++ b/packages/build-plugin-lce/src/compiler/babel.js @@ -0,0 +1,197 @@ +/** + * @file generate es and lib by babel. + * @author tony7lee + */ + +const path = require('path'); +const fs = require('fs-extra'); +const glob = require('glob'); +const babel = require('@babel/core'); +const getRaxBabelConfig = require('rax-babel-config'); +const { REG_JS, REG_D_TS } = require('../configs/reg'); +const getCompileBabel = require('../common/getCompileBabel'); +const { analyzePackage } = require('./depAnalyze'); +const generateStyle = require('./generateStyle'); +const dtsCompiler = require('./dts'); +const mergeBabelPlugins = require('../common/mergeBabelPlugins'); + +const getBabelConfig = ({ + target, + componentLibs, + rootDir, + babelPlugins, + babelOptions, + type, + alias, +}) => { + const params = target === 'es' ? { modules: false } : {}; + let babelConfig; + if (type === 'react') { + babelConfig = getCompileBabel(params, { babelPlugins, babelOptions, rootDir }); + } else { + babelConfig = getRaxBabelConfig({ + // Be careful~ change it's value by inlineStyle may cause break-change + styleSheet: true, + custom: { + ignore: ['**/**/*.d.ts'], + }, + ...params, + }); + babelConfig.presets.push([require.resolve('@babel/preset-typescript'), { jsxPragma: 'createElement' }]); + + babelConfig.plugins = mergeBabelPlugins(babelConfig.plugins, (babelPlugins || [])); + } + // generate babel-plugin-import config + const plugins = []; + componentLibs.forEach((libraryName) => { + // check es folder if target is es + const pluginOption = { + libraryName, + style: false, // style file will be require in style.js + }; + if (target === 'es') { + ['es', 'esm'].some((item) => { + const dirPath = path.join(rootDir, 'node_modules', libraryName, item); + const dirExist = fs.existsSync(dirPath); + + if (dirExist) { + pluginOption.libraryDirectory = item; + } + + return dirExist; + }); + } + plugins.push([ + require.resolve('babel-plugin-import'), + pluginOption, + libraryName, + ]); + }); + babelConfig.plugins = babelConfig.plugins.concat(plugins); + if (alias) { + const aliasRelative = {}; + Object.keys(alias).forEach((aliasKey) => { + aliasRelative[aliasKey] = alias[aliasKey].startsWith('./') ? alias[aliasKey] : `./${alias[aliasKey]}`; + }); + babelConfig.plugins = babelConfig.plugins.concat([[ + require.resolve('babel-plugin-module-resolver'), + { + root: ['./src'], + alias: aliasRelative, + }, + ]]); + } + return babelConfig; +}; + +module.exports = function babelCompiler(context, + { + log, + userOptions = {}, + type, + }) { + const { rootDir, pkg } = context; + + // FIXME: 没有 compilerOptions 这个参数 + const { + compilerOptions = {}, + babelOptions = [], + alias, + subComponents, + define, + disableGenerateStyle, + generateTypesForJs = false, + } = userOptions; + + + let { basicComponents = [] } = userOptions; + + if (type === 'rax') { + basicComponents = false; + } + + const { babelPlugins = [] } = userOptions; + + if (define) { + babelPlugins.push([ + require.resolve('babel-plugin-transform-define'), + define, + ]); + } + + // generate DTS for ts files, default is true + const { declaration = true } = compilerOptions; + const componentLibs = disableGenerateStyle ? [] : analyzePackage(pkg, basicComponents); + const srcPath = path.join(rootDir, 'src'); + const compileTargets = ['es', 'lib']; + const filesPath = glob.sync('**/*.*', { cwd: srcPath, ignore: ['node_modules/**', '*.d.ts', '*.?(ali|wechat).?(ts|tsx|js|jsx)'] }); + // traverse to compile the js files + const compileInfo = []; + compileTargets.forEach((target) => { + const destPath = path.join(rootDir, target); + fs.emptyDirSync(destPath); + + // Compile code + filesPath.forEach((filePath) => { + const sourceFile = path.join(srcPath, filePath); + if (!REG_JS.test(filePath) || REG_D_TS.test(filePath)) { + // copy file if it does not match REG_JS + try { + fs.copySync(sourceFile, path.join(destPath, filePath)); + log.info(`file ${filePath} copy successfully!`); + } catch (err) { + log.error(err); + } + } else { + // get babel config for compile + const libBabelConfig = getBabelConfig({ + target, + componentLibs, + rootDir, + babelPlugins, + babelOptions, + type, + alias, + }); + // compile file by babel + // TODO use context.babel + const rightPath = filePath.replace(REG_JS, '.js'); + const { code } = babel.transformFileSync(sourceFile, { + filename: rightPath, + ...libBabelConfig, + }); + const targetPath = path.join(destPath, rightPath); + fs.ensureDirSync(path.dirname(targetPath)); + fs.writeFileSync(targetPath, code, 'utf-8'); + + compileInfo.push({ + filePath, + sourceFile, + destPath, + }); + } + }); + + // Generate style.js + if (type === 'react' && !disableGenerateStyle) { + if (subComponents) { + // filter dir in destPath folder + const folderList = fs.readdirSync(destPath).filter((filePath) => { + return fs.lstatSync(path.join(destPath, filePath)).isDirectory(); + }); + folderList.forEach((folder) => { + generateStyle({ rootDir, basicComponents, destPath: path.join(destPath, folder), target, log, folder }); + }); + } + generateStyle({ rootDir, basicComponents, destPath, target, log }); + } + }); + // generate DTS for TS files + if (declaration) { + dtsCompiler(compileInfo, { + log, + generateTypesForJs, + }); + } + log.info('Generate es and lib successfully!'); +}; diff --git a/packages/build-plugin-lce/src/compiler/depAnalyze.js b/packages/build-plugin-lce/src/compiler/depAnalyze.js new file mode 100644 index 0000000..4ea468e --- /dev/null +++ b/packages/build-plugin-lce/src/compiler/depAnalyze.js @@ -0,0 +1,178 @@ +const fse = require('fs-extra'); +const path = require('path'); +const babel = require('@babel/core'); +const { REG_JS } = require('../configs/reg'); + +const getPkgJSON = (cwd, module) => { + const pkgPath = path.join(cwd, 'node_modules', module, 'package.json'); + if (!fse.existsSync(pkgPath)) return {}; + const jsonString = fse.readFileSync(pkgPath, 'utf-8'); + return JSON.parse(jsonString); +}; + +const defaultDynamicImportLibraries = [ + 'antd', + '@alifd/next', + '@alife/next', + '@icedesign/base', +]; + +function analyzePackage(pkg, basicComponents) { + // get dependencies from pakage.json + const { dependencies = {}, devDependencies = {}, peerDependencies = {} } = pkg; + const libraryNames = []; + if (basicComponents) { + Object.keys({ ...dependencies, ...devDependencies, ...peerDependencies }).forEach((depName) => { + // basic component: antd、@alifd/next、@alife/next、@icedesign/base + if ( + [ + ...defaultDynamicImportLibraries, + ...basicComponents, + ].includes(depName) + ) { + libraryNames.push(depName); + } + }); + } + return libraryNames; +} + +function filterDeps({ deps, rootDir, basicComponents }) { + return deps.filter((dep) => { + // relative path + if (/^\./.test(dep)) { + return false; + } + let basicLibrary = [ + /@icedesign\/.*/, + /^@icedesign\/base\/(lib|es)\/([^/]+)/, + /@alife\/.*/, + /^@alife\/next\/(lib|es)\/([^/]+)/, + /@alifd\/.*/, + /^@alifd\/next\/(lib|es)\/([^/]+)/, + /@ali\/ice-.*/, + /antd\/.*/, + ]; + if (basicComponents) { + basicComponents.forEach((component) => { + basicLibrary.push(new RegExp(`${component}/.*`)); + }); + } else { + // clear basicLibrary if set basicComponents to false + basicLibrary = []; + } + const isBasicLibrary = basicLibrary.some((library) => { + return library.test(dep); + }); + + if (isBasicLibrary) { + return true; + } + + const pkgJSON = getPkgJSON(rootDir, dep); + if (pkgJSON && (pkgJSON.componentConfig || pkgJSON.stylePath)) { + return true; + } + return false; + }); +} + +function getFileContent(filepath) { + try { + return String(fse.readFileSync(filepath)); + } catch (err) { + console.log('Can not open file ', filepath); + return ''; + } +} + +// analyze require() +function analyzeAST(code) { + const result = []; + const visitor = { + CallExpression(nodePath) { + const { callee, arguments: args } = nodePath.node; + const isImportNode = ( + callee.type === 'Identifier' && + callee.name === 'require' + ) || callee.type === 'Import'; + + if ( + isImportNode && + args.length === 1 && + args[0].type === 'StringLiteral' + ) { + result.push(args[0].value); + } + }, + ImportDeclaration(nodePath) { + result.push(nodePath.node.source.value); + }, + ExportAllDeclaration(nodePath) { + const { node } = nodePath; + if (node.source) { + result.push(node.source.value); + } + }, + ExportNamedDeclaration(nodePath) { + const { node } = nodePath; + if (node.source) { + result.push(node.source.value); + } + }, + }; + babel.transformSync(code, { + plugins: [{ visitor }], + }); + + return result; +} + +function dedupe(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('[dedupe]: arr should be an array;'); + } + const map = {}; + for (let i = 0, len = arr.length; i < len; i++) { + const key = arr[i]; + map[key] = true; + } + return Object.keys(map); +} + +// require.resolve .jsx and .vue files +require.extensions['.jsx'] = require.extensions['.js']; +require.extensions['.vue'] = require.extensions['.js']; + +function analyzeDependencies(entryFilePath, rootDir, basicComponents) { + const tracedFiles = {}; + let result = []; + function trace(filename) { + // filter traceFiles and assets files + if (tracedFiles[filename] || !REG_JS.test(filename)) { + return; + } + tracedFiles[filename] = true; + const fileContent = getFileContent(filename); + const analyzeResult = dedupe(analyzeAST(fileContent)); + + result = result.concat(analyzeResult); + analyzeResult.forEach((module) => { + if (/^\./.test(module)) { + const modulePath = require.resolve( + path.join(path.dirname(filename), module), + ); + trace(modulePath); + } + }); + } + trace(require.resolve(entryFilePath)); + const deps = dedupe(result); + return filterDeps({ deps, rootDir, basicComponents }); +} + +module.exports = { + analyzeDependencies, + analyzePackage, + defaultDynamicImportLibraries, +}; diff --git a/packages/build-plugin-lce/src/compiler/dts.js b/packages/build-plugin-lce/src/compiler/dts.js new file mode 100644 index 0000000..cce3664 --- /dev/null +++ b/packages/build-plugin-lce/src/compiler/dts.js @@ -0,0 +1,74 @@ +/** + * @file get the DTS for TS files. + * @author tony7lee + */ + +const path = require('path'); +const fse = require('fs-extra'); +const ts = require('typescript'); +const { REG_TS, REG_JS } = require('../configs/reg'); +const formatPathForWin = require('../common/formatPathForWin'); + +// compile options +const options = { + allowJs: true, + declaration: true, + emitDeclarationOnly: true, +}; + +module.exports = function dtsCompiler(compileInfo, { + log, + generateTypesForJs, +}) { + const regexFile = generateTypesForJs ? REG_JS : REG_TS; + + const needCompileList = compileInfo.filter(({ filePath }) => regexFile.test(filePath)).map((data) => { + const { filePath, destPath, sourceFile } = data; + const targetPath = path.join(destPath, filePath.replace(regexFile, '.d.ts')); + const fileNamesDTS = sourceFile.replace(regexFile, '.d.ts'); + return { + ...data, + targetPath, + fileNamesDTS, + }; + }); + + if (needCompileList.length === 0) { + return; + } + log.info('Compiling ts declaration ...'); + // Create a Program with an in-memory emit + let createdFiles = {}; + const host = ts.createCompilerHost(options); + host.writeFile = (fileName, contents) => { createdFiles[fileName] = contents; }; + + // Prepare and emit the d.ts files + const program = ts.createProgram(needCompileList.map(({ sourceFile }) => sourceFile), options, host); + const emitResult = program.emit(); + if (emitResult.diagnostics && emitResult.diagnostics.length > 0) { + emitResult.diagnostics.forEach((diagnostic) => { + const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + if (diagnostic.file) { + const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + log.error(`${diagnostic.file.fileName} (${line + 1}, ${character + 1}): ${message}`); + } else { + log.error(message); + } + }); + throw new Error('Compile declaration failed.'); + } + + needCompileList.forEach(({ targetPath, fileNamesDTS }) => { + const content = createdFiles[ + formatPathForWin(fileNamesDTS) + ]; + // write file + if (content) { + fse.ensureDirSync(path.dirname(targetPath)); + fse.writeFileSync(targetPath, content, 'utf-8'); + } + }); + + // release + createdFiles = null; +}; diff --git a/packages/build-plugin-lce/src/compiler/generateStyle.js b/packages/build-plugin-lce/src/compiler/generateStyle.js new file mode 100644 index 0000000..f926a55 --- /dev/null +++ b/packages/build-plugin-lce/src/compiler/generateStyle.js @@ -0,0 +1,62 @@ +const path = require('path'); +const fs = require('fs-extra'); +const { analyzeDependencies } = require('./depAnalyze'); + +const parseStyleStatement = ({ target, module, rootDir }) => { + let styleStatement = ''; + const stylePaths = ['style', `${target}/style`]; + if (target === 'es') { + // compatible for component without es folder + stylePaths.push('lib/style.js'); + } + stylePaths.every((stylePath) => { + let keepSearch = true; + try { + require.resolve(`${module}/${stylePath}`); + styleStatement = `${module}/${stylePath}`; + keepSearch = false; + } catch (err) { + keepSearch = true; + } + return keepSearch; + }); + if (styleStatement) { + return target === 'es' + ? `import '${styleStatement}';` + : `require('${styleStatement}');`; + } + return ''; +}; + +module.exports = ({ rootDir, basicComponents, destPath, target, log, folder }) => { + // analyze dependencies for generate style.js + const styleDependencies = analyzeDependencies( + path.join(rootDir, `${target}${folder ? `/${folder}` : ''}/index`), + rootDir, + basicComponents, + ); + // generate style.js + const stylePath = path.join(destPath, 'style.js'); + // check index.scss and main.scss + let styleContent = ''; + ['index.scss', 'index.less', 'index.css', 'main.scss'].every((cssFile) => { + if (fs.existsSync(path.join(destPath, cssFile))) { + styleContent = + target === 'es' + ? `import './${cssFile}';` + : `require('./${cssFile}');`; + // return false to break loop + return false; + } + return true; + }); + const styleSatements = styleDependencies + .map((module) => parseStyleStatement({ module, rootDir, target })) + .join('\n'); + styleContent = + styleSatements || styleContent + ? [styleSatements, styleContent].filter(Boolean).join('\n') + : '//empty file'; + fs.writeFileSync(stylePath, styleContent, 'utf-8'); + log.info(`generate style.js to ${target}`); +}; diff --git a/packages/build-plugin-lce/src/configs/react/userConfig.js b/packages/build-plugin-lce/src/configs/react/userConfig.js new file mode 100644 index 0000000..9be7a6e --- /dev/null +++ b/packages/build-plugin-lce/src/configs/react/userConfig.js @@ -0,0 +1,85 @@ +const htmlInjection = require('../../common/htmlInjection'); + +// set default content of html +htmlInjection.configHTMLContent({ + headPrepend: [ + { + tag: 'meta', + charset: 'utf-8', + tagId: 'meta-charset', + }, + { + tag: 'meta', + 'http-equiv': 'x-ua-compatible', + content: 'ie=edge,chrome=1', + tagId: 'meta-compatible', + }, + { + tag: 'meta', + name: 'viewport', + content: 'width=device-width', + tagId: 'meta-viewport', + }, + ], + headAppend: [ + { + tag: 'title', + innerHTML: 'DEMO 预览', + }, + ], + rootContainer: '
', +}); + +module.exports = [ + { + name: 'demoTemplate', + validation: (val) => { + return Array.isArray(val) || typeof val === 'string'; + }, + }, + { + name: 'babelPlugins', + validation: 'array', + }, + { + name: 'babelOptions', + // [{ name: '@babel/preset-env', options: { module: false } }] + validation: 'array', + }, + { + name: 'basicComponents', + validation: (val) => { + return Array.isArray(val) || val === false; + }, + }, + { + name: 'externals', + validation: 'object', + }, + { + name: 'subComponents', + validation: 'boolean', + }, + { + name: 'htmlInjection', + validation: 'object', + }, + { + name: 'disableGenerateStyle', + validation: 'boolean', + }, + { + name: 'docGenIncludes', + validation: (val) => { + if (!Array.isArray(val)) { + return false; + } + for (let i = 0; i < val.length; i++) { + if (typeof val[i] !== 'string') { + return false; + } + } + return true; + }, + }, +]; diff --git a/packages/build-plugin-lce/src/configs/reg.js b/packages/build-plugin-lce/src/configs/reg.js new file mode 100644 index 0000000..21df9a1 --- /dev/null +++ b/packages/build-plugin-lce/src/configs/reg.js @@ -0,0 +1,17 @@ +/** + * @file constant regexp + * @author tony7lee + */ + +module.exports = { + REG_TS: /\.(tsx?)$/, + REG_D_TS: /\.d\.ts$/, + + REG_JS: /\.(jsx?|tsx?)$/, + REG_SASS: /\.(sa|sc|c)ss$/, + REG_LESS: /\.(le|c)ss$/, + + REG_JS_INDEX: /index\.(jsx?|tsx?)$/, + REG_SASS_INDEX: /index\.(sa|sc|c)ss$/, + REG_LESS_INDEX: /index\.(le|c)ss$/, +}; diff --git a/packages/build-plugin-lce/src/configs/userConfig.js b/packages/build-plugin-lce/src/configs/userConfig.js new file mode 100644 index 0000000..bca16ba --- /dev/null +++ b/packages/build-plugin-lce/src/configs/userConfig.js @@ -0,0 +1,86 @@ +const path = require('path'); + +module.exports = [ + { + name: 'alias', + validation: 'object', + configWebpack: (config, alias, context) => { + const { rootDir } = context; + const aliasWithRoot = {}; + Object.keys(alias).forEach((key) => { + if (path.isAbsolute(alias[key])) { + aliasWithRoot[key] = alias[key]; + } else { + aliasWithRoot[key] = path.resolve(rootDir, alias[key]); + } + }); + config.merge({ + resolve: { + alias: aliasWithRoot, + }, + }); + }, + }, + { + name: 'library', + validation: 'string', + }, + { + name: 'libraryExport', + validation: 'string', + }, + { + name: 'libraryTarget', + validation: 'string', + }, + { + name: 'filename', + validation: 'string', + }, + { + name: 'sourceMap', + validation: 'boolean', + }, + { + name: 'minify', + validation: 'boolean', + }, + { + name: 'type', + validation: 'string', + }, + { + name: 'devServer', + validation: 'object', + defaultValue: { + logLevel: 'silent', + compress: true, + disableHostCheck: true, + clientLogLevel: 'error', + hot: true, + quiet: true, + overlay: false, + before: (app) => { + app.use((req, res, next) => { + res.set('Access-Control-Allow-Origin', '*'); + next(); + }); + }, + }, + configWebpack: (config, devServer, context) => { + const { command } = context; + if (command === 'start' && devServer) { + config.merge({ devServer }); + } + }, + }, + { + name: 'define', + validation: 'object', + }, + { + name: 'generateTypesForJs', + validation: 'boolean', + default: false, + }, +]; diff --git a/packages/build-plugin-lce/src/index.js b/packages/build-plugin-lce/src/index.js new file mode 100644 index 0000000..d118c0d --- /dev/null +++ b/packages/build-plugin-lce/src/index.js @@ -0,0 +1,126 @@ +const path = require('path'); +const fs = require('fs-extra'); +const { getWebpackConfig, getJestConfig } = require('build-scripts-config'); +const openBrowser = require('react-dev-utils/openBrowser'); +const chokidar = require('chokidar'); + +const getRightEntryExtname = require('./common/getRightEntryExtname'); +const getUMDWebpack = require('./common/getUMDWebpack'); +const htmlInjection = require('./common/htmlInjection'); +const setDevLog = require('./common/setDevLog'); +const setSassStyleExpanded = require('./common/setSassStyleExpanded'); + +const defaultUserConfig = require('./configs/userConfig'); +const reactUserConfig = require('./configs/react/userConfig'); +const babelCompiler = require('./compiler/babel'); + +module.exports = ({ + context, + registerTask, + registerCliOption, + registerUserConfig, + onHook, + log, + onGetJestConfig, +}) => { + const { command, rootDir, commandArgs, userConfig } = context; + const { plugins, ...compileOptions } = userConfig; + const { library } = compileOptions; + + // config htmlInjection for once + if (userConfig.htmlInjection) { + htmlInjection.configWebpack(userConfig.htmlInjection); + } + + /** + * register task for demo + */ + const mode = command === 'start' ? 'development' : 'production'; + const webpackConfig = getWebpackConfig(mode); + + setSassStyleExpanded(webpackConfig); + + /** + * # register task for production + */ + // get the right index entry from the src folder + const extNames = getRightEntryExtname(path.resolve(rootDir, 'src/')); + let hasMain = false; + if (fs.existsSync(path.join(rootDir, 'src', 'main.scss'))) { + hasMain = true; + } + // pack the right entry files to dist + if (extNames && library && (command === 'build' || commandArgs.watchDist)) { + registerTask('component-dist', getUMDWebpack({ context, compileOptions, extNames, hasMain })); + } + + // register cli options + const cliOptions = ['watch', 'watch-dist', 'https', 'disable-open']; + registerCliOption( + cliOptions.map((name) => ({ + name, + commands: ['start', 'build'], + })), + ); + + // register user config + registerUserConfig(defaultUserConfig.concat(reactUserConfig)); + + if (commandArgs.watch) { + const srcPath = path.join(rootDir, 'src'); + const watcher = chokidar.watch(srcPath, { + ignoreInitial: true, + interval: 1000, + }); + watcher.on('change', (file) => { + log.info(`${file} changed, start compile library.`); + babelCompiler(context, { + log, + userOptions: compileOptions, + type: 'react', + }); + }); + + watcher.on('error', (error) => { + log.error('fail to watch file', error); + }); + } + + if (command === 'test') { + // jest config + onGetJestConfig((jestConfig) => { + const { moduleNameMapper, ...rest } = jestConfig; + const defaultJestConfig = getJestConfig({ rootDir, moduleNameMapper }); + return { + ...defaultJestConfig, + ...rest, + // defaultJestConfig.moduleNameMapper already combine jestConfig.moduleNameMapper + moduleNameMapper: defaultJestConfig.moduleNameMapper, + }; + }); + } + + const compilerHook = 'before.build.load'; + onHook(compilerHook, async () => { + /** + * # generate es and lib by using babel. + */ + babelCompiler(context, { + log, + userOptions: compileOptions, + type: 'react', + }); + }); + + onHook('after.start.compile', async ({ urls, stats }) => { + // 自定义 log 内容 + setDevLog({ log, context, urls, stats }); + }); + + onHook('after.start.devServer', ({ url }) => { + // do not open browser when restart dev + if (!process.env.RESTART_DEV && !commandArgs.disableOpen) { + openBrowser(url); + } + }); +}; diff --git a/packages/build-plugin-lce/src/useConfig/define.js b/packages/build-plugin-lce/src/useConfig/define.js new file mode 100644 index 0000000..4c7e62e --- /dev/null +++ b/packages/build-plugin-lce/src/useConfig/define.js @@ -0,0 +1,17 @@ +module.exports = (config, define, context) => { + const defineVariables = {}; + + Object.keys(define).forEach((defineKey) => { + defineVariables[defineKey] = JSON.stringify(define[defineKey]); + }); + + if (config.plugins.get('DefinePlugin')) { + config + .plugin('DefinePlugin') + .tap((args) => [Object.assign(...args, defineVariables)]); + } else { + const { webpack } = context; + config.plugin('DefinePlugin') + .use(webpack.DefinePlugin, [defineVariables]); + } +}; diff --git a/packages/build-plugin-lowcode/.gitignore b/packages/build-plugin-lowcode/.gitignore new file mode 100644 index 0000000..181d3ad --- /dev/null +++ b/packages/build-plugin-lowcode/.gitignore @@ -0,0 +1,26 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +node_modules/ + +# production +build/ +dist/ +tmp/ +lib/ +es/ +.tmp/ + +# misc +.idea/ +.happypack +.DS_Store +*.swp +*.dia~ + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +yarn.lock + +storybook-static/ diff --git a/packages/build-plugin-lowcode/.npmignore b/packages/build-plugin-lowcode/.npmignore new file mode 100644 index 0000000..1bc1193 --- /dev/null +++ b/packages/build-plugin-lowcode/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +demo/ \ No newline at end of file diff --git a/packages/build-plugin-lowcode/README.md b/packages/build-plugin-lowcode/README.md new file mode 100644 index 0000000..f8a551c --- /dev/null +++ b/packages/build-plugin-lowcode/README.md @@ -0,0 +1,47 @@ +## 概述 + +## 使用文档 + +```ts +export interface LowcodeOptions { + builtinAssets?: Array; // 会作为内置资产保存到构建产物中 + extraAssets?: Array; // 只在调试环境加载到资产包中 + noParse?: boolean; // 关闭自动解析生成 lowcode meta + categories?: string[]; // 组件在组件面板中的分类 + groups?: string[]; // 组件在组件面板中的 tab 分组 + baseLibrary?: 'react'|'rax'; + setterMap?: SetterMap; // 注入 setter +} + +export interface SetterMap { + [SetterName: string]: string; +} + +export type Assets = { + package: string; + version: string; + urls: string[]; + library: string; +}; +// 示例 +// { +// package: 'antd', +// version: '4.17.3', +// urls: [ +// 'https://g.alicdn.com/code/lib/antd/4.17.3/antd.min.js', +// 'https://g.alicdn.com/code/lib/antd/4.17.3/antd.min.css', +// ], +// library: 'antd', +// } +``` +## 开发调试 +### 组件开发 + +`demo/component`目录下是测试组件的项目,改项目引用了 build-plugin-lowcode,相关配置在在 `demo/component/build.lowcode.js` 中; + +可以修改 build-plugin-lowcode 的代码、修改 demo/component/build.lowcode.js 的配置进行调试; + +```bash +# 在 build-plugin-lowcode 根目录下执行启动调试环境 +npm run component:dev +``` \ No newline at end of file diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/build.lowcode.js b/packages/build-plugin-lowcode/demo/antd-setter-map/build.lowcode.js new file mode 100644 index 0000000..ed28597 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/build.lowcode.js @@ -0,0 +1,23 @@ +const package = require('./package.json'); + +module.exports = { + alias: { + '@': './src/components', + }, + plugins: [ + [ + '../../src/index.js', + { + engineScope: '@alilc', + setterMap: { + InputSetter: '../src/setters/InputSetter', + }, + npmClient: 'cnpm', + staticResources: { + antdJsUrl: 'https://g.alicdn.com/code/lib/antd/4.20.0/antd.min.js', + antdCssUrl: 'https://g.alicdn.com/code/lib/antd/4.20.0/antd.min.css' + } + }, + ], + ], +}; diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/lowcode/button/meta.ts b/packages/build-plugin-lowcode/demo/antd-setter-map/lowcode/button/meta.ts new file mode 100644 index 0000000..d07c588 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/lowcode/button/meta.ts @@ -0,0 +1,50 @@ + +import { ComponentMetadata, Snippet } from '@alilc/lowcode-types'; + +const ButtonMeta: ComponentMetadata = { + "componentName": "Button", + "title": "Button", + "docUrl": "", + "screenshot": "", + "devMode": "proCode", + group: '测试组件', + "npm": { + "package": "@alilc/example-components", + "version": "1.0.0", + "exportName": "Button", + "main": "src/index.tsx", + "destructuring": true, + "subName": "" + }, + "configure": { + "props": [ + { + name: 'title', + title: { + label: 'title', + tip: "标题", + }, + setter: ['StringSetter', 'VariableSetter', 'InputSetter'], + }, + ], + "supports": { + "style": true + }, + "component": {} + } +}; +const snippets: Snippet[] = [ + { + "title": "Button", + "screenshot": "", + "schema": { + "componentName": "Button", + "props": {} + } + } +]; + +export default { + ...ButtonMeta, + snippets +}; diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/package.json b/packages/build-plugin-lowcode/demo/antd-setter-map/package.json new file mode 100644 index 0000000..f9241d2 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/package.json @@ -0,0 +1,54 @@ +{ + "name": "@alilc/example-components", + "version": "1.0.0", + "description": "A component library based on Fusion Next", + "files": [ + "docs/", + "es/", + "lib/", + "build/" + ], + "main": "lib/index.js", + "module": "es/index.js", + "stylePath": "style.js", + "scripts": { + "start": "build-scripts start --config ./build.lowcode.js", + "build": "build-scripts build --config ./build.lowcode.js", + "lint": "f2elint scan", + "lint:fix": "f2elint fix" + }, + "keywords": [ + "ice", + "react", + "component" + ], + "dependencies": { + "@storybook/addon-docs": "^6.3.4", + "@storybook/addon-essentials": "^6.3.4", + "@storybook/addon-storysource": "^6.3.4", + "moment": "^2.29.1", + "prop-types": "^15.5.8" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.3", + "@alifd/next": "^1.x" + }, + "peerDependencies": { + "@alifd/next": "1.x", + "react": "^16.9.0", + "react-dom": "^16.9.0" + }, + "publishConfig": { + "access": "public" + }, + "license": "MIT", + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + }, + "componentConfig": { + "materialSchema": "https://unpkg.com/@alilc/example-components@1.0.0/build/lowcode/assets-prod.json" + } +} diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/src/components/button/index.tsx b/packages/build-plugin-lowcode/demo/antd-setter-map/src/components/button/index.tsx new file mode 100644 index 0000000..8873be8 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/src/components/button/index.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { Button } from '@alifd/next'; + +interface ComponentProps { + title: string; +} + +export default function ComponentB(props: ComponentProps) { + const { title, children = '按钮', ...others } = props; + + return ( +
+ {title} + +
+ ); +} diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.scss b/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.scss new file mode 100644 index 0000000..da46ffc --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.scss @@ -0,0 +1 @@ +$biz-css-prefix: '.bizpack'; diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.tsx b/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.tsx new file mode 100644 index 0000000..b02733f --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/src/index.tsx @@ -0,0 +1,5 @@ + +import Button from './components/button'; + +export const bizCssPrefix = 'bizpack'; +export { Button }; diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/src/setters/InputSetter.tsx b/packages/build-plugin-lowcode/demo/antd-setter-map/src/setters/InputSetter.tsx new file mode 100644 index 0000000..9bb9c35 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/src/setters/InputSetter.tsx @@ -0,0 +1,33 @@ +import * as React from 'react'; +import { Input } from 'antd' +import { createElement } from 'react'; + +export interface IAntdSetterProps { + value?: string; + defaultValue?: string; + placeholder?: string; + onChange?: (val: string) => void; +} + +const InputSetter: React.FC = ({ + onChange, + placeholder = '请输入', + value, +}) => { + return ( +
+ { + const val = e.currentTarget.value; + onChange?.(val); + }} + style={{ width: '100%' }} + /> +
+ ); +}; + +export default InputSetter; diff --git a/packages/build-plugin-lowcode/demo/antd-setter-map/tsconfig.json b/packages/build-plugin-lowcode/demo/antd-setter-map/tsconfig.json new file mode 100644 index 0000000..a511d68 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/antd-setter-map/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compileOnSave": false, + "buildOnSave": false, + "compilerOptions": { + "outDir": "build", + "module": "esnext", + "target": "es6", + "jsx": "react", + "moduleResolution": "node", + "lib": ["es6", "dom"], + "sourceMap": true, + "allowJs": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "skipLibCheck": true + }, + "include": ["src/*.ts", "src/*.tsx"], + "exclude": ["node_modules", "build", "public"] +} diff --git a/packages/build-plugin-lowcode/demo/component/build.lowcode.js b/packages/build-plugin-lowcode/demo/component/build.lowcode.js new file mode 100644 index 0000000..99dd729 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/build.lowcode.js @@ -0,0 +1,22 @@ +const package = require('./package.json'); + +module.exports = { + alias: { + '@': './src/components', + }, + plugins: [ + [ + '../../src/index.js', + { + engineScope: '@alilc', + extraAssets: [ + 'https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.3/dist/assets.json' + ], + setterMap: { + TestSetter: '@alilc/magic-editor-setter@1.0.0' + }, + npmClient: 'cnpm' + }, + ], + ], +}; diff --git a/packages/build-plugin-lowcode/demo/component/lowcode/button/meta.ts b/packages/build-plugin-lowcode/demo/component/lowcode/button/meta.ts new file mode 100644 index 0000000..f7a86b4 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/lowcode/button/meta.ts @@ -0,0 +1,58 @@ + +import { ComponentMetadata, Snippet } from '@alilc/lowcode-types'; + +const ButtonMeta: ComponentMetadata = { + "componentName": "Button", + "title": "Button", + "docUrl": "", + "screenshot": "", + "devMode": "proCode", + group: '测试组件', + "npm": { + "package": "@alilc/example-components", + "version": "1.0.0", + "exportName": "Button", + "main": "src/index.tsx", + "destructuring": true, + "subName": "" + }, + "configure": { + "props": [ + { + "title": { + "label": { + "type": "i18n", + "en-US": "title", + "zh-CN": "title" + } + }, + "name": "title", + "setter": { + "componentName": "TestSetter", + props: { + defaultChecked: true + } + } + } + ], + "supports": { + "style": true + }, + "component": {} + } +}; +const snippets: Snippet[] = [ + { + "title": "Button", + "screenshot": "", + "schema": { + "componentName": "Button", + "props": {} + } + } +]; + +export default { + ...ButtonMeta, + snippets +}; diff --git a/packages/build-plugin-lowcode/demo/component/lowcode/input/meta.ts b/packages/build-plugin-lowcode/demo/component/lowcode/input/meta.ts new file mode 100644 index 0000000..ee8d9c0 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/lowcode/input/meta.ts @@ -0,0 +1,56 @@ + +import { ComponentMetadata, Snippet } from '@alilc/lowcode-types'; + +const InputMeta: ComponentMetadata = { + "componentName": "Input", + "title": "Input", + "docUrl": "", + "screenshot": "", + "devMode": "proCode", + "npm": { + "package": "@alilc/example-components", + "version": "1.0.0", + "exportName": "Input", + "main": "src/index.tsx", + "destructuring": true, + "subName": "" + }, + "configure": { + "props": [ + { + "title": { + "label": { + "type": "i18n", + "en-US": "title", + "zh-CN": "title" + } + }, + "name": "title", + "setter": { + "componentName": "StringSetter", + "isRequired": true, + "initialValue": "" + } + } + ], + "supports": { + "style": true + }, + "component": {} + } +}; +const snippets: Snippet[] = [ + { + "title": "Input", + "screenshot": "", + "schema": { + "componentName": "Input", + "props": {} + } + } +]; + +export default { + ...InputMeta, + snippets +}; diff --git a/packages/build-plugin-lowcode/demo/component/package.json b/packages/build-plugin-lowcode/demo/component/package.json new file mode 100644 index 0000000..2e30cc8 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/package.json @@ -0,0 +1,58 @@ +{ + "name": "@alilc/example-components", + "version": "1.0.0", + "description": "A component library based on Fusion Next", + "files": [ + "docs/", + "es/", + "lib/", + "build/" + ], + "main": "lib/index.js", + "module": "es/index.js", + "stylePath": "style.js", + "scripts": { + "start": "build-scripts start --config ./build.lowcode.js", + "build": "build-scripts build --config ./build.lowcode.js", + "lint": "f2elint scan", + "lint:fix": "f2elint fix" + }, + "keywords": [ + "ice", + "react", + "component" + ], + "dependencies": { + "@alifd/next": "^1.21.8", + "@alilc/lowcode-setter-behavior": "^1.0.0", + "@alilc/lowcode-setter-title": "^1.0.2", + "@alilc/magic-editor-setter": "^1.0.0", + "@storybook/addon-docs": "^6.3.4", + "@storybook/addon-essentials": "^6.3.4", + "@storybook/addon-storysource": "^6.3.4", + "moment": "^2.29.1", + "prop-types": "^15.5.8" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.3", + "@alifd/next": "^1.x" + }, + "peerDependencies": { + "@alifd/next": "1.x", + "react": "^16.9.0", + "react-dom": "^16.9.0" + }, + "publishConfig": { + "access": "public" + }, + "license": "MIT", + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + }, + "componentConfig": { + "materialSchema": "https://unpkg.com/@alilc/example-components@1.0.0/build/lowcode/assets-prod.json" + } +} diff --git a/packages/build-plugin-lowcode/demo/component/src/components/button/index.tsx b/packages/build-plugin-lowcode/demo/component/src/components/button/index.tsx new file mode 100644 index 0000000..8873be8 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/src/components/button/index.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { Button } from '@alifd/next'; + +interface ComponentProps { + title: string; +} + +export default function ComponentB(props: ComponentProps) { + const { title, children = '按钮', ...others } = props; + + return ( +
+ {title} + +
+ ); +} diff --git a/packages/build-plugin-lowcode/demo/component/src/components/input/index.tsx b/packages/build-plugin-lowcode/demo/component/src/components/input/index.tsx new file mode 100644 index 0000000..c41d5e5 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/src/components/input/index.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { Input } from '@alifd/next'; + +interface ComponentProps { + title: string; +} + +export default function ComponentB(props: ComponentProps) { + const { title, ...others } = props; + + return ( +
+ { title } + +
+ ); +} diff --git a/packages/build-plugin-lowcode/demo/component/src/index.scss b/packages/build-plugin-lowcode/demo/component/src/index.scss new file mode 100644 index 0000000..da46ffc --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/src/index.scss @@ -0,0 +1 @@ +$biz-css-prefix: '.bizpack'; diff --git a/packages/build-plugin-lowcode/demo/component/src/index.tsx b/packages/build-plugin-lowcode/demo/component/src/index.tsx new file mode 100644 index 0000000..5b33c9c --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/src/index.tsx @@ -0,0 +1,6 @@ + +import Button from './components/button'; +import Input from './components/input'; + +export const bizCssPrefix = 'bizpack'; +export { Button, Input }; diff --git a/packages/build-plugin-lowcode/demo/component/tsconfig.json b/packages/build-plugin-lowcode/demo/component/tsconfig.json new file mode 100644 index 0000000..a511d68 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/component/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compileOnSave": false, + "buildOnSave": false, + "compilerOptions": { + "outDir": "build", + "module": "esnext", + "target": "es6", + "jsx": "react", + "moduleResolution": "node", + "lib": ["es6", "dom"], + "sourceMap": true, + "allowJs": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "skipLibCheck": true + }, + "include": ["src/*.ts", "src/*.tsx"], + "exclude": ["node_modules", "build", "public"] +} diff --git a/packages/build-plugin-lowcode/demo/setter/build.lowcode.js b/packages/build-plugin-lowcode/demo/setter/build.lowcode.js new file mode 100644 index 0000000..95260a5 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/setter/build.lowcode.js @@ -0,0 +1,22 @@ +const package = require('./package.json'); + +module.exports = { + alias: { + '@': './src/components', + }, + plugins: [ + [ + '../../src/index.js', + { + engineScope: '@alilc', + extraAssets: [ + 'https://unpkg.com/@alilc/lowcode-materials@1.0.3/build/lowcode/assets-prod.json' + ], + type: 'setter', + setterName: 'SelectSetter', + npmClient: 'cnpm', + noParse: true + }, + ], + ], +}; diff --git a/packages/build-plugin-lowcode/demo/setter/package.json b/packages/build-plugin-lowcode/demo/setter/package.json new file mode 100644 index 0000000..939f9e1 --- /dev/null +++ b/packages/build-plugin-lowcode/demo/setter/package.json @@ -0,0 +1,19 @@ +{ + "name": "@alilc/advance-select-setter", + "version": "1.0.0", + "description": "", + "main": "lib/index.js", + "scripts": { + "start": "build-scripts start --config ./build.lowcode.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "MIT", + "dependencies": { + "@alifd/next": "^1.25.42", + "react": "^18.2.0" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.3" + } +} diff --git a/packages/build-plugin-lowcode/demo/setter/src/index.tsx b/packages/build-plugin-lowcode/demo/setter/src/index.tsx new file mode 100644 index 0000000..3d6437b --- /dev/null +++ b/packages/build-plugin-lowcode/demo/setter/src/index.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; + +import { Select, Icon } from '@alifd/next'; + +class AdvancedSelectSetter extends React.Component { + + render () { + const { value, onChange, dataSource, options, helpUrl="https://fusion.design" } = this.props; + + return
+ + + + +
+ ); +}; +// 画布区域语言切换 +const SimulatorLocalePlugin = (ctx: IPublicModelPluginContext) => { + return { + async init() { + const { project, skeleton } = ctx; + const currentLocale = project.simulatorHost?.get('locale') || 'zh-CN'; + const onLocaleChange = (value: string): void => { + project.simulatorHost.set('locale', value); + } + skeleton.add({ + area: 'topArea', + type: 'Widget', + name: 'simulatorLocale', + content: , + props: { + align: 'center', + }, + }); + }, + }; +} +SimulatorLocalePlugin.pluginName = 'SimulatorLocalePlugin'; +SimulatorLocalePlugin.meta = { +}; +export default SimulatorLocalePlugin; \ No newline at end of file diff --git a/packages/template-editor/proj/src/preview.tsx b/packages/template-editor/proj/src/preview.tsx new file mode 100644 index 0000000..97d8c0a --- /dev/null +++ b/packages/template-editor/proj/src/preview.tsx @@ -0,0 +1,101 @@ +import ReactDOM from 'react-dom'; +import React, { useState } from 'react'; +import { Loading } from '@alifd/next'; +import mergeWith from 'lodash/mergeWith'; +import isArray from 'lodash/isArray'; +import { buildComponents, assetBundle, AssetLevel, AssetLoader } from '@alilc/lowcode-utils'; +import ReactRenderer from '@alilc/lowcode-react-renderer'; +import { injectComponents } from '@alilc/lowcode-plugin-inject'; +import appHelper from './appHelper'; +import { getProjectSchemaFromLocalStorage, getPackagesFromLocalStorage, getPreviewLocale, setPreviewLocale } from './services/mockService'; + +const getScenarioName = function () { + if (location.search) { + return new URLSearchParams(location.search.slice(1)).get('scenarioName') || 'general'; + } + return 'general'; +} + +const SamplePreview = () => { + const [data, setData] = useState({}); + + async function init() { + const scenarioName = getScenarioName(); + const packages = getPackagesFromLocalStorage(scenarioName); + const projectSchema = getProjectSchemaFromLocalStorage(scenarioName); + const { + componentsMap: componentsMapArray, + componentsTree, + i18n, + dataSource: projectDataSource, + } = projectSchema; + const componentsMap: any = {}; + componentsMapArray.forEach((component: any) => { + componentsMap[component.componentName] = component; + }); + const pageSchema = componentsTree[0]; + + const libraryMap = {}; + const libraryAsset = []; + packages.forEach(({ package: _package, library, urls, renderUrls }) => { + libraryMap[_package] = library; + if (renderUrls) { + libraryAsset.push(renderUrls); + } else if (urls) { + libraryAsset.push(urls); + } + }); + + const vendors = [assetBundle(libraryAsset, AssetLevel.Library)]; + + // TODO asset may cause pollution + const assetLoader = new AssetLoader(); + await assetLoader.load(libraryAsset); + const components = await injectComponents(buildComponents(libraryMap, componentsMap)); + + setData({ + schema: pageSchema, + components, + i18n, + projectDataSource, + }); + } + + const { schema, components, i18n = {}, projectDataSource = {} } = data as any; + + if (!schema || !components) { + init(); + return ; + } + const currentLocale = getPreviewLocale(getScenarioName()); + + if (!(window as any).setPreviewLocale) { + // for demo use only, can use this in console to switch language for i18n test + // 在控制台 window.setPreviewLocale('en-US') 或 window.setPreviewLocale('zh-CN') 查看切换效果 + (window as any).setPreviewLocale = (locale:string) => setPreviewLocale(getScenarioName(), locale); + } + + function customizer(objValue: [], srcValue: []) { + if (isArray(objValue)) { + return objValue.concat(srcValue || []); + } + } + + return ( +
+ +
+ ); +}; + +ReactDOM.render(, document.getElementById('ice-container')); diff --git a/packages/template-editor/proj/src/services/assets.json b/packages/template-editor/proj/src/services/assets.json new file mode 100644 index 0000000..2bcbc61 --- /dev/null +++ b/packages/template-editor/proj/src/services/assets.json @@ -0,0 +1,140 @@ +{ + "packages": [ + { + "package": "moment", + "version": "2.24.0", + "urls": [ + "https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js" + ], + "library": "moment" + }, + { + "package": "lodash", + "library": "_", + "urls": [ + "https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js" + ] + }, + { + "title": "fusion组件库", + "package": "@alifd/next", + "version": "1.26.4", + "urls": [ + "https://g.alicdn.com/code/lib/alifd__next/1.26.4/next.min.css", + "https://g.alicdn.com/code/lib/alifd__next/1.26.4/next-with-locales.min.js" + ], + "library": "Next" + }, + { + "title": "NextTable", + "package": "NextTable", + "version": "1.0.1", + "urls": [ + "https://g.alicdn.com/fusion-platform/pro-table/1.0.1/next-table.js", + "https://g.alicdn.com/fusion-platform/pro-table/1.0.1/next-table.css" + ], + "library": "NextTable" + }, + { + "package": "@alilc/lowcode-materials", + "version": "1.0.7", + "library": "AlilcLowcodeMaterials", + "urls": [ + "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/dist/AlilcLowcodeMaterials.js", + "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/dist/AlilcLowcodeMaterials.css" + ], + "editUrls": [ + "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/build/lowcode/view.js", + "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/build/lowcode/view.css" + ] + }, + { + "package": "@alifd/layout", + "version": "2.0.7", + "library": "AlifdLayout", + "urls": [ + "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/dist/AlifdLayout.js", + "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/dist/AlifdLayout.css" + ], + "editUrls": [ + "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/build/lowcode/view.js", + "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/build/lowcode/view.css" + ] + }, + { + "package": "@alifd/fusion-ui", + "version": "2.0.0", + "library": "AlifdFusionUi", + "urls": [ + "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/dist/AlifdFusionUi.js", + "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/dist/AlifdFusionUi.css" + ], + "editUrls": [ + "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/build/lowcode/view.js", + "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/build/lowcode/view.css" + ] + } + ], + "components": [ + { + "exportName": "AlilcLowcodeMaterialsMeta", + "npm": { + "package": "@alilc/lowcode-materials" + }, + "url": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/build/lowcode/meta.js", + "urls": { + "default": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/build/lowcode/meta.js", + "design": "https://alifd.alicdn.com/npm/@alilc/lowcode-materials@1.0.7/build/lowcode/meta.design.js" + } + }, + { + "exportName": "AlifdLayoutMeta", + "npm": { + "package": "@alifd/layout", + "version": "2.0.7" + }, + "url": "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/build/lowcode/meta.js", + "urls": { + "default": "https://alifd.alicdn.com/npm/@alifd/layout@2.0.7/build/lowcode/meta.js" + } + }, + { + "exportName": "AlifdFusionUiMeta", + "npm": { + "package": "@alifd/fusion-ui" + }, + "url": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/build/lowcode/meta.js", + "urls": { + "default": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/build/lowcode/meta.js", + "design": "https://alifd.alicdn.com/npm/@alifd/fusion-ui@2.0.0/build/lowcode/meta.design.js" + } + } + ], + "sort": { + "groupList": [ + "精选组件", + "原子组件", + "低代码组件" + ], + "categoryList": [ + "基础元素", + "布局容器类", + "表格类", + "表单详情类", + "帮助类", + "对话框类", + "业务类", + "通用", + "引导", + "信息输入", + "信息展示", + "信息反馈" + ] + }, + "groupList": [ + "精选组件", + "原子组件", + "低代码组件" + ], + "ignoreComponents": {} +} diff --git a/packages/template-editor/proj/src/services/defaultI18nSchema.json b/packages/template-editor/proj/src/services/defaultI18nSchema.json new file mode 100644 index 0000000..0490ac8 --- /dev/null +++ b/packages/template-editor/proj/src/services/defaultI18nSchema.json @@ -0,0 +1,10 @@ +{ + "zh-CN": { + "i18n-jwg27yo4": "你好 ", + "i18n-jwg27yo3": "{name} 博士" + }, + "en-US": { + "i18n-jwg27yo4": "Hello ", + "i18n-jwg27yo3": "Doctor {name}" + } +} \ No newline at end of file diff --git a/packages/template-editor/proj/src/services/defaultPageSchema.json b/packages/template-editor/proj/src/services/defaultPageSchema.json new file mode 100644 index 0000000..3dc1a53 --- /dev/null +++ b/packages/template-editor/proj/src/services/defaultPageSchema.json @@ -0,0 +1,580 @@ +{ + "componentName": "Page", + "id": "node_dockcviv8fo1", + "props": { + "ref": "outerView", + "style": { + "height": "100%" + } + }, + "docId": "doclaqkk3b9", + "fileName": "/", + "dataSource": { + "list": [ + { + "type": "fetch", + "isInit": true, + "options": { + "params": {}, + "method": "GET", + "isCors": true, + "timeout": 5000, + "headers": {}, + "uri": "mock/info.json" + }, + "id": "info", + "shouldFetch": { + "type": "JSFunction", + "value": "function() { \n console.log('should fetch.....');\n return true; \n}" + } + } + ] + }, + "state": { + "text": { + "type": "JSExpression", + "value": "\"outer\"" + }, + "isShowDialog": { + "type": "JSExpression", + "value": "false" + } + }, + "css": "body {\n font-size: 12px;\n}\n\n.button {\n width: 100px;\n color: #ff00ff\n}", + "lifeCycles": { + "componentDidMount": { + "type": "JSFunction", + "value": "function componentDidMount() {\n console.log('did mount');\n}" + }, + "componentWillUnmount": { + "type": "JSFunction", + "value": "function componentWillUnmount() {\n console.log('will unmount');\n}" + } + }, + "methods": { + "testFunc": { + "type": "JSFunction", + "value": "function testFunc() {\n console.log('test func');\n}" + }, + "onClick": { + "type": "JSFunction", + "value": "function onClick() {\n this.setState({\n isShowDialog: true\n });\n}" + }, + "closeDialog": { + "type": "JSFunction", + "value": "function closeDialog() {\n this.setState({\n isShowDialog: false\n });\n}" + }, + "getHelloWorldText": { + "type": "JSFunction", + "value": "function getHelloWorldText() {\n return this.i18n('i18n-jwg27yo4');\n}" + }, + "getHelloWorldText2": { + "type": "JSFunction", + "value": "function getHelloWorldText2() {\n return this.i18n('i18n-jwg27yo3', {\n name: '絮黎'\n });\n}" + }, + "onTestConstantsButtonClicked": { + "type": "JSFunction", + "value": "function onTestConstantsButtonClicked() {\n console.log('constants.ConstantA:', this.constants.ConstantA);\n console.log('constants.ConstantB:', this.constants.ConstantB);\n}" + }, + "onTestUtilsButtonClicked": { + "type": "JSFunction", + "value": "function onTestUtilsButtonClicked() {\n this.utils.demoUtil('param1', 'param2');\n}" + } + }, + "originCode": "class LowcodeComponent extends Component {\n state = {\n \"text\": \"outer\",\n \"isShowDialog\": false\n }\n componentDidMount() {\n console.log('did mount');\n }\n componentWillUnmount() {\n console.log('will unmount');\n }\n testFunc() {\n console.log('test func');\n }\n onClick() {\n this.setState({\n isShowDialog: true\n });\n }\n closeDialog() {\n this.setState({\n isShowDialog: false\n });\n }\n getHelloWorldText() {\n return this.i18n('i18n-jwg27yo4');\n }\n getHelloWorldText2() {\n return this.i18n('i18n-jwg27yo3', {\n name: '絮黎',\n });\n }\n onTestConstantsButtonClicked() {\n console.log('constants.ConstantA:', this.constants.ConstantA);\n console.log('constants.ConstantB:', this.constants.ConstantB);\n\t}\n\tonTestUtilsButtonClicked(){\n this.utils.demoUtil('param1', 'param2');\n\t}\n}", + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDPage", + "id": "node_oclfjpfqjy5", + "props": { + "contentProps": { + "style": { + "background": "rgba(255,255,255,0)" + } + }, + "ref": "fdpage-bb43fbb0" + }, + "title": "页面", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDSection", + "id": "node_oclfjpfqjy6", + "props": { + "style": { + "backgroundColor": "rgba(255,255,255,1)", + "minHeight": "" + } + }, + "title": "区域", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDBlock", + "id": "node_oclfjpfqjy7", + "props": { + "mode": "transparent", + "span": 12 + }, + "title": "区块", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDCell", + "id": "node_oclfjpfqjy8", + "props": { + "align": "left", + "verAlign": "top", + "style": { + "backgroundColor": "rgba(255,255,255,1)" + }, + "width": "" + }, + "title": "容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDP", + "id": "node_oclfjpfqjy10", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_oclfjpfqjyz", + "props": { + "type": "h1", + "children": "Home", + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "", + "style": { + "fontSize": "25px" + } + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + } + ] + }, + { + "componentName": "FDBlock", + "id": "node_oclfjpfqjy9", + "props": { + "mode": "transparent", + "span": 12, + "style": { + "backgroundColor": "rgba(255,255,255,1)", + "minHeight": "" + } + }, + "title": "区块", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDRow", + "id": "node_oclfjpfqjy11", + "props": { + "style": { + "backgroundColor": "rgba(255,255,255,1)" + } + }, + "title": "行容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDCell", + "id": "node_oclfjpfqjya", + "props": { + "align": "left", + "verAlign": "top", + "style": { + "backgroundColor": "rgba(255,255,255,1)" + }, + "width": "" + }, + "title": "容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDP", + "id": "node_oclfjqcdwn14", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_oclfjqcdwn13", + "props": { + "type": "h5", + "children": "多语言展示", + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "", + "style": { + "fontSize": "18px" + } + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + }, + { + "componentName": "FDP", + "id": "node_oclfjqcdwn2k", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_oclfjqcdwn2j", + "props": { + "type": "inherit", + "children": { + "type": "JSExpression", + "value": "this.getHelloWorldText()", + "mock": "" + }, + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "" + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + }, + { + "componentName": "NextText", + "id": "node_oclfjqcf7z15", + "props": { + "type": "inherit", + "children": { + "type": "JSExpression", + "value": "this.getHelloWorldText2()", + "mock": "基于 Ali-Lowcode-Engine 快速打造高生产力的低代码研发平台, 基于自然布局体系快速搭建页面" + }, + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "" + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + }, + { + "componentName": "FDCell", + "id": "node_oclfjpfqjy12", + "props": { + "align": "left", + "verAlign": "top", + "style": { + "backgroundColor": "rgba(255,255,255,1)" + } + }, + "title": "容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDP", + "id": "node_oclfjqcf7z2h", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_oclfjqcf7z2g", + "props": { + "type": "h5", + "children": "交互展示", + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "", + "style": { + "fontSize": "18px" + } + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + }, + { + "componentName": "FDP", + "id": "node_oclfjqcf7z2l", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "Button", + "id": "node_oclfjqcf7z2k", + "props": { + "prefix": "next-", + "type": "primary", + "size": "medium", + "htmlType": "button", + "component": "button", + "children": "constants", + "iconSize": "xxs", + "loading": false, + "text": false, + "warning": false, + "disabled": false, + "ref": "button-4951c2d3", + "__events": { + "eventDataList": [ + { + "type": "componentEvent", + "name": "onClick", + "relatedEventName": "onTestConstantsButtonClicked" + } + ], + "eventList": [ + { + "name": "onClick", + "description": "点击按钮的回调\n@param {Object} e Event Object", + "disabled": true + }, + { + "name": "onMouseUp", + "disabled": false + } + ] + }, + "onClick": { + "type": "JSFunction", + "value": "function(){this.onTestConstantsButtonClicked.apply(this,Array.prototype.slice.call(arguments).concat([])) }" + } + }, + "docId": "doclawu71ac", + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + }, + { + "componentName": "Button", + "id": "node_oclfjqcf7z2o", + "props": { + "prefix": "next-", + "type": "primary", + "size": "medium", + "htmlType": "button", + "component": "button", + "children": "utils", + "iconSize": "xxs", + "loading": false, + "text": false, + "warning": false, + "disabled": false, + "__events": { + "eventDataList": [ + { + "type": "componentEvent", + "name": "onClick", + "relatedEventName": "onTestUtilsButtonClicked" + } + ], + "eventList": [ + { + "name": "onClick", + "description": "点击按钮的回调\n@param {Object} e Event Object", + "disabled": true + }, + { + "name": "onMouseUp", + "disabled": false + } + ] + }, + "onClick": { + "type": "JSFunction", + "value": "function(){this.onTestUtilsButtonClicked.apply(this,Array.prototype.slice.call(arguments).concat([])) }" + } + }, + "docId": "doclawu71ac", + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "componentName": "FDBlock", + "id": "node_oclfjqcf7z3g", + "props": { + "mode": "transparent", + "span": 12, + "style": { + "backgroundColor": "rgba(255,255,255,1)", + "minHeight": "" + } + }, + "title": "区块", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDCell", + "id": "node_oclfjqcf7z3h", + "props": { + "align": "left", + "verAlign": "top", + "style": { + "backgroundColor": "rgba(255,255,255,1)" + } + }, + "title": "容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "FDP", + "id": "node_oclfjqcf7z43", + "props": {}, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_oclfjqcf7z42", + "props": { + "type": "inherit", + "children": "Powered By Lowcode Engine", + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "", + "style": { + "height": "30px", + "lineHeight": "30px", + "fontSize": "20px" + } + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/packages/template-editor/proj/src/services/mockService.ts b/packages/template-editor/proj/src/services/mockService.ts new file mode 100644 index 0000000..1bc3442 --- /dev/null +++ b/packages/template-editor/proj/src/services/mockService.ts @@ -0,0 +1,118 @@ +import { material, project } from '@alilc/lowcode-engine'; +import { filterPackages } from '@alilc/lowcode-plugin-inject' +import { Message, Dialog } from '@alifd/next'; +import { IPublicTypeProjectSchema, IPublicEnumTransformStage } from '@alilc/lowcode-types'; +import DefaultPageSchema from './defaultPageSchema.json'; +import DefaultI18nSchema from './defaultI18nSchema.json'; + +const generateProjectSchema = (pageSchema: any, i18nSchema: any): IPublicTypeProjectSchema => { + return { + componentsTree: [pageSchema], + componentsMap: material.componentsMap as any, + version: '1.0.0', + i18n: i18nSchema, + }; +} + + +export const saveSchema = async (scenarioName: string = 'unknown') => { + setProjectSchemaToLocalStorage(scenarioName); + await setPackagesToLocalStorage(scenarioName); + Message.success('成功保存到本地'); +}; + +export const resetSchema = async (scenarioName: string = 'unknown') => { + try { + await new Promise((resolve, reject) => { + Dialog.confirm({ + content: '确定要重置吗?您所有的修改都将消失!', + onOk: () => { + resolve(); + }, + onCancel: () => { + reject() + }, + }) + }) + } catch(err) { + return; + } + const defaultSchema = generateProjectSchema(DefaultPageSchema, DefaultI18nSchema); + + project.importSchema(defaultSchema as any); + project.simulatorHost?.rerender(); + + setProjectSchemaToLocalStorage(scenarioName); + await setPackagesToLocalStorage(scenarioName); + Message.success('成功重置页面'); +} + +const getLSName = (scenarioName: string, ns: string = 'projectSchema') => `${scenarioName}:${ns}`; + +export const getProjectSchemaFromLocalStorage = (scenarioName: string) => { + if (!scenarioName) { + console.error('scenarioName is required!'); + return; + } + const localValue = window.localStorage.getItem(getLSName(scenarioName)); + if (localValue) { + return JSON.parse(localValue); + } + return undefined; +} + +const setProjectSchemaToLocalStorage = (scenarioName: string) => { + if (!scenarioName) { + console.error('scenarioName is required!'); + return; + } + window.localStorage.setItem( + getLSName(scenarioName), + JSON.stringify(project.exportSchema(IPublicEnumTransformStage.Save)) + ); +} + +const setPackagesToLocalStorage = async (scenarioName: string) => { + if (!scenarioName) { + console.error('scenarioName is required!'); + return; + } + const packages = await filterPackages(material.getAssets().packages); + window.localStorage.setItem( + getLSName(scenarioName, 'packages'), + JSON.stringify(packages), + ); +} + +export const getPackagesFromLocalStorage = (scenarioName: string) => { + if (!scenarioName) { + console.error('scenarioName is required!'); + return; + } + return JSON.parse(window.localStorage.getItem(getLSName(scenarioName, 'packages')) || '{}'); +} + +export const getProjectSchema = async (scenarioName: string = 'unknown') : Promise => { + const pageSchema = await getPageSchema(scenarioName); + return generateProjectSchema(pageSchema, DefaultI18nSchema); +}; + +export const getPageSchema = async (scenarioName: string = 'unknown') => { + const pageSchema = getProjectSchemaFromLocalStorage(scenarioName)?.componentsTree?.[0]; + if (pageSchema) { + return pageSchema; + } + + return DefaultPageSchema; +}; + +export const getPreviewLocale = (scenarioName: string) => { + const key = getLSName(scenarioName, 'previewLocale'); + return window.localStorage.getItem(key) || 'zh-CN'; +} + +export const setPreviewLocale = (scenarioName: string, locale: string) => { + const key = getLSName(scenarioName, 'previewLocale'); + window.localStorage.setItem(key, locale || 'zh-CN'); + window.location.reload(); +} diff --git a/packages/template-editor/proj/src/services/schema.json b/packages/template-editor/proj/src/services/schema.json new file mode 100644 index 0000000..81e6f00 --- /dev/null +++ b/packages/template-editor/proj/src/services/schema.json @@ -0,0 +1,445 @@ +{ + "componentName": "Page", + "id": "node_dockcviv8fo1", + "docId": "doclaqkk3b9", + "props": { + "ref": "outerView", + "style": { + "height": "100%" + } + }, + "fileName": "/", + "dataSource": { + "list": [ + { + "type": "fetch", + "isInit": true, + "options": { + "params": {}, + "method": "GET", + "isCors": true, + "timeout": 5000, + "headers": {}, + "uri": "mock/info.json" + }, + "id": "info", + "shouldFetch": { + "type": "JSFunction", + "value": "function() { \n console.log('should fetch.....');\n return true; \n}" + } + } + ] + }, + "state": { + "text": { + "type": "JSExpression", + "value": "\"outer\"" + }, + "isShowDialog": { + "type": "JSExpression", + "value": "false" + } + }, + "css": "body {\n font-size: 12px;\n}\n\n.button {\n width: 100px;\n color: #ff00ff\n}", + "lifeCycles": { + "componentDidMount": { + "type": "JSFunction", + "value": "function componentDidMount() {\n console.log('did mount');\n}" + }, + "componentWillUnmount": { + "type": "JSFunction", + "value": "function componentWillUnmount() {\n console.log('will unmount');\n}" + } + }, + "methods": { + "testFunc": { + "type": "JSFunction", + "value": "function testFunc() {\n console.log('test func');\n}" + }, + "onClick": { + "type": "JSFunction", + "value": "function onClick() {\n this.setState({\n isShowDialog: true\n });\n}" + }, + "closeDialog": { + "type": "JSFunction", + "value": "function closeDialog() {\n this.setState({\n isShowDialog: false\n });\n}" + }, + "onClickTestConstants": { + "type": "JSFunction", + "value": "function onClickTestConstants() {\n console.log('this.constants.ConstantA', this.constants.ConstantA);\n console.log('this.constants.ConstantB', this.constants.ConstantB);\n}" + }, + "onClickTestUtils": { + "type": "JSFunction", + "value": "function onClickTestUtils() {\n this.utils.demoUtil('a', 'b');\n}" + } + }, + "originCode": "class LowcodeComponent extends Component {\n state = {\n \"text\": \"outer\",\n \"isShowDialog\": false\n }\n componentDidMount() {\n console.log('did mount');\n }\n componentWillUnmount() {\n console.log('will unmount');\n }\n testFunc() {\n console.log('test func');\n }\n onClick() {\n this.setState({\n isShowDialog: true\n })\n }\n closeDialog() {\n this.setState({\n isShowDialog: false\n })\n }\n\tonClickTestConstants(){\n console.log('this.constants.ConstantA', this.constants.ConstantA);\n console.log('this.constants.ConstantB', this.constants.ConstantB);\n }\n onClickTestUtils() {\n this.utils.demoUtil('a', 'b');\n }\n}", + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextPage", + "id": "node_ockzs2vw431", + "docId": "doclaqkk3b9", + "props": { + "headerDivider": true, + "minHeight": "100vh", + "presetNav": true, + "presetAside": true, + "footer": false, + "nav": false, + "aside": false, + "placeholderStyle": { + "gridRowEnd": "span 1", + "gridColumnEnd": "span 12" + }, + "headerProps": { + "background": "surface" + }, + "header": { + "type": "JSSlot", + "value": { + "componentName": "NextPageHeader", + "id": "node_ockzs2vw433", + "docId": "doclaqkk3b9", + "props": {}, + "title": "页面头部", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextRowColContainer", + "id": "node_ockzs2vw434", + "docId": "doclaqkk3b9", + "props": { + "rowGap": 20, + "colGap": 20 + }, + "title": "行列容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextRow", + "id": "node_ockzs2vw435", + "docId": "doclaqkk3b9", + "props": {}, + "title": "行", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextCol", + "id": "node_ockzs2vw436", + "docId": "doclaqkk3b9", + "props": { + "colSpan": 1 + }, + "title": "列", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextP", + "id": "node_ockzvfoetv17", + "docId": "dockzvfoetv", + "props": { + "wrap": false, + "type": "body2", + "verAlign": "middle", + "textSpacing": true, + "align": "left" + }, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextText", + "id": "node_ockzvfoetv18", + "docId": "dockzvfoetv", + "props": { + "type": "h5", + "children": { + "type": "JSExpression", + "value": "this.state.info?.info", + "mock": "标题标题" + }, + "mark": false, + "code": false, + "delete": false, + "underline": false, + "strong": false, + "prefix": "", + "classname": "", + "ref": "nexttext-3a39ea8b" + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "isTab": false, + "contentAlignCenter": false, + "contentProps": { + "style": { + "background": "rgba(255,255,255,0)" + } + }, + "navProps": { + "width": 200 + }, + "asideProps": { + "width": 200 + }, + "background": "lining", + "ref": "nextpage-3cc814e7" + }, + "title": "页面", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextBlock", + "id": "node_oclat5fpb6ga", + "docId": "doclat87b8r", + "props": { + "placeholderStyle": { + "height": "100%" + }, + "noPadding": false, + "noBorder": false, + "title": "区域标题", + "rowGap": 20, + "colGap": 20, + "background": "surface", + "layoutmode": "O", + "strict": true, + "colSpan": 12, + "rowSpan": 1, + "mode": "transparent", + "childTotalColumns": 12 + }, + "title": "区域", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextBlockCell", + "id": "node_oclat5fpb6gb", + "docId": "doclat87b8r", + "props": { + "colSpan": 12, + "rowSpan": 1, + "mode": "procard", + "isAutoContainer": true, + "title": "区块标题", + "hasDivider": true, + "loading": false, + "hasCollapse": false, + "text": true, + "isFillContainer": true, + "operations": [] + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextRowColContainer", + "id": "node_oclat5fpb6gc", + "docId": "doclat87b8r", + "props": { + "rowGap": 20, + "colGap": 20 + }, + "title": "行列容器", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextRow", + "id": "node_oclat5fpb6gd", + "docId": "doclat87b8r", + "props": {}, + "title": "行", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextCol", + "id": "node_oclat5fpb6ge", + "docId": "doclat87b8r", + "props": { + "colSpan": 1 + }, + "title": "列", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "NextP", + "id": "node_oclat5fpb6gf", + "docId": "doclat87b8r", + "props": { + "wrap": false, + "type": "body2", + "verAlign": "middle", + "textSpacing": true, + "align": "left" + }, + "title": "段落", + "hidden": false, + "isLocked": false, + "condition": true, + "conditionGroup": "", + "children": [ + { + "componentName": "Button", + "id": "node_oclat5fpb6gg", + "docId": "doclat5fpb6", + "props": { + "prefix": "next-", + "type": "primary", + "size": "medium", + "htmlType": "button", + "component": "button", + "children": "测试constants", + "iconSize": "xxs", + "loading": false, + "text": false, + "warning": false, + "disabled": false, + "__events": { + "eventDataList": [ + { + "type": "componentEvent", + "name": "onClick", + "relatedEventName": "onClickTestConstants" + } + ], + "eventList": [ + { + "name": "onClick", + "description": "点击按钮的回调\n@param {Object} e Event Object", + "disabled": true + }, + { + "name": "onMouseUp", + "disabled": false + } + ] + }, + "onClick": { + "type": "JSFunction", + "value": "function(){this.onClickTestConstants.apply(this,Array.prototype.slice.call(arguments).concat([])) }" + }, + "ghost": false + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + }, + { + "componentName": "Button", + "id": "node_oclat5fpb6gh", + "docId": "doclat5fpb6", + "props": { + "prefix": "next-", + "type": "primary", + "size": "medium", + "htmlType": "button", + "component": "button", + "children": "测试utils", + "iconSize": "xxs", + "loading": false, + "text": false, + "warning": false, + "disabled": false, + "ref": "button-0d20c188", + "__events": { + "eventDataList": [ + { + "type": "componentEvent", + "name": "onClick", + "relatedEventName": "onClickTestUtils" + } + ], + "eventList": [ + { + "name": "onClick", + "description": "点击按钮的回调\n@param {Object} e Event Object", + "disabled": true + }, + { + "name": "onMouseUp", + "disabled": false + } + ] + }, + "onClick": { + "type": "JSFunction", + "value": "function(){this.onClickTestUtils.apply(this,Array.prototype.slice.call(arguments).concat([])) }" + } + }, + "hidden": false, + "title": "", + "isLocked": false, + "condition": true, + "conditionGroup": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/packages/template-editor/proj/tsconfig.json b/packages/template-editor/proj/tsconfig.json new file mode 100644 index 0000000..23314ab --- /dev/null +++ b/packages/template-editor/proj/tsconfig.json @@ -0,0 +1,44 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "lib": ["es2015", "dom"], + // Target latest version of ECMAScript. + "target": "esnext", + // Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. + "module": "esnext", + // Search under node_modules for non-relative imports. + "moduleResolution": "node", + // Process & infer types from .js files. + "allowJs": true, + // Report errors in .js files. + "checkJs": false, + // Don't emit; allow Babel to transform files. + // "noEmit": true, + // Enable strictest settings like strictNullChecks & noImplicitAny. + "strict": true, + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + "allowSyntheticDefaultImports": true, + // Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. + "esModuleInterop": true, + // Specify JSX code generation: 'preserve', 'react-native', or 'react'. + "jsx": "preserve", + // Import emit helpers (e.g. __extends, __rest, etc..) from tslib + "importHelpers": true, + // Enables experimental support for ES7 decorators. + "experimentalDecorators": true, + // Generates corresponding .map file. + "sourceMap": true, + // Disallow inconsistently-cased references to the same file. + "forceConsistentCasingInFileNames": true, + // Allow json import + "resolveJsonModule": true, + // skip type checking of declaration files + "skipLibCheck": true, + "outDir": "lib" + }, + "include": [ + "./src/" + ], + "exclude": ["**/test", "**/lib", "**/es", "node_modules"] +} diff --git a/packages/template-material/rax-multiple-component-template/.editorconfig b/packages/template-material/rax-multiple-component-template/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/rax-multiple-component-template/.eslintignore b/packages/template-material/rax-multiple-component-template/.eslintignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/.eslintignore @@ -0,0 +1 @@ +node_modules/ diff --git a/packages/template-material/rax-multiple-component-template/.eslintrc.js b/packages/template-material/rax-multiple-component-template/.eslintrc.js new file mode 100644 index 0000000..7c06200 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['eslint-config-ali/typescript/node', 'prettier', 'prettier/@typescript-eslint'], + rules: { + '@typescript-eslint/no-require-imports': 0, + }, +}; diff --git a/packages/template-material/rax-multiple-component-template/.gitignore b/packages/template-material/rax-multiple-component-template/.gitignore new file mode 100644 index 0000000..8c8419a --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/.gitignore @@ -0,0 +1,18 @@ +logs/ +npm-debug.log +yarn-error.log +node_modules/ +package-lock.json +yarn.lock +coverage/ +.idea/ +run/ +.DS_Store +*.sw* +*.un~ +.tsbuildinfo +.tsbuildinfo.* +/dist/ +.nodejs-cache/ +.nodejs-cache +dist diff --git a/packages/template-material/rax-multiple-component-template/.prettierrc.js b/packages/template-material/rax-multiple-component-template/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/rax-multiple-component-template/README.md b/packages/template-material/rax-multiple-component-template/README.md new file mode 100644 index 0000000..da2d866 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/README.md @@ -0,0 +1 @@ +# 移动端大包组件模板 diff --git a/packages/template-material/rax-multiple-component-template/commitlint.config.js b/packages/template-material/rax-multiple-component-template/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/rax-multiple-component-template/f2elint.config.js b/packages/template-material/rax-multiple-component-template/f2elint.config.js new file mode 100644 index 0000000..9cdb28f --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: false, + enableMarkdownlint: false, + enablePrettier: true, +}; diff --git a/packages/template-material/rax-multiple-component-template/package.json b/packages/template-material/rax-multiple-component-template/package.json new file mode 100644 index 0000000..11e6cc1 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/package.json @@ -0,0 +1,27 @@ +{ + "name": "@alilc/rax-multiple-component-template", + "version": "0.1.1", + "description": "rax 组件库模板", + "main": "lib/index.js", + "files": [ + "projectTemplate/", + "singleComponentTemplate/", + "singleDocTemplate/" + ], + "scripts": { + "f2elint-scan": "fie lint", + "f2elint-fix": "fie lint -fix" + }, + "author": "", + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + } +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.commitlintrc b/packages/template-material/rax-multiple-component-template/projectTemplate/.commitlintrc new file mode 100644 index 0000000..96654a0 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.commitlintrc @@ -0,0 +1,25 @@ +{ + "rules": { + "header-max-length": [2, "always", 72], + "subject-empty": [2, "never"], + "subject-full-stop": [2, "never", "."], + "type-empty": [2, "never"], + "type-case": [2, "always", "lower-case"], + "type-enum": [2, "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "temp" + ] + ] + } +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.editorconfig b/packages/template-material/rax-multiple-component-template/projectTemplate/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintignore new file mode 100644 index 0000000..05c40bc --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintignore @@ -0,0 +1,10 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +miniapp-preview/ +types/ +**/*.min.js +**/*-min.js +**/*.bundle.js diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintrc.js b/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintrc.js new file mode 100644 index 0000000..6cbbeec --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [ + 'eslint-config-ali/typescript/rax', + "prettier", + 'prettier/@typescript-eslint', + ], +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.gitignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.gitignore new file mode 100644 index 0000000..e3bebec --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.gitignore @@ -0,0 +1,98 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlint.json b/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlint.json new file mode 100644 index 0000000..c859bfb --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "extends": "markdownlint-config-ali" +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlintignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlintignore new file mode 100644 index 0000000..a40f6e3 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.markdownlintignore @@ -0,0 +1,4 @@ +node_modules/ +build/ +dist/ + diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.npmignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierignore new file mode 100644 index 0000000..ad20c13 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierignore @@ -0,0 +1,13 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +umd/ +miniapp-preview/ +types/ +.cachefile/ +deps.json +package-lock.json +yarn.lock +miniapp/**/*.axml diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierrc.js b/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintignore b/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintignore new file mode 100644 index 0000000..92b284c --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintignore @@ -0,0 +1,11 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +miniapp-preview/ +types/ +**/*.min.css +**/*-min.css +**/*.bundle.css + diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintrc.js b/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintrc.js new file mode 100644 index 0000000..74a5a54 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/.stylelintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: 'stylelint-config-ali', +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/CHANGELOG.md b/packages/template-material/rax-multiple-component-template/projectTemplate/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/README.md b/packages/template-material/rax-multiple-component-template/projectTemplate/README.md new file mode 100644 index 0000000..2177246 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/README.md @@ -0,0 +1,17 @@ +# <%= projectName %> + +一个面向移动端的跨端多包组件库 + +## 调试 +启动调试 + +```bash +npm start [demoName] +``` + +构建 + +```bash +npm run build +``` + diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/_gitignore b/packages/template-material/rax-multiple-component-template/projectTemplate/_gitignore new file mode 100644 index 0000000..ebdca34 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/_gitignore @@ -0,0 +1,101 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ + +.umi/ +.umi-production/ \ No newline at end of file diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/_npmignore b/packages/template-material/rax-multiple-component-template/projectTemplate/_npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/_npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/build.json b/packages/template-material/rax-multiple-component-template/projectTemplate/build.json new file mode 100644 index 0000000..7083026 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/build.json @@ -0,0 +1,17 @@ +{ + "type": "rax", + "inlineStyle": false, + "targets": [ + "web", + "miniapp", + "wechat-miniprogram" + ], + "library": "MyBizComponent", + "plugins": [ + "build-plugin-component-multiple", + "build-plugin-doc-multiple" + ], + "alias": { + "components": "./src/components" + } +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/build.lowcode.js b/packages/template-material/rax-multiple-component-template/projectTemplate/build.lowcode.js new file mode 100644 index 0000000..dc8ef54 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/build.lowcode.js @@ -0,0 +1,17 @@ +const { library } = require('./build.json'); + +module.exports = { + alias: { + '@': './src/components', + }, + plugins: [ + [ + '@alifd/build-plugin-lowcode', + { + library, + baseLibrary: 'rax', + engineScope: "<%= arguments[0].engineScope || '@ali' %>" + } + ], + ], +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/commitlint.config.js b/packages/template-material/rax-multiple-component-template/projectTemplate/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/README.md b/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/README.md new file mode 100644 index 0000000..0f8f0e5 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/README.md @@ -0,0 +1,9 @@ +--- +title: 示例组件 +description: 组件描述 +category: General +--- + +示例组件 + + diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/demo/basic.jsx b/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/demo/basic.jsx new file mode 100644 index 0000000..6d7af68 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/docs/example-component/demo/basic.jsx @@ -0,0 +1,12 @@ +/** + * @title 基础 + * @desc 这是一个基础 demo + * @order 1 + */ +/* @jsx createElement */ +import { createElement } from 'rax'; +import { ExampleComponent } from '<%= projectName %>'; + +export default () => { + return 组件示例; +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/f2elint.config.js b/packages/template-material/rax-multiple-component-template/projectTemplate/f2elint.config.js new file mode 100644 index 0000000..ff8f05d --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: true, + enableMarkdownlint: true, + enablePrettier: true, +}; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/package.json b/packages/template-material/rax-multiple-component-template/projectTemplate/package.json new file mode 100644 index 0000000..81932fa --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/package.json @@ -0,0 +1,94 @@ +{ + "name": "<%= projectName %>", + "version": "0.1.0", + "description": "", + "main": "lib/index.js", + "module": "es/index.js", + "unpkg": "dist/index.umd.js", + "typings": "types/index.d.ts", + "files": [ + "build", + "dist", + "lib", + "es", + "types" + ], + "logo": "https://gw.alicdn.com/imgextra/i2/O1CN01XA2RsI1fjjzUmc2kh_!!6000000004043-2-tps-243-240.png", + "scripts": { + "start": "build-scripts start", + "build": "build-scripts build", + "lowcode:dev": "build-scripts start --config ./build.lowcode.js", + "lowcode:build": "build-scripts build --config ./build.lowcode.js", + "lint": "fie lint", + "f2elint-scan": "f2elint scan", + "f2elint-fix": "f2elint fix", + "prepublishOnly": "npm run build && npm run lowcode:build" + }, + "keywords": [ + "Rax" + ], + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + }, + "lint-staged": { + "src/**/*.(ts|tsx)": [ + "tslint --fix", + "prettier --write", + "git add" + ], + "docs/**/*.md": [ + "prettier --write", + "git add" + ], + "@(docs|src)/**/*.@(js|jsx|ts|tsx)": [ + "eslint --fix", + "prettier --write", + "git add" + ] + }, + "peerDependencies": { + "rax": "^1.0.11" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.20", + "@alifd/build-plugin-lowcode": "^0.3.0", + "@types/rax": "^1.0.5", + "build-plugin-component-multiple": "^1.0.0-beta.13", + "build-plugin-doc-multiple": "^1.0.0-beta.8", + "driver-universal": "^3.1.0", + "eslint-plugin-jsx-plus": "^0.1.0", + "execa": "^2.0.5", + "expect.js": "^0.3.1", + "f2elint": "^1.2.0", + "husky": "^3.0.1", + "iceworks": "^3.4.5", + "jest": "^24.8.0", + "jest-cli": "^24.8.0", + "lint-staged": "^9.4.2", + "prettier": "^1.19.1", + "rax": "^1.0.11", + "ts-loader": "^6.0.4", + "ts-mocha": "^8.0.0", + "ts-node": "^9.1.1", + "tslint": "^5.18.0", + "tslint-config-ali": "^0.2.4", + "tslint-config-prettier": "^1.18.0", + "tslint-plugin-prettier": "^2.0.1", + "typescript": "^3.5.3" + }, + "dependencies": { + "rax-image": "^2.3.2", + "rax-text": "^2.1.2", + "rax-view": "^2.2.0", + "tslib": "^2.0.1" + }, + "nyc": { + "include": "src" + }, + "componentConfig": { + "isComponentLibrary": 1 + } +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/component.tsx b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/component.tsx new file mode 100644 index 0000000..487db3c --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/component.tsx @@ -0,0 +1,38 @@ +import { createElement, forwardRef, ForwardRefRenderFunction } from 'rax'; +import View from 'rax-view'; +import Text from 'rax-text'; +import './style.scss'; + +export interface ComponentProps { + /** + * 名称 + */ + name: string; + /** + * 子节点 + */ + children: any; +} + +/** + * 示例组件 + * @param props + * @constructor + */ +function ExampleComponent(props: ComponentProps, ref: any) { + return ( + + {props.name || ''} + {props.children} + + ); +} + +const RefComponent = forwardRef(ExampleComponent as ForwardRefRenderFunction); + +RefComponent.defaultProps = { + name: '标题', +}; +RefComponent.displayName = 'ExampleComponent'; + +export default RefComponent; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/index.ts b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/index.ts new file mode 100644 index 0000000..fbaa584 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/index.ts @@ -0,0 +1,4 @@ +import Component from './component'; + +export type { ComponentProps } from './component'; +export default Component; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/style.scss b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/style.scss new file mode 100644 index 0000000..9897c75 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/src/components/example-component/style.scss @@ -0,0 +1,17 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-top: 200rpx; +} + +.name { + color: #222; + font-size: 80rpx; +} + +.content { + color: #666; + font-size: 40rpx; +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/src/index.ts b/packages/template-material/rax-multiple-component-template/projectTemplate/src/index.ts new file mode 100644 index 0000000..1d3efac --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/src/index.ts @@ -0,0 +1,2 @@ +export { default as ExampleComponent } from './components/example-component'; +export type { ComponentProps } from './components/example-component'; diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/tsconfig.json b/packages/template-material/rax-multiple-component-template/projectTemplate/tsconfig.json new file mode 100644 index 0000000..11552bf --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ESNext", + "jsx": "preserve", + "jsxFactory": "createElement", + "declaration": false, + "outDir": "./lib", + "removeComments": true, + "strict": false, + "noImplicitAny": false, + "noImplicitThis": false, + "preserveConstEnums": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "noImplicitReturns": true, + "moduleResolution": "node", + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true, + "baseUrl": ".", + "paths": { + "*": [ + "src/*" + ] + } + }, + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "lib" + ] +} diff --git a/packages/template-material/rax-multiple-component-template/projectTemplate/tslint.json b/packages/template-material/rax-multiple-component-template/projectTemplate/tslint.json new file mode 100644 index 0000000..c412334 --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/projectTemplate/tslint.json @@ -0,0 +1,24 @@ +{ + "extends": ["tslint-config-ali", "tslint-config-prettier"], + "rules": { + "no-implicit-dependencies": [false, "src", "docs"], + "quotemark": [true, "single", "jsx-double"], + "no-empty": [true, "allow-empty-catch", "allow-empty-functions"], + "no-console": [true, "log"], + "variable-name": [ + false, + "check-format", + "allow-leading-underscore", + "allow-trailing-underscore", + "allow-pascal-case" + ], + "only-arrow-functions": false, + "object-literal-sort-keys": false, + "ordered-imports": false, + "interface-name": false, + "no-boolean-literal-compare": false + }, + "linterOptions": { + "exclude": ["node_modules/**"] + } +} diff --git a/packages/template-material/rax-multiple-component-template/tsconfig.json b/packages/template-material/rax-multiple-component-template/tsconfig.json new file mode 100644 index 0000000..fb2a43d --- /dev/null +++ b/packages/template-material/rax-multiple-component-template/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "strictNullChecks": false, + "jsx": "react", + "target": "esnext", + "experimentalDecorators": true, + "skipLibCheck": true, + "declaration": true, + "lib": [ + "dom", + "es5", + "es6", + "es7", + "scripthost", + "es2018.promise" + ], + "emitDecoratorMetadata": true, + "preserveConstEnums": true, + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/packages/template-material/rax-single-component-template/.editorconfig b/packages/template-material/rax-single-component-template/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/rax-single-component-template/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/rax-single-component-template/.eslintignore b/packages/template-material/rax-single-component-template/.eslintignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/packages/template-material/rax-single-component-template/.eslintignore @@ -0,0 +1 @@ +node_modules/ diff --git a/packages/template-material/rax-single-component-template/.eslintrc.js b/packages/template-material/rax-single-component-template/.eslintrc.js new file mode 100644 index 0000000..7c06200 --- /dev/null +++ b/packages/template-material/rax-single-component-template/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['eslint-config-ali/typescript/node', 'prettier', 'prettier/@typescript-eslint'], + rules: { + '@typescript-eslint/no-require-imports': 0, + }, +}; diff --git a/packages/template-material/rax-single-component-template/.gitignore b/packages/template-material/rax-single-component-template/.gitignore new file mode 100644 index 0000000..8c8419a --- /dev/null +++ b/packages/template-material/rax-single-component-template/.gitignore @@ -0,0 +1,18 @@ +logs/ +npm-debug.log +yarn-error.log +node_modules/ +package-lock.json +yarn.lock +coverage/ +.idea/ +run/ +.DS_Store +*.sw* +*.un~ +.tsbuildinfo +.tsbuildinfo.* +/dist/ +.nodejs-cache/ +.nodejs-cache +dist diff --git a/packages/template-material/rax-single-component-template/.prettierrc.js b/packages/template-material/rax-single-component-template/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/rax-single-component-template/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/rax-single-component-template/README.md b/packages/template-material/rax-single-component-template/README.md new file mode 100644 index 0000000..be443ee --- /dev/null +++ b/packages/template-material/rax-single-component-template/README.md @@ -0,0 +1 @@ +# 移动端单包组件模板 diff --git a/packages/template-material/rax-single-component-template/commitlint.config.js b/packages/template-material/rax-single-component-template/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/rax-single-component-template/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/rax-single-component-template/f2elint.config.js b/packages/template-material/rax-single-component-template/f2elint.config.js new file mode 100644 index 0000000..9cdb28f --- /dev/null +++ b/packages/template-material/rax-single-component-template/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: false, + enableMarkdownlint: false, + enablePrettier: true, +}; diff --git a/packages/template-material/rax-single-component-template/package.json b/packages/template-material/rax-single-component-template/package.json new file mode 100644 index 0000000..aa70c0f --- /dev/null +++ b/packages/template-material/rax-single-component-template/package.json @@ -0,0 +1,25 @@ +{ + "name": "@alilc/rax-single-component-template", + "version": "0.1.1", + "description": "rax 单组件模板", + "files": [ + "projectTemplate/" + ], + "main": "lib/index.js", + "scripts": { + "f2elint-scan": "fie lint", + "f2elint-fix": "fie lint -fix" + }, + "author": "", + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + } +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.commitlintrc b/packages/template-material/rax-single-component-template/projectTemplate/.commitlintrc new file mode 100644 index 0000000..96654a0 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.commitlintrc @@ -0,0 +1,25 @@ +{ + "rules": { + "header-max-length": [2, "always", 72], + "subject-empty": [2, "never"], + "subject-full-stop": [2, "never", "."], + "type-empty": [2, "never"], + "type-case": [2, "always", "lower-case"], + "type-enum": [2, "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "temp" + ] + ] + } +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.editorconfig b/packages/template-material/rax-single-component-template/projectTemplate/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.eslintignore b/packages/template-material/rax-single-component-template/projectTemplate/.eslintignore new file mode 100644 index 0000000..05c40bc --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.eslintignore @@ -0,0 +1,10 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +miniapp-preview/ +types/ +**/*.min.js +**/*-min.js +**/*.bundle.js diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.eslintrc.js b/packages/template-material/rax-single-component-template/projectTemplate/.eslintrc.js new file mode 100644 index 0000000..6cbbeec --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [ + 'eslint-config-ali/typescript/rax', + "prettier", + 'prettier/@typescript-eslint', + ], +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.gitignore b/packages/template-material/rax-single-component-template/projectTemplate/.gitignore new file mode 100644 index 0000000..e3bebec --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.gitignore @@ -0,0 +1,98 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.markdownlint.json b/packages/template-material/rax-single-component-template/projectTemplate/.markdownlint.json new file mode 100644 index 0000000..c859bfb --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "extends": "markdownlint-config-ali" +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.markdownlintignore b/packages/template-material/rax-single-component-template/projectTemplate/.markdownlintignore new file mode 100644 index 0000000..92ea40e --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.markdownlintignore @@ -0,0 +1,7 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +miniapp-preview/ +types/ diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.npmignore b/packages/template-material/rax-single-component-template/projectTemplate/.npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.prettierignore b/packages/template-material/rax-single-component-template/projectTemplate/.prettierignore new file mode 100644 index 0000000..ad20c13 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.prettierignore @@ -0,0 +1,13 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +umd/ +miniapp-preview/ +types/ +.cachefile/ +deps.json +package-lock.json +yarn.lock +miniapp/**/*.axml diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.prettierrc.js b/packages/template-material/rax-single-component-template/projectTemplate/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.stylelintignore b/packages/template-material/rax-single-component-template/projectTemplate/.stylelintignore new file mode 100644 index 0000000..92b284c --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.stylelintignore @@ -0,0 +1,11 @@ +node_modules/ +build/ +dist/ +es/ +lib/ +miniapp-preview/ +types/ +**/*.min.css +**/*-min.css +**/*.bundle.css + diff --git a/packages/template-material/rax-single-component-template/projectTemplate/.stylelintrc.js b/packages/template-material/rax-single-component-template/projectTemplate/.stylelintrc.js new file mode 100644 index 0000000..74a5a54 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/.stylelintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: 'stylelint-config-ali', +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/CHANGELOG.md b/packages/template-material/rax-single-component-template/projectTemplate/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/template-material/rax-single-component-template/projectTemplate/README.md b/packages/template-material/rax-single-component-template/projectTemplate/README.md new file mode 100644 index 0000000..deff6d1 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/README.md @@ -0,0 +1,28 @@ +--- +title: 示例组件 +description: 组件描述 +category: General +--- + +一个面向移动端的跨端单组件包 + +## 使用 + +```bash +npm install <%= projectName %> --save +``` + + +## 调试 +启动调试 + +```bash +npm start +``` + +构建 + +```bash +npm run build +``` + diff --git a/packages/template-material/rax-single-component-template/projectTemplate/_gitignore b/packages/template-material/rax-single-component-template/projectTemplate/_gitignore new file mode 100644 index 0000000..ebdca34 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/_gitignore @@ -0,0 +1,101 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ + +.umi/ +.umi-production/ \ No newline at end of file diff --git a/packages/template-material/rax-single-component-template/projectTemplate/_npmignore b/packages/template-material/rax-single-component-template/projectTemplate/_npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/_npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/rax-single-component-template/projectTemplate/build.json b/packages/template-material/rax-single-component-template/projectTemplate/build.json new file mode 100644 index 0000000..43b5762 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/build.json @@ -0,0 +1,15 @@ +{ + "type": "rax", + "inlineStyle": false, + "targets": ["web", "miniapp", "wechat-miniprogram"], + "library": "MyBizComponent", + "plugins": [ + [ + "build-plugin-component-multiple", + { + "multiple": false + } + ], + "build-plugin-doc-multiple" + ] +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/build.lowcode.js b/packages/template-material/rax-single-component-template/projectTemplate/build.lowcode.js new file mode 100644 index 0000000..9a24249 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/build.lowcode.js @@ -0,0 +1,17 @@ +const { library } = require('./build.json'); + +module.exports = { + alias: { + '@': './src', + }, + plugins: [ + [ + '@alifd/build-plugin-lowcode', + { + library, + baseLibrary: 'rax', + engineScope: "<%= arguments[0].engineScope || '@ali' %>" + } + ], + ], +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/commitlint.config.js b/packages/template-material/rax-single-component-template/projectTemplate/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/demo/advance.jsx b/packages/template-material/rax-single-component-template/projectTemplate/demo/advance.jsx new file mode 100644 index 0000000..1813dc6 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/demo/advance.jsx @@ -0,0 +1,12 @@ +/** + * @title 高级 + * @desc 这是一个高级 demo + * @order 2 + */ +/* @jsx createElement */ +import { createElement } from 'rax'; +import Component from '<%= projectName %>'; + +export default () => { + return 高级组件示例; +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/demo/basic.jsx b/packages/template-material/rax-single-component-template/projectTemplate/demo/basic.jsx new file mode 100644 index 0000000..e392425 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/demo/basic.jsx @@ -0,0 +1,12 @@ +/** + * @title 基础 + * @desc 这是一个基础 demo + * @order 1 + */ +/* @jsx createElement */ +import { createElement } from 'rax'; +import Component from '<%= projectName %>'; + +export default () => { + return 组件示例; +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/f2elint.config.js b/packages/template-material/rax-single-component-template/projectTemplate/f2elint.config.js new file mode 100644 index 0000000..ff8f05d --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: true, + enableMarkdownlint: true, + enablePrettier: true, +}; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/package.json b/packages/template-material/rax-single-component-template/projectTemplate/package.json new file mode 100644 index 0000000..ec2615e --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/package.json @@ -0,0 +1,107 @@ +{ + "name": "<%= projectName %>", + "version": "0.1.0", + "description": "", + "main": "lib/index.js", + "module": "es/index.js", + "unpkg": "dist/index.umd.js", + "typings": "types/index.d.ts", + "files": [ + "build", + "dist", + "lib", + "es", + "types" + ], + "logo": "https://gw.alicdn.com/imgextra/i2/O1CN01XA2RsI1fjjzUmc2kh_!!6000000004043-2-tps-243-240.png", + "scripts": { + "start": "build-scripts start", + "build": "build-scripts build", + "lowcode:dev": "build-scripts start --config ./build.lowcode.js", + "lowcode:build": "build-scripts build --config ./build.lowcode.js", + "lint": "fie lint", + "f2elint-scan": "f2elint scan", + "f2elint-fix": "f2elint fix", + "prepublishOnly": "npm run build && npm run lowcode:build" + }, + "keywords": [ + "Rax" + ], + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + }, + "lint-staged": { + "src/**/*.(ts|tsx)": [ + "tslint --fix", + "prettier --write", + "git add" + ], + "docs/**/*.md": [ + "prettier --write", + "git add" + ], + "@(docs|src)/**/*.@(js|jsx|ts|tsx)": [ + "eslint --fix", + "prettier --write", + "git add" + ] + }, + "peerDependencies": { + "rax": "^1.0.11" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.20", + "@alifd/build-plugin-lowcode": "^0.3.0", + "@types/rax": "^1.0.5", + "build-plugin-component-multiple": "^1.0.0-beta.13", + "build-plugin-doc-multiple": "^1.0.0-beta.8", + "eslint-plugin-jsx-plus": "^0.1.0", + "driver-universal": "^3.1.0", + "execa": "^2.0.5", + "expect.js": "^0.3.1", + "f2elint": "^1.2.0", + "husky": "^3.0.1", + "iceworks": "^3.4.5", + "jest": "^24.8.0", + "jest-cli": "^24.8.0", + "lint-staged": "^9.4.2", + "prettier": "^1.19.1", + "rax": "^1.0.11", + "ts-loader": "^6.0.4", + "ts-mocha": "^8.0.0", + "ts-node": "^9.1.1", + "tslint": "^5.18.0", + "tslint-config-ali": "^0.2.4", + "tslint-config-prettier": "^1.18.0", + "tslint-plugin-prettier": "^2.0.1", + "typescript": "^3.5.3" + }, + "dependencies": { + "rax-image": "^2.3.2", + "rax-text": "^2.1.2", + "rax-view": "^2.2.0", + "tslib": "^2.0.1" + }, + "resolutions": { + "webpack": "^4.46.x" + }, + "nyc": { + "include": "src" + }, + <% if (!_.isUndefined((arguments[0] || {}).group)) { %> + "publishConfig": { + "registry": "https://registry.npm.alibaba-inc.com" + }, + "homepage": "https://mc-fusion.alibaba-inc.com/unpkg/<%= projectName %>/build/index.html", + "repository": { + "type": "git", + "url": "git@gitlab.alibaba-inc.com:<%=group%>/<%=project%>.git" + }, + <% } %> + "componentConfig": { + "isComponentLibrary": 0 + } +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/src/component.tsx b/packages/template-material/rax-single-component-template/projectTemplate/src/component.tsx new file mode 100644 index 0000000..487db3c --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/src/component.tsx @@ -0,0 +1,38 @@ +import { createElement, forwardRef, ForwardRefRenderFunction } from 'rax'; +import View from 'rax-view'; +import Text from 'rax-text'; +import './style.scss'; + +export interface ComponentProps { + /** + * 名称 + */ + name: string; + /** + * 子节点 + */ + children: any; +} + +/** + * 示例组件 + * @param props + * @constructor + */ +function ExampleComponent(props: ComponentProps, ref: any) { + return ( + + {props.name || ''} + {props.children} + + ); +} + +const RefComponent = forwardRef(ExampleComponent as ForwardRefRenderFunction); + +RefComponent.defaultProps = { + name: '标题', +}; +RefComponent.displayName = 'ExampleComponent'; + +export default RefComponent; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/src/index.ts b/packages/template-material/rax-single-component-template/projectTemplate/src/index.ts new file mode 100644 index 0000000..23ea0fb --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/src/index.ts @@ -0,0 +1,3 @@ +import Component, { ComponentProps } from './component'; + +export { Component as default, ComponentProps }; diff --git a/packages/template-material/rax-single-component-template/projectTemplate/src/style.scss b/packages/template-material/rax-single-component-template/projectTemplate/src/style.scss new file mode 100644 index 0000000..9897c75 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/src/style.scss @@ -0,0 +1,17 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-top: 200rpx; +} + +.name { + color: #222; + font-size: 80rpx; +} + +.content { + color: #666; + font-size: 40rpx; +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/tsconfig.json b/packages/template-material/rax-single-component-template/projectTemplate/tsconfig.json new file mode 100644 index 0000000..7c71b38 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ESNext", + "jsx": "preserve", + "jsxFactory": "createElement", + "declaration": false, + "outDir": "./lib", + "removeComments": true, + "strict": false, + "noImplicitAny": false, + "noImplicitThis": false, + "preserveConstEnums": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "noImplicitReturns": true, + "moduleResolution": "node", + "baseUrl": "./", + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true + }, + "include": ["src"], + "exclude": ["node_modules", "lib"] +} diff --git a/packages/template-material/rax-single-component-template/projectTemplate/tslint.json b/packages/template-material/rax-single-component-template/projectTemplate/tslint.json new file mode 100644 index 0000000..24b4e52 --- /dev/null +++ b/packages/template-material/rax-single-component-template/projectTemplate/tslint.json @@ -0,0 +1,24 @@ +{ + "extends": ["tslint-config-ali", "tslint-config-prettier"], + "rules": { + "no-implicit-dependencies": [true, "dev"], + "quotemark": [true, "single", "jsx-double"], + "no-empty": [true, "allow-empty-catch", "allow-empty-functions"], + "no-console": [true, "log"], + "variable-name": [ + false, + "check-format", + "allow-leading-underscore", + "allow-trailing-underscore", + "allow-pascal-case" + ], + "only-arrow-functions": false, + "object-literal-sort-keys": false, + "ordered-imports": false, + "interface-name": false, + "no-boolean-literal-compare": false + }, + "linterOptions": { + "exclude": ["node_modules/**"] + } +} diff --git a/packages/template-material/rax-single-component-template/tsconfig.json b/packages/template-material/rax-single-component-template/tsconfig.json new file mode 100644 index 0000000..fb2a43d --- /dev/null +++ b/packages/template-material/rax-single-component-template/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "strictNullChecks": false, + "jsx": "react", + "target": "esnext", + "experimentalDecorators": true, + "skipLibCheck": true, + "declaration": true, + "lib": [ + "dom", + "es5", + "es6", + "es7", + "scripthost", + "es2018.promise" + ], + "emitDecoratorMetadata": true, + "preserveConstEnums": true, + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/packages/template-material/react-multiple-component-template/.gitignore b/packages/template-material/react-multiple-component-template/.gitignore new file mode 100644 index 0000000..3180816 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/.gitignore @@ -0,0 +1,97 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ diff --git a/packages/template-material/react-multiple-component-template/README.md b/packages/template-material/react-multiple-component-template/README.md new file mode 100644 index 0000000..69c1887 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/README.md @@ -0,0 +1 @@ +# PC大包组件模板 diff --git a/packages/template-material/react-multiple-component-template/commitlint.config.js b/packages/template-material/react-multiple-component-template/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/react-multiple-component-template/f2elint.config.js b/packages/template-material/react-multiple-component-template/f2elint.config.js new file mode 100644 index 0000000..9cdb28f --- /dev/null +++ b/packages/template-material/react-multiple-component-template/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: false, + enableMarkdownlint: false, + enablePrettier: true, +}; diff --git a/packages/template-material/react-multiple-component-template/package.json b/packages/template-material/react-multiple-component-template/package.json new file mode 100644 index 0000000..87439f6 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/package.json @@ -0,0 +1,24 @@ +{ + "name": "@alilc/react-multiple-component-template", + "version": "0.1.6", + "description": "react 组件库模板", + "files": [ + "projectTemplate/*" + ], + "scripts": { + "f2elint-scan": "fie lint", + "f2elint-fix": "fie lint -fix" + }, + "author": "", + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + } +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.commitlintrc b/packages/template-material/react-multiple-component-template/projectTemplate/.commitlintrc new file mode 100644 index 0000000..96654a0 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.commitlintrc @@ -0,0 +1,25 @@ +{ + "rules": { + "header-max-length": [2, "always", 72], + "subject-empty": [2, "never"], + "subject-full-stop": [2, "never", "."], + "type-empty": [2, "never"], + "type-case": [2, "always", "lower-case"], + "type-enum": [2, "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "temp" + ] + ] + } +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.editorconfig b/packages/template-material/react-multiple-component-template/projectTemplate/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.eslintignore b/packages/template-material/react-multiple-component-template/projectTemplate/.eslintignore new file mode 100644 index 0000000..ec02607 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.eslintignore @@ -0,0 +1,6 @@ +node_modules/ +build/ +dist/ +**/*.min.js +**/*-min.js +**/*.bundle.js diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.eslintrc.js b/packages/template-material/react-multiple-component-template/projectTemplate/.eslintrc.js new file mode 100644 index 0000000..1744b9b --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [ + 'eslint-config-ali/typescript/react', + "prettier", + 'prettier/@typescript-eslint', + 'prettier/react', + ], +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlint.json b/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlint.json new file mode 100644 index 0000000..c859bfb --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "extends": "markdownlint-config-ali" +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlintignore b/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlintignore new file mode 100644 index 0000000..a40f6e3 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.markdownlintignore @@ -0,0 +1,4 @@ +node_modules/ +build/ +dist/ + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.prettierignore b/packages/template-material/react-multiple-component-template/projectTemplate/.prettierignore new file mode 100644 index 0000000..98de8f2 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.prettierignore @@ -0,0 +1,11 @@ +node_modules/ +lib/ +build/ +dist/ +umd/ +es/ +.cachefile/ +deps.json +package-lock.json +yarn.lock +miniapp/**/*.axml diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.prettierrc.js b/packages/template-material/react-multiple-component-template/projectTemplate/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintignore b/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintignore new file mode 100644 index 0000000..89707c0 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintignore @@ -0,0 +1,7 @@ +node_modules/ +build/ +dist/ +**/*.min.css +**/*-min.css +**/*.bundle.css + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintrc.js b/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintrc.js new file mode 100644 index 0000000..74a5a54 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/.stylelintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: 'stylelint-config-ali', +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/CHANGELOG.md b/packages/template-material/react-multiple-component-template/projectTemplate/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/README.md b/packages/template-material/react-multiple-component-template/projectTemplate/README.md new file mode 100644 index 0000000..4f4be1c --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/README.md @@ -0,0 +1,17 @@ +# <%= projectName %> + +一个面向 PC 的业务组件库 + +## 调试 +启动调试 + +``` +npm run lowcode:dev # 打开开发环境,运行所有组件 +``` + +构建 + +``` +npm run lowcode:build +``` + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/_gitignore b/packages/template-material/react-multiple-component-template/projectTemplate/_gitignore new file mode 100644 index 0000000..a981ed0 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/_gitignore @@ -0,0 +1,103 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +lowcode_es/ +lowcode_lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ + +.umi/ +.umi-production/ \ No newline at end of file diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/_npmignore b/packages/template-material/react-multiple-component-template/projectTemplate/_npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/_npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/build.json b/packages/template-material/react-multiple-component-template/projectTemplate/build.json new file mode 100644 index 0000000..c67549d --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/build.json @@ -0,0 +1,16 @@ +{ + "library": "BizComps", + "libraryTarget": "umd", + "sourceMap": true, + "alias": { + "@": "./src/components" + }, + "plugins": [ + [ + "build-plugin-component", + { + "themePackage": "@alifd/theme-2" + } + ] + ] +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/build.lowcode.js b/packages/template-material/react-multiple-component-template/projectTemplate/build.lowcode.js new file mode 100644 index 0000000..6536047 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/build.lowcode.js @@ -0,0 +1,16 @@ +const { library } = require('./build.json'); + +module.exports = { + alias: { + '@': './src', + }, + plugins: [ + [ + '@alifd/build-plugin-lowcode', + { + library, + engineScope: "<%= arguments[0].engineScope || '@ali' %>" + }, + ], + ], +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/commitlint.config.js b/packages/template-material/react-multiple-component-template/projectTemplate/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/API.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/API.tsx new file mode 100644 index 0000000..6cdc6c5 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/API.tsx @@ -0,0 +1,74 @@ +import React, { useContext } from 'react'; +import type { IApiComponentProps } from 'dumi/theme'; +import { context, useApiData } from 'dumi/theme'; + +import './index.scss'; + +const LOCALE_TEXTS = { + 'zh-CN': { + name: '参数', + description: '说明', + type: '类型', + default: '默认值', + required: '(必选)', + }, + 'en-US': { + name: 'Name', + description: 'Description', + type: 'Type', + default: 'Default', + required: '(required)', + }, +}; + +export default ({ identifier, export: expt }: IApiComponentProps) => { + const data = useApiData(identifier); + const { locale = '' } = useContext(context); + + const texts = /^zh|cn$/i.test(locale) ? LOCALE_TEXTS['zh-CN'] : LOCALE_TEXTS['en-US']; + + const defaultComponentName = identifier + ?.replace(/-([a-z])/g, function (all, i) { + return i.toUpperCase(); + }) + ?.replace(/^\S/, (s) => s.toUpperCase()); + + return ( + <> + {data && ( + <> +

+ + {expt === 'default' ? defaultComponentName : expt} +

+ + + + + + + + + + + {data[expt]?.map((row) => ( + + + + + + + ))} + +
{texts.name}{texts.description}{texts.type}{texts.default}
{row.identifier}{row.description || '--'} + {row.type} + + {row.default || (row.required && texts.required) || '--'} +
+ + )} + + ); +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/index.scss b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/index.scss new file mode 100644 index 0000000..433f7c7 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/builtins/index.scss @@ -0,0 +1,57 @@ +.apiContainer { + border: none !important; + .apiTitle{ + text-transform: capitalize; + } + thead tr { + th { + background: #fff; + border: none; + font-weight: 700; + text-align: left; + word-wrap: break-word; + letter-spacing: 0.2px; + padding: 4px 0 10px; + border-bottom: 2px solid #333; + font-size: 14px; + &:first-child { + padding-left: 8px; + } + } + } + tbody tr { + td { + border: none; + border-bottom: 1px solid #ccc; + text-align: left; + margin: 0; + padding: 18px 18px 18px 0; + color: #666; + word-wrap: break-word; + line-height: 24px; + letter-spacing: 0.2px; + font-size: 14px; + code { + color: #666; + word-wrap: break-word; + line-height: 24px; + letter-spacing: 0.2px; + font-size: 13px; + } + &:last-child { + min-width: 72px; + } + &:first-child{ + color: #595959; + font-weight: 600; + white-space: nowrap; + padding-left: 8px; + font-size: 14px; + } + } + } +} + +.__dumi-default-layout-footer-meta { + border: none; +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/layout.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/layout.tsx new file mode 100644 index 0000000..5e71efe --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.dumi/theme/layout.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +import Layout from 'dumi-theme-default/es/layout'; + +import '@/index.scss'; +import '@alifd/theme-2/dist/next.min.css'; + +export default ({ children, ...props }) => { + return {children}; +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/.umirc.ts b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.umirc.ts new file mode 100644 index 0000000..dea3658 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/.umirc.ts @@ -0,0 +1,68 @@ +import { defineConfig } from 'dumi'; +import fs from 'fs'; +import { join } from 'path'; + +const { version } = JSON.parse(fs.readFileSync(join(__dirname, '../package.json'), 'utf8')); + +const productStyles = + '.__dumi-default-menu{display:none} .__dumi-default-layout{padding-left:58px!important}'; + +const productPath = `/<%= projectName %>@${version}/build/docs/`; + +export default defineConfig({ + // other config entry + chainWebpack(memo) { + memo.module + .rule('js') + .include.add(join(__dirname, '../')) + .end() + .exclude.add(/node_modules/); + + // 删除 dumi 内置插件 + memo.plugins.delete('friendly-error'); + memo.plugins.delete('copy'); + // 配置文件import alias + memo.resolve.alias.set('@', join(__dirname, '../src')); + memo.resolve.alias.set('@components', join(__dirname, '../src/components')); + memo.resolve.alias.set('<%= projectName %>', join(__dirname, '../src')); + }, + logo: 'https://fusion.alicdn.com/images/jdSvK6gaqaWB.png', + exportStatic: process.env.NODE_ENV === 'production' ? { htmlSuffix: true } : {}, + base: process.env.NODE_ENV === 'production' ? productPath : '/', + publicPath: process.env.NODE_ENV === 'production' ? productPath : '/', + styles: process.env.NODE_ENV === 'production' ? [productStyles] : [], + nodeModulesTransform: { + type: 'none', + exclude: [], + }, + // md文件中使用@需配置alias + alias: { + '@': join(__dirname, '../src'), + '@components': join(__dirname, '../src/components'), + '<%= projectName %>': join(__dirname, '../src'), + }, + apiParser: { + propFilter: (prop) => { + if (prop.declarations !== undefined && prop.declarations.length > 0) { + const hasPropAdditionalDescription = prop.declarations.find((declaration) => { + if (declaration.fileName.includes('node_modules')) { + return ( + declaration.fileName.includes('alifd/next') || + declaration.fileName.includes('bizcharts') + ); + } + return true; + }); + + return Boolean(hasPropAdditionalDescription); + } + return true; + }, + }, + mfsu: {}, + locales: [ + ['zh-CN', '中文'], + ['en-US', 'English'], + ], + outputPath: '../build/docs', +}); diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-button/index.md b/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-button/index.md new file mode 100644 index 0000000..740f36d --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-button/index.md @@ -0,0 +1,21 @@ +## 何时使用 + +适合表单场景。 + +## 示例 + +```tsx +import React from 'react'; +import { ColorfulButton } from '<%= projectName %>'; + + +export default () => { + return
+ +
+}; +``` + +## API + + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-input/index.md b/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-input/index.md new file mode 100644 index 0000000..62f6f9d --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/docs/src/colorful-input/index.md @@ -0,0 +1,21 @@ +## 何时使用 + +适合表单场景。 + +## 示例 + +```tsx +import React from 'react'; +import { ColorfulInput } from '<%= projectName %>'; + + +export default () => { + return
+ +
+}; +``` + +## API + + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/f2elint.config.js b/packages/template-material/react-multiple-component-template/projectTemplate/f2elint.config.js new file mode 100644 index 0000000..ff8f05d --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: true, + enableMarkdownlint: true, + enablePrettier: true, +}; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/package.json b/packages/template-material/react-multiple-component-template/projectTemplate/package.json new file mode 100644 index 0000000..07a2424 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/package.json @@ -0,0 +1,92 @@ +{ + "name": "<%= projectName %>", + "version": "0.1.0", + "description": "<%= description %>", + "main": "lib/index.js", + "module": "es/index.js", + "exports": { + "./*": "./*", + ".": { + "import": "./es/index.js", + "require": "./lib/index.js" + } + }, + "typings": "types/index.d.ts", + "files": [ + "build/", + "dist/", + "lib/", + "es/", + "types/", + "lowcode/", + "lowcode_lib/", + "lowcode_es/" + ], + "scripts": { + "start": "npm run dumi", + "build": "build-scripts build", + "lowcode:dev": "build-scripts start --config ./build.lowcode.js", + "lowcode:build": "build-scripts build --config ./build.lowcode.js", + "f2elint-scan": "f2elint scan", + "f2elint-fix": "f2elint fix", + "dumi": "cross-env APP_ROOT=docs dumi dev", + "dumi:build": "cross-env APP_ROOT=docs dumi build", + "prepublishOnly": "npm run build && npm run lowcode:build && npm run dumi:build" + }, + "directories": { + "test": "test" + }, + "keywords": [ + "Fusion" + ], + "author": "fusion-team", + "license": "MIT", + "husky": { + "hooks": { + "pre-commit": "f2elint commit-file-scan", + "commit-msg": "f2elint commit-msg-scan" + } + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,vue}": "f2elint exec eslint", + "**/*.{css,scss,less,acss}": "f2elint exec stylelint" + }, + "peerDependencies": { + "react": "^16.x", + "react-dom": "^16.x", + "moment": "latest" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.3", + "@alifd/build-plugin-lowcode": "^0.4.0", + "@alifd/theme-2": "^0.4.0", + "@types/react": "^16.14.24", + "@types/react-dom": "^16.9.4", + "build-plugin-component": "^1.12.1", + "build-plugin-fusion": "^0.1.0", + "cross-env": "^7.0.3", + "@umijs/plugin-sass": "^1.1.1", + "dumi": "^1.1.49", + "dumi-theme-default": "^1.1.24", + "f2elint": "^1.2.0" + }, + "dependencies": { + "moment": "^2.29.4", + "@alifd/next": "^1.25.27", + "prop-types": "^15.5.8", + "react": "^16.x", + "react-dom": "^16.x" + }, + "acceptDependencies": { + "webpack": "^4.46.x" + }, + "resolutions": { + "webpack": "^4.46.x" + }, + "componentConfig": { + "isComponentLibrary": true + }, + "lcMeta": { + "type": "component" + } +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/colorful-button.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/colorful-button.tsx new file mode 100644 index 0000000..175b7c1 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/colorful-button.tsx @@ -0,0 +1,35 @@ +import * as React from 'react'; +import { createElement } from 'react'; +import { Button } from '@alifd/next'; +import './index.scss'; + +export interface ColorfulButtonProps { + /** + * 类型 + */ + type?: "primary" | "secondary" | "normal"; + color?: string; + style?: object; +} + +const ColorfulButton: React.FC = function ColorfulButton({ + type = 'primary', + color, + style = {}, + ...otherProps +}) { + const _style = style || {}; + if (color) { + _style.backgroundColor = color; + } + const _otherProps = otherProps || {}; + _otherProps.style = _style; + return ( + + ); +}; + +ColorfulButton.displayName = 'ColorfulButton'; +export default ColorfulButton; + + diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.scss b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.scss new file mode 100644 index 0000000..35c2a38 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.scss @@ -0,0 +1,5 @@ +@import '../../variables.scss'; + +#{$biz-css-prefix}-colorful-button { + border: 2px dashed blue; +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.tsx new file mode 100644 index 0000000..44bffc9 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-button/index.tsx @@ -0,0 +1,4 @@ +import ColorfulButton from './colorful-button'; + +export type { ColorfulButtonProps } from './colorful-button'; +export default ColorfulButton; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/colorful-input.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/colorful-input.tsx new file mode 100644 index 0000000..c0354bd --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/colorful-input.tsx @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { createElement } from 'react'; +import { Input } from '@alifd/next'; +import { bizCssPrefix } from '../../variables'; +import './index.scss'; + +export interface ColorfulInputProps { + color?: string; + style?: object; +} + +const ColorfulInput: React.FC = function ColorfulInput({ + color, + style = {}, + ...otherProps +}) { + const _style = style || {}; + if (color) { + _style.backgroundColor = color; + } + const _otherProps = otherProps || {}; + _otherProps.style = _style; + return ( + + ); +}; + +export default ColorfulInput; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.scss b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.scss new file mode 100644 index 0000000..35c2a38 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.scss @@ -0,0 +1,5 @@ +@import '../../variables.scss'; + +#{$biz-css-prefix}-colorful-button { + border: 2px dashed blue; +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.tsx new file mode 100644 index 0000000..fd371d9 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/components/colorful-input/index.tsx @@ -0,0 +1,4 @@ +import ColorfulInput from './colorful-input'; + +export type { ColorfulInputProps } from './colorful-input'; +export default ColorfulInput; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/index.scss b/packages/template-material/react-multiple-component-template/projectTemplate/src/index.scss new file mode 100644 index 0000000..89f68d2 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/index.scss @@ -0,0 +1,2 @@ +@import './components/colorful-button/index.scss'; +@import './components/colorful-input/index.scss'; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/index.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/index.tsx new file mode 100644 index 0000000..d4f9446 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/index.tsx @@ -0,0 +1,11 @@ +export type { ColorfulButtonProps } from './components/colorful-button'; +export { default as ColorfulButton } from './components/colorful-button'; + +export type { ColorfulInputProps } from './components/colorful-input'; +export { default as ColorfulInput } from './components/colorful-input'; + +const bizCssPrefix = 'bizpack'; + +export { + bizCssPrefix +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.scss b/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.scss new file mode 100644 index 0000000..3f74226 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.scss @@ -0,0 +1,3 @@ +@import '~@alifd/next/variables.scss'; + +$biz-css-prefix: '.bizpack'; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.tsx b/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.tsx new file mode 100644 index 0000000..5ffa6c7 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/src/variables.tsx @@ -0,0 +1,3 @@ +const bizCssPrefix = 'bizpack'; + +export { bizCssPrefix }; diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/tsconfig.json b/packages/template-material/react-multiple-component-template/projectTemplate/tsconfig.json new file mode 100644 index 0000000..296912c --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ESNext", + "jsx": "react", + "jsxFactory": "createElement", + "declaration": false, + "outDir": "./lib", + "removeComments": true, + "strict": false, + "noImplicitAny": false, + "noImplicitThis": false, + "preserveConstEnums": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "noImplicitReturns": true, + "moduleResolution": "node", + "baseUrl": "./", + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true + }, + "include": ["src"], + "exclude": ["node_modules", "lib"] +} diff --git a/packages/template-material/react-multiple-component-template/projectTemplate/tslint.json b/packages/template-material/react-multiple-component-template/projectTemplate/tslint.json new file mode 100644 index 0000000..24b4e52 --- /dev/null +++ b/packages/template-material/react-multiple-component-template/projectTemplate/tslint.json @@ -0,0 +1,24 @@ +{ + "extends": ["tslint-config-ali", "tslint-config-prettier"], + "rules": { + "no-implicit-dependencies": [true, "dev"], + "quotemark": [true, "single", "jsx-double"], + "no-empty": [true, "allow-empty-catch", "allow-empty-functions"], + "no-console": [true, "log"], + "variable-name": [ + false, + "check-format", + "allow-leading-underscore", + "allow-trailing-underscore", + "allow-pascal-case" + ], + "only-arrow-functions": false, + "object-literal-sort-keys": false, + "ordered-imports": false, + "interface-name": false, + "no-boolean-literal-compare": false + }, + "linterOptions": { + "exclude": ["node_modules/**"] + } +} diff --git a/packages/template-material/react-multiple-component-template/tsconfig.json b/packages/template-material/react-multiple-component-template/tsconfig.json new file mode 100644 index 0000000..fb2a43d --- /dev/null +++ b/packages/template-material/react-multiple-component-template/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "strictNullChecks": false, + "jsx": "react", + "target": "esnext", + "experimentalDecorators": true, + "skipLibCheck": true, + "declaration": true, + "lib": [ + "dom", + "es5", + "es6", + "es7", + "scripthost", + "es2018.promise" + ], + "emitDecoratorMetadata": true, + "preserveConstEnums": true, + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/packages/template-material/react-single-component-template/.devcontainer.json b/packages/template-material/react-single-component-template/.devcontainer.json new file mode 100644 index 0000000..d635f64 --- /dev/null +++ b/packages/template-material/react-single-component-template/.devcontainer.json @@ -0,0 +1,3 @@ +{ + "template": "alif2e" +} \ No newline at end of file diff --git a/packages/template-material/react-single-component-template/.editorconfig b/packages/template-material/react-single-component-template/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/react-single-component-template/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/react-single-component-template/.eslintignore b/packages/template-material/react-single-component-template/.eslintignore new file mode 100644 index 0000000..ec02607 --- /dev/null +++ b/packages/template-material/react-single-component-template/.eslintignore @@ -0,0 +1,6 @@ +node_modules/ +build/ +dist/ +**/*.min.js +**/*-min.js +**/*.bundle.js diff --git a/packages/template-material/react-single-component-template/.eslintrc.js b/packages/template-material/react-single-component-template/.eslintrc.js new file mode 100644 index 0000000..1744b9b --- /dev/null +++ b/packages/template-material/react-single-component-template/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [ + 'eslint-config-ali/typescript/react', + "prettier", + 'prettier/@typescript-eslint', + 'prettier/react', + ], +}; diff --git a/packages/template-material/react-single-component-template/.gitignore b/packages/template-material/react-single-component-template/.gitignore new file mode 100644 index 0000000..f306598 --- /dev/null +++ b/packages/template-material/react-single-component-template/.gitignore @@ -0,0 +1,22 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +node_modules/ + +# production +build/ +dist/ +tmp/ +lib/ +es/ + +# misc +.idea/ +.happypack +.DS_Store +*.swp +*.dia~ + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/packages/template-material/react-single-component-template/.markdownlint.json b/packages/template-material/react-single-component-template/.markdownlint.json new file mode 100644 index 0000000..c859bfb --- /dev/null +++ b/packages/template-material/react-single-component-template/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "extends": "markdownlint-config-ali" +} diff --git a/packages/template-material/react-single-component-template/.markdownlintignore b/packages/template-material/react-single-component-template/.markdownlintignore new file mode 100644 index 0000000..a40f6e3 --- /dev/null +++ b/packages/template-material/react-single-component-template/.markdownlintignore @@ -0,0 +1,4 @@ +node_modules/ +build/ +dist/ + diff --git a/packages/template-material/react-single-component-template/.prettierrc.js b/packages/template-material/react-single-component-template/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/react-single-component-template/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/react-single-component-template/.stylelintignore b/packages/template-material/react-single-component-template/.stylelintignore new file mode 100644 index 0000000..89707c0 --- /dev/null +++ b/packages/template-material/react-single-component-template/.stylelintignore @@ -0,0 +1,7 @@ +node_modules/ +build/ +dist/ +**/*.min.css +**/*-min.css +**/*.bundle.css + diff --git a/packages/template-material/react-single-component-template/.stylelintrc.js b/packages/template-material/react-single-component-template/.stylelintrc.js new file mode 100644 index 0000000..74a5a54 --- /dev/null +++ b/packages/template-material/react-single-component-template/.stylelintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: 'stylelint-config-ali', +}; diff --git a/packages/template-material/react-single-component-template/.vscode/extensions.json b/packages/template-material/react-single-component-template/.vscode/extensions.json new file mode 100644 index 0000000..4170a59 --- /dev/null +++ b/packages/template-material/react-single-component-template/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "stylelint.vscode-stylelint", + "esbenp.prettier-vscode" + ] +} diff --git a/packages/template-material/react-single-component-template/.vscode/settings.json b/packages/template-material/react-single-component-template/.vscode/settings.json new file mode 100644 index 0000000..98f2d83 --- /dev/null +++ b/packages/template-material/react-single-component-template/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"], + "stylelint.validate": ["css","scss","less","acss"], + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true, + "source.fixAll.markdownlint": true + }, + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/packages/template-material/react-single-component-template/README.md b/packages/template-material/react-single-component-template/README.md new file mode 100644 index 0000000..d514444 --- /dev/null +++ b/packages/template-material/react-single-component-template/README.md @@ -0,0 +1,3 @@ +## 简介 + +这是一个 pc 端-单组件模板,projectTemplate 目录下是具体的模板内容。 diff --git a/packages/template-material/react-single-component-template/commitlint.config.js b/packages/template-material/react-single-component-template/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/react-single-component-template/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/react-single-component-template/f2elint.config.js b/packages/template-material/react-single-component-template/f2elint.config.js new file mode 100644 index 0000000..ff8f05d --- /dev/null +++ b/packages/template-material/react-single-component-template/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: true, + enableMarkdownlint: true, + enablePrettier: true, +}; diff --git a/packages/template-material/react-single-component-template/package.json b/packages/template-material/react-single-component-template/package.json new file mode 100644 index 0000000..a009d2b --- /dev/null +++ b/packages/template-material/react-single-component-template/package.json @@ -0,0 +1,36 @@ +{ + "name": "@alilc/react-single-component-template", + "version": "0.1.3", + "description": "react 单组件模板", + "files": [ + "projectTemplate/" + ], + "main": "lib/index.js", + "module": "es/index.js", + "stylePath": "style.js", + "scripts": { + "eslint": "eslint --cache --ext .js,.jsx ./", + "eslint:fix": "npm run eslint -- --fix", + "stylelint": "stylelint \"**/*.{css,scss,less}\"", + "lint": "npm run eslint && npm run stylelint", + "f2elint-scan": "f2elint scan", + "f2elint-fix": "f2elint fix" + }, + "keywords": [ + "ice", + "react", + "component" + ], + "dependencies": {}, + "devDependencies": {}, + "peerDependencies": {}, + "componentConfig": { + "name": "ExampleComponent", + "title": "demo component", + "category": "Information" + }, + "publishConfig": { + "access": "public" + }, + "license": "MIT" +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/.editorconfig b/packages/template-material/react-single-component-template/projectTemplate/.editorconfig new file mode 100644 index 0000000..3192996 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/template-material/react-single-component-template/projectTemplate/.eslintignore b/packages/template-material/react-single-component-template/projectTemplate/.eslintignore new file mode 100644 index 0000000..ec02607 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.eslintignore @@ -0,0 +1,6 @@ +node_modules/ +build/ +dist/ +**/*.min.js +**/*-min.js +**/*.bundle.js diff --git a/packages/template-material/react-single-component-template/projectTemplate/.eslintrc.js b/packages/template-material/react-single-component-template/projectTemplate/.eslintrc.js new file mode 100644 index 0000000..1744b9b --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [ + 'eslint-config-ali/typescript/react', + "prettier", + 'prettier/@typescript-eslint', + 'prettier/react', + ], +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/.markdownlint.json b/packages/template-material/react-single-component-template/projectTemplate/.markdownlint.json new file mode 100644 index 0000000..c859bfb --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "extends": "markdownlint-config-ali" +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/.markdownlintignore b/packages/template-material/react-single-component-template/projectTemplate/.markdownlintignore new file mode 100644 index 0000000..a40f6e3 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.markdownlintignore @@ -0,0 +1,4 @@ +node_modules/ +build/ +dist/ + diff --git a/packages/template-material/react-single-component-template/projectTemplate/.prettierrc.js b/packages/template-material/react-single-component-template/projectTemplate/.prettierrc.js new file mode 100644 index 0000000..9353f63 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/.stylelintignore b/packages/template-material/react-single-component-template/projectTemplate/.stylelintignore new file mode 100644 index 0000000..89707c0 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.stylelintignore @@ -0,0 +1,7 @@ +node_modules/ +build/ +dist/ +**/*.min.css +**/*-min.css +**/*.bundle.css + diff --git a/packages/template-material/react-single-component-template/projectTemplate/.stylelintrc.js b/packages/template-material/react-single-component-template/projectTemplate/.stylelintrc.js new file mode 100644 index 0000000..74a5a54 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.stylelintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: 'stylelint-config-ali', +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/.vscode/extensions.json b/packages/template-material/react-single-component-template/projectTemplate/.vscode/extensions.json new file mode 100644 index 0000000..4170a59 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "stylelint.vscode-stylelint", + "esbenp.prettier-vscode" + ] +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/.vscode/settings.json b/packages/template-material/react-single-component-template/projectTemplate/.vscode/settings.json new file mode 100644 index 0000000..98f2d83 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"], + "stylelint.validate": ["css","scss","less","acss"], + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true, + "source.fixAll.markdownlint": true + }, + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/README.md b/packages/template-material/react-single-component-template/projectTemplate/README.md new file mode 100644 index 0000000..942dd5f --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/README.md @@ -0,0 +1,11 @@ +# demo component + +@alifd/example-component + +intro component + +## API + +| 参数名 | 说明 | 必填 | 类型 | 默认值 | 备注 | +| ------ | ---- | ---- | ---- | ------ | ---- | +| | | | | | | diff --git a/packages/template-material/react-single-component-template/projectTemplate/_gitignore b/packages/template-material/react-single-component-template/projectTemplate/_gitignore new file mode 100644 index 0000000..a981ed0 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/_gitignore @@ -0,0 +1,103 @@ +.DS_Store + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# special demo file for locally reappear issue +docs/**/demo/issues.md + +precss.css +.sass-cache/ +scripts/server-remote +__html/ +umd/ +es/ +lib/ +lowcode_es/ +lowcode_lib/ +types/ +demos/ +!scripts/demos/ +/platform +build/ +test/coverage/ +test/**/coverage/ +mochawesome-report/ +coverage/ +gemini-report/ +.idea/ +.vscode/ +*.iml +.tea/ +/platform/ +react/ +platform/ +dist/ +_docs_/ +doc.json +meet-react/ +miniapp-preview/ +.tmp/ + +.umi/ +.umi-production/ \ No newline at end of file diff --git a/packages/template-material/react-single-component-template/projectTemplate/_npmignore b/packages/template-material/react-single-component-template/projectTemplate/_npmignore new file mode 100644 index 0000000..5947400 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/_npmignore @@ -0,0 +1,3 @@ +miniapp-preview/ +.idea/ +.vscode/ diff --git a/packages/template-material/react-single-component-template/projectTemplate/build.json b/packages/template-material/react-single-component-template/projectTemplate/build.json new file mode 100644 index 0000000..13123e1 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/build.json @@ -0,0 +1,13 @@ +{ + "library": "BizComp", + "plugins": [ + "build-plugin-component", + "build-plugin-fusion", + [ + "build-plugin-moment-locales", + { + "locales": ["zh-cn"] + } + ] + ] +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/build.lowcode.js b/packages/template-material/react-single-component-template/projectTemplate/build.lowcode.js new file mode 100644 index 0000000..6536047 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/build.lowcode.js @@ -0,0 +1,16 @@ +const { library } = require('./build.json'); + +module.exports = { + alias: { + '@': './src', + }, + plugins: [ + [ + '@alifd/build-plugin-lowcode', + { + library, + engineScope: "<%= arguments[0].engineScope || '@ali' %>" + }, + ], + ], +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/commitlint.config.js b/packages/template-material/react-single-component-template/projectTemplate/commitlint.config.js new file mode 100644 index 0000000..52f3b75 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['ali'], +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/demo/usage.md b/packages/template-material/react-single-component-template/projectTemplate/demo/usage.md new file mode 100644 index 0000000..47391d6 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/demo/usage.md @@ -0,0 +1,24 @@ +--- +title: Simple Usage +order: 1 +--- + +本 Demo 演示一行文字的用法。 + +```jsx +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import ExampleComponent from '<%=projectName%>'; + +class App extends Component { + render() { + return ( +
+ +
+ ); + } +} + +ReactDOM.render(, mountNode); +``` diff --git a/packages/template-material/react-single-component-template/projectTemplate/f2elint.config.js b/packages/template-material/react-single-component-template/projectTemplate/f2elint.config.js new file mode 100644 index 0000000..ff8f05d --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/f2elint.config.js @@ -0,0 +1,5 @@ +module.exports = { + enableStylelint: true, + enableMarkdownlint: true, + enablePrettier: true, +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/jest.config.js b/packages/template-material/react-single-component-template/projectTemplate/jest.config.js new file mode 100644 index 0000000..21ce944 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + setupFilesAfterEnv: ['/test/setupTests.js'], +}; diff --git a/packages/template-material/react-single-component-template/projectTemplate/package.json b/packages/template-material/react-single-component-template/projectTemplate/package.json new file mode 100644 index 0000000..c1295f6 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/package.json @@ -0,0 +1,75 @@ +{ + "name": "<%=projectName%>", + "version": "0.1.0", + "description": "<%=description%>", + "files": [ + "demo/", + "es/", + "lib/", + "build/", + "dist/", + "lowcode/", + "lowcode_lib/", + "lowcode_es/" + ], + "main": "lib/index.js", + "module": "es/index.js", + "exports": { + "./*": "./*", + ".": { + "import": "./es/index.js", + "require": "./lib/index.js" + } + }, + "stylePath": "style.js", + "scripts": { + "start": "build-scripts start", + "build": "build-scripts build", + "lowcode:dev": "build-scripts start --config ./build.lowcode.js", + "lowcode:build": "build-scripts build --config ./build.lowcode.js", + "test": "build-scripts test", + "prepublishOnly": "npm run build && npm run lowcode:build", + "eslint": "eslint --cache --ext .js,.jsx ./", + "eslint:fix": "npm run eslint -- --fix", + "stylelint": "stylelint \"**/*.{css,scss,less}\"", + "lint": "npm run eslint && npm run stylelint", + "f2elint-scan": "f2elint scan", + "f2elint-fix": "f2elint fix" + }, + "keywords": [ + "ice", + "react", + "component" + ], + "dependencies": { + "moment": "^2.29.4", + "@alifd/next": "^1.25.27", + "react": "^16.x", + "react-dom": "^16.x" + }, + "devDependencies": { + "@alib/build-scripts": "^0.1.3", + "@alifd/build-plugin-lowcode": "^0.4.0", + "@types/react": "^16.9.13", + "@types/react-dom": "^16.9.4", + "build-plugin-fusion": "^0.1.0", + "build-plugin-component": "^1.0.0", + "template-component-demo": "^2.0.3", + "build-plugin-moment-locales": "^0.1.0", + "f2elint": "^1.2.0" + }, + "peerDependencies": { + "moment": "latest", + "react": "^16.x", + "react-dom": "^16.x" + }, + "componentConfig": { + "name": "ExampleComponent", + "title": "demo component", + "category": "Information" + }, + "lcMeta": { + "type": "component" + }, + "license": "MIT" +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/src/index.scss b/packages/template-material/react-single-component-template/projectTemplate/src/index.scss new file mode 100644 index 0000000..2df7ceb --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/src/index.scss @@ -0,0 +1,4 @@ +/* write style here */ +.ExampleComponent { + +} diff --git a/packages/template-material/react-single-component-template/projectTemplate/src/index.tsx b/packages/template-material/react-single-component-template/projectTemplate/src/index.tsx new file mode 100644 index 0000000..e188a4b --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/src/index.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import { forwardRef, ForwardRefRenderFunction } from 'react'; + +interface ComponentProps { + title: string; + content: string; +} + +const ExampleComponent = (props: ComponentProps, ref: any) => { + const { title, content, ...others } = props; + + return ( +
+

{title}

+ {content || 'Hello ExampleComponent'} +
+ ); +}; + +const RefExampleComponent = forwardRef(ExampleComponent as ForwardRefRenderFunction); +RefExampleComponent.displayName = 'ExampleComponent'; + +export default RefExampleComponent; diff --git a/packages/template-material/react-single-component-template/projectTemplate/test/index.test.jsx b/packages/template-material/react-single-component-template/projectTemplate/test/index.test.jsx new file mode 100644 index 0000000..66685c5 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/test/index.test.jsx @@ -0,0 +1,9 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import ExampleComponent from '../src/index'; +import '../src/main.scss'; + +it('renders', () => { + const wrapper = shallow(); + expect(wrapper.find('.ExampleComponent').length).toBe(1); +}); diff --git a/packages/template-material/react-single-component-template/projectTemplate/test/setupTests.js b/packages/template-material/react-single-component-template/projectTemplate/test/setupTests.js new file mode 100644 index 0000000..82edfc9 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/test/setupTests.js @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; + +configure({ adapter: new Adapter() }); diff --git a/packages/template-material/react-single-component-template/projectTemplate/tsconfig.json b/packages/template-material/react-single-component-template/projectTemplate/tsconfig.json new file mode 100644 index 0000000..a511d68 --- /dev/null +++ b/packages/template-material/react-single-component-template/projectTemplate/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compileOnSave": false, + "buildOnSave": false, + "compilerOptions": { + "outDir": "build", + "module": "esnext", + "target": "es6", + "jsx": "react", + "moduleResolution": "node", + "lib": ["es6", "dom"], + "sourceMap": true, + "allowJs": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "skipLibCheck": true + }, + "include": ["src/*.ts", "src/*.tsx"], + "exclude": ["node_modules", "build", "public"] +} diff --git a/packages/template-plugin/package.json b/packages/template-plugin/package.json index d947dac..94b7b55 100644 --- a/packages/template-plugin/package.json +++ b/packages/template-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-template-plugin", - "version": "1.0.2", + "version": "1.0.8", "description": "Ali lowCode engine plugin template", "main": "index.js", "scripts": { @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@gitlab.alibaba-inc.com:guanghong.wsj/lowcode-tools.git", + "url": "https://github.com/alibaba/lowcode-tools.git", "directory": "packages/template-plugin" }, "publishConfig": { @@ -18,4 +18,4 @@ }, "author": "eternalsky", "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/template-plugin/proj/_npmignore b/packages/template-plugin/proj/_npmignore new file mode 100644 index 0000000..0ea1248 --- /dev/null +++ b/packages/template-plugin/proj/_npmignore @@ -0,0 +1,24 @@ +node_modules/ +*.iml +.idea/ +.vscode/ +jsconfig.json +typings.json +typings/ +*~ +~* +*.diff +*.log +*.patch +*.bak +.DS_Store +Thumbs.db +.project +.*proj +.svn/ +*.swp +.lock +package-lock.json +.vdev +# demo +# mock diff --git a/packages/template-plugin/proj/build.js b/packages/template-plugin/proj/build.js new file mode 100644 index 0000000..db03e70 --- /dev/null +++ b/packages/template-plugin/proj/build.js @@ -0,0 +1,16 @@ +module.exports = { + plugins: [ + 'build-plugin-fusion', + [ + '@alilc/build-plugin-alt', + { + type: 'plugin', + // 开启注入调试模式,see:https://lowcode-engine.cn/site/docs/guide/expand/editor/cli + inject: true, + // 配置要打开的页面,在注入调试模式下,不配置此项的话不会打开浏览器 + // 支持直接使用官方 demo 项目:https://lowcode-engine.cn/demo/demo-general/index.html + // openUrl: 'https://lowcode-engine.cn/demo/demo-general/index.html?debug', + } + ] + ] +} \ No newline at end of file diff --git a/packages/template-plugin/proj/build.json b/packages/template-plugin/proj/build.json deleted file mode 100644 index 6a51f0c..0000000 --- a/packages/template-plugin/proj/build.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "plugins": [ - [ - "@alilc/build-plugin-alt", - { - "type": "plugin" - } - ], - [ - "build-plugin-fusion", - { - "themePackage": "@alifd/theme-lowcode-light" - } - ] - ] -} \ No newline at end of file diff --git a/packages/template-plugin/proj/package.json b/packages/template-plugin/proj/package.json index a2f3739..ce85df0 100644 --- a/packages/template-plugin/proj/package.json +++ b/packages/template-plugin/proj/package.json @@ -8,8 +8,8 @@ "README": "README.md", "scripts": { "start": "npm run dev", - "dev": "build-scripts start", - "build": "build-scripts build", + "dev": "build-scripts start --config build.js", + "build": "build-scripts build --config build.js", "prepublishOnly": "npm run build", "beta": "npm publish --tag beta", "pub": "npm publish" @@ -18,14 +18,14 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, - "dependencies": {}, + "dependencies": { + "@alilc/lowcode-types": "^1.1.1" + }, "peerDependencies": { "react": "^16.0.0" }, "devDependencies": { "@alib/build-scripts": "^0.1.32", - "@alifd/theme-lowcode-light": "^0.2.1", - "@recore/config": "^2.0.6", "@types/react": "^16.0.3", "build-plugin-fusion": "^0.1.19", "@alilc/build-plugin-alt": "^1.0.0" diff --git a/packages/template-plugin/proj/src/index.tsx b/packages/template-plugin/proj/src/index.tsx index 44d6d08..8c9ef2e 100644 --- a/packages/template-plugin/proj/src/index.tsx +++ b/packages/template-plugin/proj/src/index.tsx @@ -1,28 +1,12 @@ import * as React from 'react'; -import { ILowCodePluginContext } from '@alilc/lowcode-engine'; +import { IPublicModelPluginContext } from '@alilc/lowcode-types'; import Icon from './icon'; -const <%- componentName %> = (ctx: ILowCodePluginContext) => { +const <%- componentName %> = (ctx: IPublicModelPluginContext, options: any) => { return { - // 插件名,注册环境下唯一 - name: '<%- componentName %>', - // 依赖的插件(插件名数组) - dep: [], - // 插件对外暴露的数据和方法 - exports() { - return { - data: '你可以把插件的数据这样对外暴露', - func: () => { - console.log('方法也是一样'); - }, - } - }, // 插件的初始化函数,在引擎初始化之后会立刻调用 init() { - // 你可以拿到其他插件暴露的方法和属性 - // const { data, func } = ctx.plugins.pluginA; - // func(); - + // 你可以拿到插件注册时的初始化参数 // console.log(options.name); // 往引擎增加面板 @@ -42,4 +26,14 @@ const <%- componentName %> = (ctx: ILowCodePluginContext) => { }; }; +// 插件名,注册环境下唯一 +<%- componentName %>.pluginName = '<%- componentName %>'; +<%- componentName %>.meta = { + // 依赖的插件(插件名数组) + dependencies: [], + engines: { + lowcodeEngine: '^1.1.0', // 插件需要配合 ^1.1.0 的引擎才可运行 + }, +} + export default <%- componentName %>; diff --git a/packages/template-setter/package.json b/packages/template-setter/package.json index e49ab4b..603f3ce 100644 --- a/packages/template-setter/package.json +++ b/packages/template-setter/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-template-setter", - "version": "1.0.0", + "version": "1.0.1", "description": "Ali lowCode engine setter template", "main": "index.js", "scripts": { @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@gitlab.alibaba-inc.com:guanghong.wsj/lowcode-tools.git", + "url": "https://github.com/alibaba/lowcode-tools.git", "directory": "packages/template-setter" }, "publishConfig": { diff --git a/packages/template-setter/proj/_npmignore b/packages/template-setter/proj/_npmignore new file mode 100644 index 0000000..0ea1248 --- /dev/null +++ b/packages/template-setter/proj/_npmignore @@ -0,0 +1,24 @@ +node_modules/ +*.iml +.idea/ +.vscode/ +jsconfig.json +typings.json +typings/ +*~ +~* +*.diff +*.log +*.patch +*.bak +.DS_Store +Thumbs.db +.project +.*proj +.svn/ +*.swp +.lock +package-lock.json +.vdev +# demo +# mock