├── CHANGELOG.md ├── packages ├── plugin-ssr │ ├── README.md │ ├── __tests__ │ │ └── plugin-ssr.test.js │ ├── tsconfig.json │ └── package.json ├── plugin-helpers │ ├── src │ │ ├── _helpers.ts │ │ └── index.ts │ ├── helpers │ │ ├── cookie.ts │ │ ├── urlParse.ts │ │ └── index.ts │ ├── __tests__ │ │ └── index.test.js │ ├── tsconfig.json │ ├── README.md │ └── package.json ├── plugin-logger │ ├── src │ │ ├── types │ │ │ └── index.ts │ │ ├── _logger.ts │ │ ├── module.ts │ │ └── index.ts │ ├── logger │ │ └── index.ts │ ├── tsconfig.json │ ├── README.md │ └── package.json ├── plugin-rematch │ ├── src │ │ ├── _store.ts │ │ ├── template │ │ │ └── store.ts.ejs │ │ ├── module.tsx │ │ ├── generateStore.ts │ │ └── index.ts │ ├── __tests__ │ │ └── index.test.js │ ├── tsconfig.json │ └── package.json ├── plugin-config │ ├── src │ │ ├── _config.ts │ │ └── index.ts │ ├── __tests__ │ │ └── plugin-config.test.js │ ├── tsconfig.json │ ├── config │ │ └── index.ts │ ├── README.md │ └── package.json ├── plugin-service │ ├── src │ │ ├── _ice.ts │ │ └── index.ts │ ├── __tests__ │ │ └── plugin-service.test.js │ ├── tsconfig.json │ ├── package.json │ └── README.md ├── plugin-router │ ├── src │ │ ├── runtime │ │ │ └── _routes.ts │ │ ├── types │ │ │ ├── collector.ts │ │ │ ├── index.ts │ │ │ ├── base.ts │ │ │ └── router.ts │ │ └── module.tsx │ ├── templates │ │ ├── index.ts │ │ ├── history.ts │ │ ├── useSearchParams.ts │ │ ├── withSearchParams.tsx │ │ └── react-router-dom.ts │ ├── __tests__ │ │ └── plugin-router.test.js │ ├── tsconfig.json │ └── package.json ├── plugin-core │ ├── src │ │ ├── generator │ │ │ └── templates │ │ │ │ ├── page │ │ │ │ └── index.ts.ejs │ │ │ │ └── app │ │ │ │ ├── components │ │ │ │ └── index.ts.ejs │ │ │ │ ├── lazy.ts.ejs │ │ │ │ ├── index.ts.ejs │ │ │ │ ├── appConfig.ts.ejs │ │ │ │ └── types.ts.ejs │ │ ├── types │ │ │ └── base.ts │ │ ├── utils │ │ │ ├── formatPath.ts │ │ │ ├── removeExportData.ts │ │ │ ├── getPages.ts │ │ │ ├── checkExportData.ts │ │ │ ├── generateExports.ts │ │ │ └── getRoutes.ts │ │ ├── _components.tsx │ │ └── module.tsx │ ├── tsconfig.json │ └── package.json ├── plugin-react-app │ ├── src │ │ ├── userConfig │ │ │ ├── externals.js │ │ │ ├── library.js │ │ │ ├── filename.js │ │ │ ├── libraryExport.js │ │ │ ├── libraryTarget.js │ │ │ ├── modules.js │ │ │ ├── extensions.js │ │ │ ├── minify.js │ │ │ ├── publicPath.js │ │ │ ├── devPublicPath.js │ │ │ ├── sourcemap.js │ │ │ ├── terserOptions.js │ │ │ ├── vendor.js │ │ │ ├── define.js │ │ │ ├── babelPlugins.js │ │ │ ├── lessLoaderOptions.js │ │ │ ├── sassLoaderOptions.js │ │ │ ├── alias.js │ │ │ ├── devServer.js │ │ │ ├── postcssrc.js │ │ │ ├── outputDir.js │ │ │ ├── cssLoaderOptions.js │ │ │ ├── ignoreHtmlTemplate.js │ │ │ ├── mock.js │ │ │ ├── targets.js │ │ │ ├── outputAssetsPath.js │ │ │ ├── eslint.js │ │ │ ├── compileDependencies.js │ │ │ ├── hash.js │ │ │ ├── babelPresets.js │ │ │ └── proxy.js │ │ ├── utils │ │ │ ├── polyfillLoader.js │ │ │ ├── formatWinPath.js │ │ │ ├── getFilePath.js │ │ │ ├── collect.js │ │ │ ├── babelPluginCorejsLock.js │ │ │ ├── updateMiniCssLoaderPath.js │ │ │ └── getCertificate.js │ │ ├── cliOption │ │ │ ├── analyzer.js │ │ │ ├── analyzerPort.js │ │ │ ├── disableReload.js │ │ │ └── https.js │ │ └── config │ │ │ ├── option.config.js │ │ │ └── default.config.js │ ├── README.md │ └── package.json ├── icejs │ ├── __tests__ │ │ └── cli.test.js │ ├── tsconfig.json │ ├── bin │ │ ├── build.js │ │ ├── test.js │ │ ├── child-process-start.js │ │ └── ice-cli.js │ ├── src │ │ └── index.ts │ ├── README.md │ └── package.json ├── create-ice │ ├── __tests__ │ │ └── index.test.js │ ├── tsconfig.json │ ├── README.md │ ├── package.json │ └── src │ │ └── index.ts ├── plugin-icestark │ ├── src │ │ ├── runtime │ │ │ ├── _history.ts │ │ │ ├── Layout.tsx │ │ │ ├── _Router.tsx │ │ │ └── removeLayout.ts │ │ ├── types │ │ │ ├── base.ts │ │ │ └── index.ts │ │ └── index.ts │ ├── tsconfig.json │ ├── package.json │ └── README.md ├── plugin-store │ ├── __tests__ │ │ └── plugin-store.test.js │ ├── tsconfig.json │ ├── src │ │ ├── _store.ts │ │ ├── template │ │ │ ├── types.ts.ejs │ │ │ ├── pageStore.ts.ejs │ │ │ ├── appStore.ts.ejs │ │ │ └── pageComponent.tsx.ejs │ │ └── module.tsx │ ├── package.json │ └── README.md ├── plugin-request │ ├── __tests__ │ │ └── plugin-request.test.js │ ├── src │ │ ├── _axiosInstance.ts │ │ ├── types │ │ │ ├── index.ts │ │ │ └── base.ts │ │ ├── module.ts │ │ └── index.ts │ ├── request │ │ └── axiosInstance.ts │ ├── tsconfig.json │ ├── package.json │ └── README.md └── plugin-mpa │ ├── tsconfig.json │ ├── README.md │ ├── package.json │ └── src │ └── index.ts ├── examples ├── basic-mpa │ ├── build.json │ ├── sandbox.config.json │ ├── src │ │ └── pages │ │ │ ├── Dashboard │ │ │ ├── routes.ts │ │ │ ├── app.ts │ │ │ ├── index.tsx │ │ │ └── models │ │ │ │ └── counter.ts │ │ │ └── Home │ │ │ ├── app.ts │ │ │ └── index.tsx │ ├── public │ │ ├── index.html │ │ └── dashboard.html │ ├── package.json │ └── tsconfig.json ├── basic-ssr │ ├── build.json │ ├── src │ │ ├── pages │ │ │ ├── Home │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── NotFound │ │ │ │ └── index.tsx │ │ │ ├── About │ │ │ │ └── index.tsx │ │ │ └── Dashboard │ │ │ │ └── index.tsx │ │ ├── config.ts │ │ ├── layouts │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── app.ts │ │ ├── models │ │ │ └── user.ts │ │ └── routes.ts │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── mock │ │ └── index.ts │ ├── package.json │ └── tsconfig.json ├── icestark-child │ ├── src │ │ ├── global.css │ │ ├── app.ts │ │ └── pages │ │ │ ├── Dashboard │ │ │ └── index.tsx │ │ │ ├── About │ │ │ ├── _layout.tsx │ │ │ └── index.tsx │ │ │ └── index.tsx │ ├── sandbox.config.json │ ├── build.json │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── icestark-layout │ ├── src │ │ ├── global.scss │ │ ├── pages │ │ │ ├── Home │ │ │ │ └── index.tsx │ │ │ ├── Dashboard │ │ │ │ └── index.tsx │ │ │ └── 404.tsx │ │ └── app.tsx │ ├── sandbox.config.json │ ├── build.json │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── basic-request │ ├── src │ │ ├── global.scss │ │ ├── routes.ts │ │ ├── app.ts │ │ └── pages │ │ │ └── Home │ │ │ └── index.tsx │ ├── README.md │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── mock │ │ └── index.js │ ├── package.json │ └── tsconfig.json ├── basic-rml │ ├── build.json │ ├── src │ │ ├── global.scss │ │ ├── app.ts │ │ ├── routes.ts │ │ └── pages │ │ │ └── Home │ │ │ └── index.rml │ ├── README.md │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── basic-service │ ├── src │ │ ├── global.scss │ │ ├── routes.ts │ │ ├── app.ts │ │ ├── pages │ │ │ └── Home │ │ │ │ ├── index.tsx │ │ │ │ └── components │ │ │ │ └── User │ │ │ │ ├── index.tsx │ │ │ │ └── service.ts │ │ ├── components │ │ │ └── Fetch │ │ │ │ └── index.tsx │ │ └── services │ │ │ └── todo.ts │ ├── build.json │ ├── README.md │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── package.json │ ├── mock │ │ └── index.js │ └── tsconfig.json ├── basic-store │ ├── src │ │ ├── global.scss │ │ ├── pages │ │ │ ├── Home │ │ │ │ ├── model.ts │ │ │ │ └── index.tsx │ │ │ ├── NotFound │ │ │ │ └── index.tsx │ │ │ └── About │ │ │ │ ├── model.ts │ │ │ │ └── index.tsx │ │ ├── app.ts │ │ ├── layouts │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── models │ │ │ ├── counter.ts │ │ │ └── user.ts │ │ └── routes.ts │ ├── build.json │ ├── README.md │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── hello-world │ ├── src │ │ ├── global.scss │ │ ├── pages │ │ │ └── Home │ │ │ │ └── index.tsx │ │ ├── routes.ts │ │ ├── app.ts │ │ └── components │ │ │ └── Guide │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ ├── README.md │ ├── sandbox.config.json │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── with-rematch │ ├── build.json │ ├── README.md │ ├── sandbox.config.json │ ├── src │ │ ├── app.ts │ │ ├── routes.ts │ │ ├── pages │ │ │ ├── 404.tsx │ │ │ ├── Rematch │ │ │ │ ├── index.tsx │ │ │ │ └── Child.tsx │ │ │ └── index.tsx │ │ └── stores │ │ │ └── user.ts │ ├── public │ │ └── index.html │ ├── package.json │ └── tsconfig.json ├── basic-spa │ ├── sandbox.config.json │ ├── build.json │ ├── src │ │ ├── layouts │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── pages │ │ │ ├── About │ │ │ │ ├── components │ │ │ │ │ ├── Child.tsx │ │ │ │ │ └── Todo.tsx │ │ │ │ └── index.tsx │ │ │ ├── NotFound │ │ │ │ └── index.tsx │ │ │ ├── Dashboard │ │ │ │ └── index.tsx │ │ │ └── Home │ │ │ │ └── index.tsx │ │ ├── config.ts │ │ ├── app.tsx │ │ └── routes.ts │ ├── public │ │ └── index.html │ ├── package.json │ ├── tsconfig.json │ └── mock │ │ └── index.js └── with-fusion-design │ ├── README.md │ ├── sandbox.config.json │ ├── src │ ├── global.scss │ ├── routes.ts │ ├── app.ts │ └── pages │ │ └── Home │ │ └── index.tsx │ ├── build.json │ ├── public │ └── index.html │ ├── package.json │ └── tsconfig.json ├── .commitlintrc.js ├── lerna.json ├── scripts ├── fn │ ├── shell.ts │ └── getPackages.ts ├── sync.ts ├── dependency-check.ts ├── rollback.ts ├── owner.ts └── build.ts ├── tsconfig.settings.json ├── .eslintignore ├── .editorconfig ├── .gitignore ├── README.md ├── .github ├── ISSUE_TEMPLATE.md ├── workflows │ └── ci.yml └── GIT_COMMIT_SPECIFIC.md ├── tsconfig.json ├── .eslintrc.js └── LICENSE /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG for icejs 2 | -------------------------------------------------------------------------------- /packages/plugin-ssr/README.md: -------------------------------------------------------------------------------- 1 | # plugin-ssr 2 | -------------------------------------------------------------------------------- /examples/basic-mpa/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "mpa": true, 3 | "plugins": [] 4 | } 5 | -------------------------------------------------------------------------------- /examples/basic-ssr/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [], 3 | "ssr": true 4 | } 5 | -------------------------------------------------------------------------------- /examples/basic-ssr/src/pages/Home/index.module.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /packages/plugin-helpers/src/_helpers.ts: -------------------------------------------------------------------------------- 1 | const helpers = {}; 2 | export { helpers }; 3 | -------------------------------------------------------------------------------- /examples/icestark-child/src/global.css: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } -------------------------------------------------------------------------------- /examples/icestark-layout/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } -------------------------------------------------------------------------------- /.commitlintrc.js: -------------------------------------------------------------------------------- 1 | const { commitlint } = require('@ice/spec'); 2 | 3 | module.exports = commitlint; 4 | -------------------------------------------------------------------------------- /examples/basic-request/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/basic-rml/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "build-plugin-ice-rml" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /examples/basic-rml/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/basic-service/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/basic-store/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/hello-world/src/global.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /packages/plugin-logger/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface ILogger { 2 | level: string; 3 | } 4 | -------------------------------------------------------------------------------- /packages/plugin-rematch/src/_store.ts: -------------------------------------------------------------------------------- 1 | const stores = {}; 2 | 3 | export { 4 | stores, 5 | }; 6 | -------------------------------------------------------------------------------- /examples/basic-service/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "build-plugin-ice-service" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /examples/with-rematch/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "build-plugin-ice-rematch" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /packages/plugin-logger/logger/index.ts: -------------------------------------------------------------------------------- 1 | import * as logger from 'loglevel'; 2 | 3 | export default logger; -------------------------------------------------------------------------------- /examples/basic-rml/README.md: -------------------------------------------------------------------------------- 1 | # rml with icejs 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /examples/basic-store/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [], 3 | "router": { 4 | "lazy": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/with-rematch/README.md: -------------------------------------------------------------------------------- 1 | # with rematch 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /packages/plugin-helpers/helpers/cookie.ts: -------------------------------------------------------------------------------- 1 | import * as cookie from 'cookie'; 2 | 3 | export { 4 | cookie 5 | }; -------------------------------------------------------------------------------- /packages/plugin-config/src/_config.ts: -------------------------------------------------------------------------------- 1 | const config = { 2 | default: {}, 3 | }; 4 | 5 | export default config; 6 | -------------------------------------------------------------------------------- /examples/basic-service/README.md: -------------------------------------------------------------------------------- 1 | # service for icejs 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /examples/basic-store/src/pages/Home/model.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | state: { 3 | title: 'Home Page' 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /examples/hello-world/README.md: -------------------------------------------------------------------------------- 1 | # Hello World with icejs 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /packages/plugin-service/src/_ice.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | export const request = function(params: any) {}; 3 | -------------------------------------------------------------------------------- /examples/basic-mpa/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-request/README.md: -------------------------------------------------------------------------------- 1 | # data fetching with icejs 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /examples/basic-rml/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-spa/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-ssr/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-store/README.md: -------------------------------------------------------------------------------- 1 | # store management with icejs 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /examples/basic-store/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/hello-world/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/with-fusion-design/README.md: -------------------------------------------------------------------------------- 1 | # with fusion design 2 | 3 | https://github.com/ice-lab/icejs/tree/master/examples 4 | -------------------------------------------------------------------------------- /packages/plugin-helpers/helpers/urlParse.ts: -------------------------------------------------------------------------------- 1 | import * as urlParse from 'url-parse'; 2 | 3 | export { 4 | urlParse 5 | }; 6 | -------------------------------------------------------------------------------- /packages/plugin-router/src/runtime/_routes.ts: -------------------------------------------------------------------------------- 1 | // 注释: 2 | // 该文件仅用于 module.tsx 中引用 $ice/routes 的编译问题 3 | export default []; 4 | -------------------------------------------------------------------------------- /examples/basic-request/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-service/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/icestark-child/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/icestark-layout/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/with-rematch/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/with-fusion-design/sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "node", 3 | "container": { 4 | "port": 3333 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/plugin-core/src/generator/templates/page/index.ts.ejs: -------------------------------------------------------------------------------- 1 | <%- pageImports %> 2 | 3 | export { 4 | <%= pageExports %> 5 | } 6 | -------------------------------------------------------------------------------- /examples/basic-mpa/src/pages/Dashboard/routes.ts: -------------------------------------------------------------------------------- 1 | import Index from './index'; 2 | 3 | export default [{ path: '/', component: Index }]; 4 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/externals.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, value) => { 2 | config.merge({ externals: value }); 3 | }; 4 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.1", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "packages": [ 6 | "packages/*" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /examples/basic-rml/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | }; 5 | 6 | createApp(appConfig); 7 | -------------------------------------------------------------------------------- /examples/icestark-layout/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default function Home() { 4 | return
home page
; 5 | } -------------------------------------------------------------------------------- /packages/icejs/__tests__/cli.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const cli = require('..'); 4 | 5 | describe('@ice/cli', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-rematch/src/template/store.ts.ejs: -------------------------------------------------------------------------------- 1 | <%- importCodes %> 2 | 3 | const stores = { <%- storesString %> }; 4 | 5 | export { 6 | stores, 7 | } 8 | -------------------------------------------------------------------------------- /examples/with-fusion-design/src/global.scss: -------------------------------------------------------------------------------- 1 | // 引入默认全局样式 2 | @import '@alifd/next/reset.scss'; 3 | 4 | body { 5 | -webkit-font-smoothing: antialiased; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/plugin-core/src/generator/templates/app/components/index.ts.ejs: -------------------------------------------------------------------------------- 1 | import ErrorBoundary from './ErrorBoundary'; 2 | 3 | export { 4 | ErrorBoundary 5 | }; 6 | -------------------------------------------------------------------------------- /packages/create-ice/__tests__/index.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const plugin = require('..'); 4 | 5 | describe('create-ice', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-logger/src/_logger.ts: -------------------------------------------------------------------------------- 1 | const logger = { 2 | setLevel: (loglevel: string) => { 3 | console.log(loglevel); 4 | }, 5 | }; 6 | export default logger; 7 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/library.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, library) => { 2 | if (library) { 3 | config.output.library(library); 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /packages/icejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/plugin-core/src/types/base.ts: -------------------------------------------------------------------------------- 1 | export interface IExportData { 2 | specifier?: string; 3 | source: string; 4 | exportName: string; 5 | extraExport?: boolean; 6 | } -------------------------------------------------------------------------------- /packages/plugin-icestark/src/runtime/_history.ts: -------------------------------------------------------------------------------- 1 | export { 2 | createBrowserHistory, 3 | createHashHistory, 4 | createMemoryHistory, 5 | History 6 | } from 'history'; 7 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/filename.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, filename) => { 2 | if (filename) { 3 | config.output.filename(filename); 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /packages/plugin-rematch/__tests__/index.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const plugin = require('..'); 4 | 5 | describe('plugin-rematch', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-ssr/__tests__/plugin-ssr.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginSsr = require('..'); 4 | 5 | describe('plugin-ssr', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /examples/icestark-child/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourcemap": true, 3 | "router": { 4 | "lazy": true 5 | }, 6 | "plugins": [ 7 | "build-plugin-icestark" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/plugin-helpers/__tests__/index.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginHelpers = require('..'); 4 | 5 | describe('plugin-helpers', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-router/templates/index.ts: -------------------------------------------------------------------------------- 1 | export * from './react-router-dom'; 2 | export * from './history'; 3 | export * from './useSearchParams'; 4 | export * from './withSearchParams'; 5 | -------------------------------------------------------------------------------- /packages/plugin-store/__tests__/plugin-store.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginStore = require('..'); 4 | 5 | describe('plugin-store', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-config/__tests__/plugin-config.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginConfig = require('..'); 4 | 5 | describe('plugin-config', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/libraryExport.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, libraryExport) => { 2 | if (libraryExport) { 3 | config.output.libraryExport(libraryExport); 4 | } 5 | }; -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/libraryTarget.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, libraryTarget) => { 2 | if (libraryTarget) { 3 | config.output.libraryTarget(libraryTarget); 4 | } 5 | }; -------------------------------------------------------------------------------- /examples/basic-rml/src/routes.ts: -------------------------------------------------------------------------------- 1 | import Home from '@/pages/Home/index.rml'; 2 | 3 | export default [ 4 | { 5 | path: '/', 6 | exact: true, 7 | component: Home 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /examples/with-fusion-design/src/routes.ts: -------------------------------------------------------------------------------- 1 | import Home from '@/pages/Home'; 2 | 3 | export default [ 4 | { 5 | path: '/', 6 | exact: true, 7 | component: Home 8 | } 9 | ]; 10 | -------------------------------------------------------------------------------- /examples/with-rematch/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'ice'; 2 | 3 | const appConfig = { 4 | app: { 5 | rootId: 'ice-container' 6 | } 7 | }; 8 | 9 | createApp(appConfig); 10 | -------------------------------------------------------------------------------- /packages/plugin-icestark/src/runtime/Layout.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | const Layout = ({ children }) => ( 4 | <> 5 | {children} 6 | 7 | ); 8 | 9 | export default Layout; -------------------------------------------------------------------------------- /packages/plugin-request/__tests__/plugin-request.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginRequest = require('..'); 4 | 5 | describe('plugin-request', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-router/__tests__/plugin-router.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginRouter = require('..'); 4 | 5 | describe('@ice/plugin-router', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/plugin-service/__tests__/plugin-service.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const pluginService = require('..'); 4 | 5 | describe('plugin-service', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/create-ice/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib" 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /packages/plugin-mpa/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/utils/polyfillLoader.js: -------------------------------------------------------------------------------- 1 | module.exports = (content) => { 2 | return ` 3 | import "core-js/stable"; 4 | import "regenerator-runtime/runtime"; 5 | ${content} 6 | `; 7 | }; 8 | -------------------------------------------------------------------------------- /packages/plugin-ssr/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib" 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Guide from '@/components/Guide'; 3 | 4 | const Home = () => { 5 | return ; 6 | }; 7 | 8 | export default Home; 9 | -------------------------------------------------------------------------------- /examples/hello-world/src/routes.ts: -------------------------------------------------------------------------------- 1 | import Home from '@/pages/Home'; 2 | 3 | const routerConfig = [ 4 | { 5 | path: '/', 6 | component: Home 7 | } 8 | ]; 9 | 10 | export default routerConfig; -------------------------------------------------------------------------------- /examples/icestark-layout/src/pages/Dashboard/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default function Dashboard() { 4 | return ( 5 |
6 | Dashboard page 7 |
8 | ); 9 | } -------------------------------------------------------------------------------- /packages/plugin-request/src/_axiosInstance.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const DEFAULE_CONFIG = {}; 4 | 5 | const axiosInstance = axios.create(DEFAULE_CONFIG); 6 | 7 | export default axiosInstance; 8 | -------------------------------------------------------------------------------- /examples/basic-request/src/routes.ts: -------------------------------------------------------------------------------- 1 | import Home from '@/pages/Home'; 2 | 3 | const routerConfig = [ 4 | { 5 | path: '/', 6 | component: Home 7 | } 8 | ]; 9 | 10 | export default routerConfig; -------------------------------------------------------------------------------- /examples/basic-service/src/routes.ts: -------------------------------------------------------------------------------- 1 | import Home from '@/pages/Home'; 2 | 3 | const routerConfig = [ 4 | { 5 | path: '/', 6 | component: Home 7 | } 8 | ]; 9 | 10 | export default routerConfig; -------------------------------------------------------------------------------- /scripts/fn/shell.ts: -------------------------------------------------------------------------------- 1 | import * as execa from 'execa'; 2 | 3 | export async function run(command: string) { 4 | console.log(`[RUN]: ${command}`); 5 | return execa.command(command, { stdio: 'inherit' }); 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic-service/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | app: { 5 | rootId: 'ice-container', 6 | } 7 | }; 8 | 9 | createApp(appConfig); 10 | -------------------------------------------------------------------------------- /examples/basic-store/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | app: { 5 | rootId: 'ice-container', 6 | }, 7 | }; 8 | 9 | createApp(appConfig); 10 | -------------------------------------------------------------------------------- /examples/hello-world/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | app: { 5 | rootId: 'ice-container', 6 | }, 7 | }; 8 | 9 | createApp(appConfig); 10 | -------------------------------------------------------------------------------- /examples/with-fusion-design/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | app: { 5 | rootId: 'ice-container' 6 | } 7 | }; 8 | 9 | createApp(appConfig); 10 | -------------------------------------------------------------------------------- /examples/basic-ssr/src/config.ts: -------------------------------------------------------------------------------- 1 | const config = { 2 | dev: { 3 | baseURL: 'http://localhost:3333/api' 4 | }, 5 | prod: { 6 | baseURL: 'http://example.com/api' 7 | } 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /packages/plugin-request/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { AxiosRequestConfig } from 'axios'; 2 | import { IInterceptors } from './base'; 3 | 4 | export interface IRequest extends AxiosRequestConfig { 5 | interceptors?: IInterceptors; 6 | } -------------------------------------------------------------------------------- /packages/plugin-router/templates/history.ts: -------------------------------------------------------------------------------- 1 | // https://github.com/ReactTraining/history/blob/master/modules/index.js 2 | export { 3 | createBrowserHistory, 4 | createHashHistory, 5 | createMemoryHistory 6 | } from 'history'; 7 | -------------------------------------------------------------------------------- /packages/plugin-icestark/src/runtime/_Router.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | // eslint-disable-next-line 4 | const IceRouter = ({ type, routes, basename, history }) => { 5 | return (
); 6 | }; 7 | 8 | export { IceRouter }; 9 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/utils/formatWinPath.js: -------------------------------------------------------------------------------- 1 | module.exports = (outputPath) => { 2 | const isWin = process.platform === 'win32'; 3 | // js\index.js => js/index.js 4 | return isWin ? outputPath.replace(/\\/g, '/') : outputPath; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/modules.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, modules) => { 2 | if (Array.isArray(modules)) { 3 | modules.forEach((module) => { 4 | config.resolve.modules 5 | .add(module); 6 | }); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /examples/basic-mpa/src/pages/Dashboard/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | import routes from './routes'; 3 | 4 | const appConfig: IAppConfig = { 5 | router: { 6 | routes 7 | }, 8 | }; 9 | 10 | createApp(appConfig); 11 | -------------------------------------------------------------------------------- /examples/basic-rml/src/pages/Home/index.rml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/plugin-core/src/utils/formatPath.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | function formatPath(pathStr: string): string { 4 | return process.platform === 'win32' ? pathStr.split(path.sep).join('/') : pathStr; 5 | } 6 | 7 | export default formatPath; 8 | -------------------------------------------------------------------------------- /packages/plugin-helpers/helpers/index.ts: -------------------------------------------------------------------------------- 1 | import { urlParse } from './urlParse'; 2 | import { cookie } from './cookie'; 3 | 4 | const helpers = { 5 | cookie, urlParse 6 | }; 7 | 8 | // TODO: 只留一个 9 | export { 10 | helpers 11 | }; 12 | export default helpers; 13 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/extensions.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, extensions) => { 2 | if (Array.isArray(extensions)) { 3 | extensions.forEach((extension) => { 4 | config.resolve.extensions 5 | .add(extension); 6 | }); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /examples/basic-spa/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreHtmlTemplate": true, 3 | "plugins": [], 4 | "modeConfig": { 5 | "prod": { 6 | "ignoreHtmlTemplate": false 7 | } 8 | }, 9 | "eslint": { 10 | "disable": false, 11 | "quiet": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/plugin-logger/src/module.ts: -------------------------------------------------------------------------------- 1 | import logger from '$ice/logger'; 2 | 3 | const module = ({ appConfig }) => { 4 | if (appConfig.logger && appConfig.logger.level) { 5 | logger.setLevel(appConfig.logger.level); 6 | } 7 | }; 8 | 9 | export default module; 10 | -------------------------------------------------------------------------------- /packages/plugin-request/request/axiosInstance.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | // https://github.com/axios/axios#request-config 4 | const DEFAULE_CONFIG = { 5 | }; 6 | 7 | const axiosInstance = axios.create(DEFAULE_CONFIG); 8 | 9 | export default axiosInstance; 10 | -------------------------------------------------------------------------------- /packages/plugin-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "ice": ["./src/_ice"] 9 | } 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /examples/basic-mpa/src/pages/Home/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | import Home from './index'; 3 | 4 | const appConfig: IAppConfig = { 5 | router: { 6 | routes: [{ path: '/', component: Home }], 7 | }, 8 | }; 9 | 10 | createApp(appConfig); 11 | -------------------------------------------------------------------------------- /examples/icestark-layout/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "build-plugin-icestark", 4 | ["build-plugin-fusion", { 5 | "themePackage": "@icedesign/theme", 6 | "themeConfig": { 7 | "nextPrefix": "next-fd-" 8 | } 9 | }] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/userConfig/minify.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, value, context) => { 2 | const { command } = context; 3 | // minify always be false in dev mode 4 | const minify = command === 'start' ? false : value; 5 | config.optimization.minimize(minify); 6 | }; 7 | -------------------------------------------------------------------------------- /packages/plugin-rematch/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "$ice/store": ["./src/_store"] 9 | } 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /packages/plugin-store/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "$ice/store": ["./src/_store"] 9 | } 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /examples/basic-mpa/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Home = () => { 4 | return ( 5 | <> 6 |

Home Page

7 | 8 | ); 9 | }; 10 | 11 | Home.pageConfig = { 12 | title: 'Home Page', 13 | }; 14 | 15 | export default Home; 16 | -------------------------------------------------------------------------------- /packages/plugin-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "$ice/components": ["./src/_components"] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/plugin-router/templates/useSearchParams.ts: -------------------------------------------------------------------------------- 1 | import { useLocation } from 'react-router-dom'; 2 | import * as queryString from 'query-string'; 3 | 4 | export const useSearchParams = () => { 5 | const location = useLocation(); 6 | return queryString.parse(location.search); 7 | }; 8 | -------------------------------------------------------------------------------- /examples/basic-spa/src/layouts/index.module.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | height: 70px; 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | } 7 | 8 | .main { 9 | display: flex; 10 | justify-content: center; 11 | flex-direction: column; 12 | align-items: center; 13 | } -------------------------------------------------------------------------------- /examples/basic-ssr/src/layouts/index.module.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | height: 70px; 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | } 7 | 8 | .main { 9 | display: flex; 10 | justify-content: center; 11 | flex-direction: column; 12 | align-items: center; 13 | } -------------------------------------------------------------------------------- /examples/basic-store/src/layouts/index.module.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | height: 70px; 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | } 7 | 8 | .main { 9 | display: flex; 10 | justify-content: center; 11 | flex-direction: column; 12 | align-items: center; 13 | } -------------------------------------------------------------------------------- /tsconfig.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "jsx": "react", 5 | "experimentalDecorators": true, 6 | "declaration": true, 7 | "sourceMap": false, 8 | "skipLibCheck": true, 9 | "forceConsistentCasingInFileNames": true 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # 忽略目录 2 | build/ 3 | test/ 4 | tests/ 5 | node_modules/ 6 | dist/ 7 | out/ 8 | 9 | # node 覆盖率文件 10 | coverage/ 11 | 12 | # 忽略测试文件 13 | /packages/*/__tests__ 14 | /packages/*/lib/ 15 | 16 | # 忽略第三方包 17 | /vendor/loader.js 18 | 19 | # 忽略文件 20 | **/*-min.js 21 | **/*.min.js 22 | 23 | workspace/ 24 | -------------------------------------------------------------------------------- /examples/icestark-child/src/app.ts: -------------------------------------------------------------------------------- 1 | import { createApp, IAppConfig } from 'ice'; 2 | 3 | const appConfig: IAppConfig = { 4 | app: { 5 | rootId: 'ice-container' 6 | }, 7 | logger: { 8 | level: 'warn' 9 | }, 10 | icestark: { 11 | type: 'child' 12 | }, 13 | }; 14 | 15 | createApp(appConfig); 16 | -------------------------------------------------------------------------------- /packages/plugin-core/src/_components.tsx: -------------------------------------------------------------------------------- 1 | // 该文件仅用于 module.tsx 中引用 $ice/components 的编译问题 2 | interface IProps { 3 | children?: any; 4 | Fallback?: any; 5 | onError?: Function; 6 | }; 7 | 8 | // eslint-disable-next-line 9 | export const ErrorBoundary = ({Fallback, onError, children}: IProps) => Fallback; 10 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/cliOption/analyzer.js: -------------------------------------------------------------------------------- 1 | const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); 2 | 3 | module.exports = (config, analyzer) => { 4 | if (analyzer) { 5 | config.plugin('webpack-bundle-analyzer') 6 | .use(BundleAnalyzerPlugin, [{ analyzerPort: '9000' }]); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /examples/basic-service/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Fetch from '@/components/Fetch'; 3 | import User from './components/User'; 4 | 5 | const Home = () => { 6 | return ( 7 | <> 8 | 9 | 10 | 11 | ); 12 | }; 13 | 14 | export default Home; 15 | -------------------------------------------------------------------------------- /examples/icestark-child/src/pages/Dashboard/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'ice'; 3 | 4 | const Dashboard = () => { 5 | return ( 6 | <> 7 |

Dashboard Page...

8 | About 9 | 10 | ); 11 | }; 12 | 13 | export default Dashboard; 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [makefile] 15 | indent_style = tab 16 | indent_size = 4 17 | -------------------------------------------------------------------------------- /packages/plugin-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "@/config": ["./src/_config"] 9 | } 10 | }, 11 | "exclude": [ 12 | "config/*" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/plugin-logger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.settings.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "src", 6 | "outDir": "lib", 7 | "paths": { 8 | "$ice/logger": ["./src/_logger"] 9 | } 10 | }, 11 | "exclude": [ 12 | "logger/*" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/plugin-react-app/src/cliOption/analyzerPort.js: -------------------------------------------------------------------------------- 1 | module.exports = (config, port) => { 2 | if (port && config.plugins.get('webpack-bundle-analyzer')) { 3 | config.plugin('webpack-bundle-analyzer').tap(([args]) => { 4 | const newArgs = {...args, analyzerPort: port }; 5 | return [newArgs]; 6 | }); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules 3 | jspm_packages 4 | 5 | # Only keep yarn.lock in the root 6 | package-lock.json 7 | */**/yarn.lock 8 | 9 | # Logs 10 | *.log 11 | 12 | # Packages 13 | packages/*/lib/ 14 | 15 | # temp folder .ice 16 | examples/*/.ice 17 | 18 | .eslintcache 19 | docs/.vuepress/dist/ 20 | 21 | build 22 | -------------------------------------------------------------------------------- /packages/create-ice/README.md: -------------------------------------------------------------------------------- 1 | # create-ice 2 | 3 | create icejs project. 4 | 5 | ## Usage 6 | 7 | ```bash 8 | $ npm init ice 9 | # or with template 10 | $ npm init ice