├── .changeset
├── README.md
├── config.json
└── fast-falcons-serve.md
├── .commitlintrc.js
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github
├── CONTRIBUTING.md
├── GIT_COMMIT_SPECIFIC.md
├── ISSUE_TEMPLATE
│ ├── Bug_Report.yml
│ └── RFC_Discussion.yml
└── workflows
│ ├── canary.yml
│ ├── ci.yml
│ ├── coverage.yml
│ ├── release.yml
│ ├── version.yml
│ └── website.yml
├── .gitignore
├── .husky
├── commit-msg
└── pre-commit
├── .npmrc
├── .prettierignore
├── .prettierrc.js
├── .puppeteerrc.cjs
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── codecov.yml
├── examples
├── app-config
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── error.tsx
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── basic-project
│ ├── .browserslistrc
│ ├── .env
│ ├── .env.development
│ ├── compatHtml.config.mts
│ ├── ice.config.mts
│ ├── mock
│ │ ├── foo.ts
│ │ └── user.ts
│ ├── package.json
│ ├── plugin.ts
│ ├── public
│ │ └── favicon.ico
│ ├── splitChunks.config.mts
│ ├── src
│ │ ├── app.tsx
│ │ ├── assets
│ │ │ └── robot.txt
│ │ ├── components
│ │ │ ├── PageUrl.tsx
│ │ │ ├── bar.tsx
│ │ │ └── cssWithEscapedSymbols.module.css
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── about.tsx
│ │ │ ├── blog.tsx
│ │ │ ├── client-only.tsx
│ │ │ ├── downgrade.tsx
│ │ │ ├── ice.png
│ │ │ ├── index.css
│ │ │ ├── index.module.css
│ │ │ ├── index.module.less
│ │ │ ├── index.module.scss
│ │ │ ├── index.tsx
│ │ │ ├── layout.tsx
│ │ │ └── var.scss
│ │ ├── standard-module.ts
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── cavans-project
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── bar.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── home.tsx
│ │ │ ├── ice.png
│ │ │ └── index.module.css
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── csr-project
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── bar.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── about.tsx
│ │ │ ├── blog.tsx
│ │ │ ├── ice.png
│ │ │ ├── index.module.css
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── disable-data-loader
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ └── index.tsx
│ └── tsconfig.json
├── hash-router
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── about.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── icestark-child
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── about.tsx
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── icestark-layout
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── page-seller
│ │ │ ├── assets
│ │ │ │ ├── index.css
│ │ │ │ ├── index.js
│ │ │ │ └── vendor.js
│ │ │ └── index.html
│ │ └── page-waiter
│ │ │ ├── assets
│ │ │ ├── main.css
│ │ │ ├── main.js
│ │ │ └── vendor.js
│ │ │ └── index.html
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── FrameworkLayout.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── about.tsx
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── memory-router
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── about.tsx
│ │ │ ├── dashboard
│ │ │ ├── blog.tsx
│ │ │ └── index.tsx
│ │ │ └── index.tsx
│ └── tsconfig.json
├── miniapp-project
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── mock
│ │ ├── foo.ts
│ │ └── user.ts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── README.md
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── Logo
│ │ │ │ └── index.css
│ │ │ └── bar.tsx
│ │ ├── document.tsx
│ │ ├── global.less
│ │ ├── pages
│ │ │ ├── fourth.tsx
│ │ │ ├── ice.png
│ │ │ ├── index.scss
│ │ │ ├── index.tsx
│ │ │ ├── second.tsx
│ │ │ └── third
│ │ │ │ ├── index.tsx
│ │ │ │ └── test.json
│ │ └── typings.d.ts
│ └── tsconfig.json
├── multi-target
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ └── about.tsx
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── rax-inline-style
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── HybridReactComponent
│ │ │ │ └── index.tsx
│ │ │ ├── InlineLess
│ │ │ │ ├── index.tsx
│ │ │ │ ├── x.less
│ │ │ │ └── x.module.less
│ │ │ ├── Logo
│ │ │ │ ├── index.jsx
│ │ │ │ └── index.module.less
│ │ │ └── Title
│ │ │ │ ├── index.jsx
│ │ │ │ └── index.module.css
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── rax-project
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── Logo
│ │ │ │ ├── index.jsx
│ │ │ │ └── index.module.css
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── index.jsx
│ │ │ ├── index.module.css
│ │ │ └── jsxplus.jsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── routes-config
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── bar.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── index.tsx
│ │ │ └── sales
│ │ │ │ ├── favorites.tsx
│ │ │ │ ├── index.module.css
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── overview.tsx
│ │ │ │ └── recommends.tsx
│ │ ├── routes.ts
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── routes-generate
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── $.tsx
│ │ │ ├── about.tsx
│ │ │ ├── dashboard
│ │ │ ├── a.tsx
│ │ │ ├── b.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ │ ├── detail
│ │ │ ├── $id.tsx
│ │ │ └── index.tsx
│ │ │ ├── index.tsx
│ │ │ ├── layout.tsx
│ │ │ └── products.tsx
│ └── tsconfig.json
├── single-route
│ ├── .env
│ ├── .env.development
│ ├── ice.config.mts
│ ├── optimization.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── home.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── with-antd-mobile
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── index.module.css
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ ├── store.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-antd
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ ├── index.less
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-antd5
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── locales.ts
│ │ ├── pages
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-auth
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── CustomAuth.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── blog.tsx
│ │ │ └── index.tsx
│ └── tsconfig.json
├── with-basename
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── about.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── with-data-loader
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── about.tsx
│ │ │ ├── blog1.tsx
│ │ │ ├── blog2.tsx
│ │ │ ├── home.tsx
│ │ │ ├── index.module.css
│ │ │ ├── layout.tsx
│ │ │ ├── with-defer-loader.tsx
│ │ │ ├── with-defer-loaders.tsx
│ │ │ └── with-ssr.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-dynamic
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── nonssr.tsx
│ │ │ └── normal.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── nonssr
│ │ │ │ ├── no-ssr-fallback.tsx
│ │ │ │ ├── no-ssr-no-fallback.tsx
│ │ │ │ ├── ssr-no-fallback.tsx
│ │ │ │ └── without-dynamic.tsx
│ │ │ └── normal
│ │ │ │ ├── bare-import.tsx
│ │ │ │ ├── basic.tsx
│ │ │ │ └── name-export.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-fallback-entry
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── plugin.ts
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── pages
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-first-chunk-cache-ssr
│ ├── ice.config.mts
│ ├── ice.png
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── Box
│ │ │ │ ├── index.module.css
│ │ │ │ └── index.tsx
│ │ │ └── List
│ │ │ │ ├── index.module.css
│ │ │ │ └── index.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── index.module.css
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-fusion
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.scss
│ │ ├── locales.ts
│ │ ├── pages
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-i18n
│ ├── ice.config.mts
│ ├── package.json
│ ├── server.mts
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── locales.ts
│ │ └── pages
│ │ │ ├── blog
│ │ │ ├── a.tsx
│ │ │ └── index.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── with-intl
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── global.css
│ │ ├── locales
│ │ │ ├── en-US.ts
│ │ │ └── zh-CN.json
│ │ ├── pages
│ │ │ └── index.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-jest
│ ├── ice.config.mts
│ ├── jest-setup.ts
│ ├── jest.config.mjs
│ ├── package.json
│ ├── src
│ │ ├── add.ts
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── Header.tsx
│ │ ├── document.tsx
│ │ ├── log.ts
│ │ └── pages
│ │ │ └── index.tsx
│ ├── tests
│ │ ├── Header.spec.tsx
│ │ └── add.spec.ts
│ └── tsconfig.json
├── with-jsx-plus
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── home.tsx
│ │ │ └── index.module.css
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-keep-alive-react
│ ├── README.md
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.ts
│ │ ├── components
│ │ │ └── Counter.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── about
│ │ │ ├── index.tsx
│ │ │ ├── layout.tsx
│ │ │ └── me.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── with-keep-alive
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.ts
│ │ ├── components
│ │ │ └── Count.tsx
│ │ ├── document.tsx
│ │ └── pages
│ │ │ ├── home.tsx
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ └── tsconfig.json
├── with-nested-routes
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── bar.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── about
│ │ │ │ ├── $id[.pdf].tsx
│ │ │ │ ├── [index].tsx
│ │ │ │ ├── a.b.tsx
│ │ │ │ ├── abc[.pdf].tsx
│ │ │ │ └── index.tsx
│ │ │ ├── index.tsx
│ │ │ └── sales
│ │ │ │ ├── favorites.tsx
│ │ │ │ ├── index.module.css
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── overview.tsx
│ │ │ │ └── recommends.tsx
│ │ ├── types.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-pha
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app-worker.ts
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── Custom
│ │ │ │ └── index.tsx
│ │ │ ├── about.tsx
│ │ │ ├── blog.tsx
│ │ │ ├── home.tsx
│ │ │ ├── index.module.css
│ │ │ └── layout.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-request
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── home.tsx
│ │ │ ├── index.module.css
│ │ │ └── layout.tsx
│ │ ├── service.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-ssg
│ ├── .browserslistrc
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── index.tsx
│ │ │ └── layout.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-store
│ ├── ice.config.mts
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── app.tsx
│ │ ├── document.tsx
│ │ ├── models
│ │ │ └── user.ts
│ │ ├── pages
│ │ │ ├── blog
│ │ │ │ ├── first-post.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── models
│ │ │ │ │ └── info.ts
│ │ │ │ └── store.ts
│ │ │ ├── ice.png
│ │ │ ├── index.tsx
│ │ │ ├── login.tsx
│ │ │ ├── models
│ │ │ │ └── counter.ts
│ │ │ └── store.ts
│ │ ├── store.ts
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-suspense-ssr
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── Comments.tsx
│ │ │ └── Footer.tsx
│ │ ├── document.tsx
│ │ ├── pages
│ │ │ ├── index.module.css
│ │ │ ├── index.tsx
│ │ │ ├── layout.tsx
│ │ │ ├── with-data-error.tsx
│ │ │ ├── with-fallback.tsx
│ │ │ └── with-render-error.tsx
│ │ └── typings.d.ts
│ └── tsconfig.json
├── with-tailwindcss
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── app.ts
│ │ ├── document.tsx
│ │ ├── global.css
│ │ └── pages
│ │ │ └── index.tsx
│ ├── tailwind.config.js
│ └── tsconfig.json
├── with-unocss
│ ├── ice.config.mts
│ ├── package.json
│ └── src
│ │ ├── app.ts
│ │ ├── document.tsx
│ │ └── pages
│ │ └── index.tsx
├── with-vitest
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ │ ├── add.ts
│ │ ├── app.tsx
│ │ ├── components
│ │ │ └── Header.tsx
│ │ ├── document.tsx
│ │ ├── log.ts
│ │ └── pages
│ │ │ └── index.tsx
│ ├── tests
│ │ ├── Header.spec.tsx
│ │ └── add.spec.ts
│ ├── tsconfig.json
│ ├── vitest-setup.ts
│ └── vitest.config.mjs
└── with-web-worker
│ ├── ice.config.mts
│ ├── package.json
│ ├── src
│ ├── app.ts
│ ├── document.tsx
│ ├── pages
│ │ └── index.tsx
│ ├── utils
│ │ └── pi.ts
│ └── worker.ts
│ └── tsconfig.json
├── package.json
├── packages
├── appear
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.tsx
│ │ ├── runtime.d.ts
│ │ ├── typings.ts
│ │ ├── web
│ │ │ ├── index.tsx
│ │ │ ├── intersection-observer.ts
│ │ │ ├── type.ts
│ │ │ └── visibility.ts
│ │ └── weex
│ │ │ └── index.tsx
│ ├── tests
│ │ └── visibilityChange.test.tsx
│ └── tsconfig.json
├── bundles
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── override
│ │ ├── RefreshUtils.js
│ │ └── rspack
│ │ │ └── bindingVersionCheck.js
│ ├── package.json
│ ├── scripts
│ │ ├── build.ts
│ │ └── tasks.ts
│ ├── src
│ │ ├── dev-server.ts
│ │ ├── index.ts
│ │ ├── plugin-refresh.ts
│ │ ├── react-refresh-runtime.ts
│ │ └── rspack.ts
│ ├── tsconfig.json
│ └── webpack
│ │ ├── bundle.js
│ │ ├── package.json
│ │ └── packages
│ │ ├── BasicEvaluatedExpression.js
│ │ ├── ChunkHelpers.js
│ │ ├── Compilation.js
│ │ ├── EntryDependency.js
│ │ ├── ExternalsPlugin.js
│ │ ├── FetchCompileAsyncWasmPlugin.js
│ │ ├── FetchCompileWasmPlugin.js
│ │ ├── FetchCompileWasmTemplatePlugin.js
│ │ ├── GraphHelpers.js
│ │ ├── HotUpdateChunk.js
│ │ ├── JavascriptModulesPlugin.js
│ │ ├── LazySet.js
│ │ ├── LibraryTemplatePlugin.js
│ │ ├── LimitChunkCountPlugin.js
│ │ ├── ModuleDependency.js
│ │ ├── ModuleFactory.js
│ │ ├── ModuleFilenameHelpers.js
│ │ ├── ModuleNotFoundError.js
│ │ ├── NodeEnvironmentPlugin.js
│ │ ├── NodeTargetPlugin.js
│ │ ├── NodeTemplatePlugin.js
│ │ ├── NormalModule.js
│ │ ├── SetHelpers.js
│ │ ├── SingleEntryPlugin.js
│ │ ├── SortableSet.js
│ │ ├── StartupChunkDependenciesPlugin.js
│ │ ├── StartupEntrypointRuntimeModule.js
│ │ ├── StartupHelpers.js
│ │ ├── StaticExportsDependency.js
│ │ ├── WebWorkerTemplatePlugin.js
│ │ ├── WebpackError.js
│ │ ├── comparators.js
│ │ ├── compileBooleanMatcher.js
│ │ ├── create-schema-validation.js
│ │ ├── extractUrlAndGlobal.js
│ │ ├── fs.js
│ │ ├── identifier.js
│ │ ├── index.js
│ │ ├── makeSerializable.js
│ │ ├── package.js
│ │ ├── semver.js
│ │ ├── sources.js
│ │ └── webpack-lib.js
├── cache-canvas
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.tsx
│ │ ├── storage.tsx
│ │ └── type.ts
│ └── tsconfig.json
├── create-ice
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── create.ts
│ │ └── index.mts
│ └── tsconfig.json
├── ice
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── bin
│ │ └── ice-cli.mjs
│ ├── openChrome.applescript
│ ├── package.json
│ ├── scripts
│ │ └── postinstall.mjs
│ ├── src
│ │ ├── bundler
│ │ │ ├── config
│ │ │ │ ├── defaultServerConfig.ts
│ │ │ │ ├── getUrls.ts
│ │ │ │ ├── middlewares.ts
│ │ │ │ ├── output.ts
│ │ │ │ └── plugins.ts
│ │ │ ├── rspack
│ │ │ │ ├── build.ts
│ │ │ │ ├── formatStats.ts
│ │ │ │ ├── getConfig.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── start.ts
│ │ │ ├── types.ts
│ │ │ └── webpack
│ │ │ │ ├── build.ts
│ │ │ │ ├── getWebpackConfig.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── start.ts
│ │ ├── commands
│ │ │ └── test.ts
│ │ ├── config.ts
│ │ ├── constant.ts
│ │ ├── createService.ts
│ │ ├── esbuild
│ │ │ ├── assets.ts
│ │ │ ├── cssModules.ts
│ │ │ ├── emptyCSS.ts
│ │ │ ├── external.ts
│ │ │ ├── externalNodeBuiltin.ts
│ │ │ ├── ignore.ts
│ │ │ ├── scan.ts
│ │ │ ├── transformImport.ts
│ │ │ └── transformPipe.ts
│ │ ├── getWatchEvents.ts
│ │ ├── index.ts
│ │ ├── middlewares
│ │ │ ├── dataLoaderMiddleware.ts
│ │ │ ├── mock
│ │ │ │ ├── createMiddleware.ts
│ │ │ │ └── getConfigs.ts
│ │ │ └── renderMiddleware.ts
│ │ ├── plugins
│ │ │ ├── task.ts
│ │ │ └── web
│ │ │ │ └── index.ts
│ │ ├── requireHook.ts
│ │ ├── routes.ts
│ │ ├── service
│ │ │ ├── Runner.ts
│ │ │ ├── ServerRunner.ts
│ │ │ ├── analyze.ts
│ │ │ ├── config.ts
│ │ │ ├── onDemandPreBundle.ts
│ │ │ ├── preBundleDeps.ts
│ │ │ ├── runtimeGenerator.ts
│ │ │ ├── serverCompiler.ts
│ │ │ ├── watchSource.ts
│ │ │ └── webpackServerCompiler
│ │ │ │ ├── compiler.ts
│ │ │ │ ├── removeMagicString.ts
│ │ │ │ └── virtualAssetPlugin.ts
│ │ ├── test
│ │ │ ├── defineJestConfig.ts
│ │ │ ├── defineVitestConfig.ts
│ │ │ ├── getTaskConfig.ts
│ │ │ └── index.ts
│ │ ├── types
│ │ │ ├── generator.ts
│ │ │ ├── index.ts
│ │ │ ├── plugin.ts
│ │ │ └── userConfig.ts
│ │ ├── utils
│ │ │ ├── ServerCompileTask.ts
│ │ │ ├── createSpinner.ts
│ │ │ ├── dynamicImport.ts
│ │ │ ├── emptyDir.ts
│ │ │ ├── escapeLocalIdent.ts
│ │ │ ├── flattenId.ts
│ │ │ ├── formatPath.ts
│ │ │ ├── formatWebpackMessages.ts
│ │ │ ├── generateEntry.ts
│ │ │ ├── getCSSModuleIdent.ts
│ │ │ ├── getEntryPoints.ts
│ │ │ ├── getGlobalStyleGlobPattern.ts
│ │ │ ├── getRoutePaths.ts
│ │ │ ├── getRouterBasename.ts
│ │ │ ├── getRuntimeModules.ts
│ │ │ ├── getServerCompilerPlugin.ts
│ │ │ ├── getServerEntry.ts
│ │ │ ├── hasDocument.ts
│ │ │ ├── hash.ts
│ │ │ ├── injectInitialEntry.ts
│ │ │ ├── isExternalBuiltinDep.ts
│ │ │ ├── logger.ts
│ │ │ ├── mergeTaskConfig.ts
│ │ │ ├── multipleEntry.ts
│ │ │ ├── openBrowser.ts
│ │ │ ├── persistentCache.ts
│ │ │ ├── prepareURLs.ts
│ │ │ ├── renderExportsTemplate.ts
│ │ │ ├── routeManifest.ts
│ │ │ ├── runtimeEnv.ts
│ │ │ ├── runtimePolyfill.ts
│ │ │ └── warnOnHashRouterEnabled.ts
│ │ └── webpack
│ │ │ ├── DataLoaderPlugin.ts
│ │ │ ├── ReCompilePlugin.ts
│ │ │ ├── ServerCompilerPlugin.ts
│ │ │ └── ServerRunnerPlugin.ts
│ ├── templates
│ │ ├── core
│ │ │ ├── document.tsx.ejs
│ │ │ ├── entry.client.tsx.ejs
│ │ │ ├── entry.server.ts.ejs
│ │ │ ├── env.server.ts.ejs
│ │ │ ├── env.ts.ejs
│ │ │ ├── index.ts.ejs
│ │ │ ├── route-manifest.json.ejs
│ │ │ ├── routes.tsx.ejs
│ │ │ ├── runtime-modules.ts.ejs
│ │ │ ├── type-defines.ts.ejs
│ │ │ └── types.ts.ejs
│ │ └── exports
│ │ │ ├── data-loader.ts.ejs
│ │ │ ├── dataloader-config.ts.ejs
│ │ │ └── routes-config.ts.ejs
│ ├── tests
│ │ ├── defineJestConfig.test.ts
│ │ ├── defineVitestConfig.test.ts
│ │ ├── fixtures
│ │ │ ├── ignore
│ │ │ │ ├── app.ts
│ │ │ │ └── dir
│ │ │ │ │ ├── ignored.ts
│ │ │ │ │ ├── nested
│ │ │ │ │ └── content.ts
│ │ │ │ │ └── page.ts
│ │ │ ├── nodeRunner
│ │ │ │ ├── basic
│ │ │ │ │ ├── a.js
│ │ │ │ │ └── entry.js
│ │ │ │ ├── circular
│ │ │ │ │ ├── a.js
│ │ │ │ │ ├── b.js
│ │ │ │ │ └── entry.js
│ │ │ │ ├── cjs
│ │ │ │ │ ├── a.js
│ │ │ │ │ ├── entry.js
│ │ │ │ │ └── package.json
│ │ │ │ ├── export-all
│ │ │ │ │ ├── a.js
│ │ │ │ │ └── entry.js
│ │ │ │ └── externalize
│ │ │ │ │ └── entry.js
│ │ │ ├── preAnalyze
│ │ │ │ ├── a.png
│ │ │ │ ├── app.ts
│ │ │ │ ├── component.ts
│ │ │ │ └── page.tsx
│ │ │ └── scan
│ │ │ │ ├── app.ts
│ │ │ │ ├── import.js
│ │ │ │ └── page.tsx
│ │ ├── formatWebpackMessages.test.ts
│ │ ├── generator.test.ts
│ │ ├── getRoutePaths.test.ts
│ │ ├── ignore.test.ts
│ │ ├── nodeRunner.test.ts
│ │ ├── openBrowser.test.ts
│ │ ├── preAnalyze.test.ts
│ │ ├── preBundleCJSDeps.test.ts
│ │ ├── scan.test.ts
│ │ └── transformImport.test.ts
│ ├── tsconfig.json
│ ├── types.d.ts
│ └── typings.d.ts
├── jsx-runtime
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.config.mts
│ ├── jsx-dev-runtime.js
│ ├── jsx-runtime.js
│ ├── package.json
│ ├── src
│ │ ├── createElement.ts
│ │ ├── dev.ts
│ │ ├── index.ts
│ │ ├── prod.ts
│ │ └── style.ts
│ ├── tests
│ │ └── hijackElememt.test.ts
│ └── tsconfig.json
├── miniapp-html-styles
│ ├── README.md
│ ├── html.css
│ ├── html5.css
│ └── package.json
├── miniapp-loader
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── component.ts
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── page.ts
│ │ ├── raw.ts
│ │ ├── taro-runtime.ts
│ │ └── utils
│ │ │ └── normalizePath.ts
│ └── tsconfig.json
├── miniapp-react-dom
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── props.ts
│ │ ├── reconciler.ts
│ │ └── render.ts
│ ├── tests
│ │ ├── context.spec.jsx
│ │ ├── findDOMNode.spec.jsx
│ │ ├── props.spec.jsx
│ │ └── unmountComponentAtNode.spec.jsx
│ └── tsconfig.json
├── miniapp-runtime
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── app
│ │ │ ├── App.tsx
│ │ │ ├── Link.tsx
│ │ │ ├── connect.tsx
│ │ │ ├── history.ts
│ │ │ ├── hooks.ts
│ │ │ ├── html
│ │ │ │ ├── constant.ts
│ │ │ │ ├── runtime.ts
│ │ │ │ └── utils.ts
│ │ │ ├── index.ts
│ │ │ ├── injectMiniappLifecycles.ts
│ │ │ ├── react-meta.ts
│ │ │ ├── routeContext.ts
│ │ │ ├── runClientApp.tsx
│ │ │ ├── suspense.ts
│ │ │ ├── usePageLifecycle.ts
│ │ │ ├── useSearchParams.ts
│ │ │ └── utils.ts
│ │ ├── bom
│ │ │ ├── document.ts
│ │ │ ├── getComputedStyle.ts
│ │ │ ├── navigator.ts
│ │ │ ├── raf.ts
│ │ │ └── window.ts
│ │ ├── constants
│ │ │ └── index.ts
│ │ ├── current.ts
│ │ ├── dom-external
│ │ │ ├── element.ts
│ │ │ ├── index.ts
│ │ │ ├── inner-html
│ │ │ │ ├── html.ts
│ │ │ │ ├── parser.ts
│ │ │ │ ├── scaner.ts
│ │ │ │ ├── style.ts
│ │ │ │ ├── tags.ts
│ │ │ │ └── utils.ts
│ │ │ ├── mutation-observer
│ │ │ │ ├── implements.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── record.ts
│ │ │ └── node.ts
│ │ ├── dom
│ │ │ ├── class-list.ts
│ │ │ ├── document.ts
│ │ │ ├── element.ts
│ │ │ ├── event-source.ts
│ │ │ ├── event-target.ts
│ │ │ ├── event.ts
│ │ │ ├── form.ts
│ │ │ ├── node.ts
│ │ │ ├── node_types.ts
│ │ │ ├── root.ts
│ │ │ ├── style.ts
│ │ │ ├── style_properties.ts
│ │ │ ├── svg.ts
│ │ │ ├── text.ts
│ │ │ └── tree.ts
│ │ ├── dsl
│ │ │ ├── common.ts
│ │ │ └── instance.ts
│ │ ├── emitter
│ │ │ └── emitter.ts
│ │ ├── env.ts
│ │ ├── hydrate.ts
│ │ ├── index.ts
│ │ ├── interface
│ │ │ ├── element.ts
│ │ │ ├── event-target.ts
│ │ │ ├── event.ts
│ │ │ ├── hydrate.ts
│ │ │ ├── index.ts
│ │ │ ├── node.ts
│ │ │ ├── options.ts
│ │ │ └── utils.ts
│ │ ├── next-tick.ts
│ │ ├── options.ts
│ │ ├── perf.ts
│ │ ├── tests
│ │ │ ├── dom.spec.jsx
│ │ │ ├── event.spec.js
│ │ │ ├── eventSource.spec.js
│ │ │ ├── exports.spec.js
│ │ │ ├── html.spec.js
│ │ │ ├── react.spec.js
│ │ │ ├── style.spec.js
│ │ │ └── utils.js
│ │ ├── types.ts
│ │ └── utils
│ │ │ └── index.ts
│ └── tsconfig.json
├── plugin-antd
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── plugin-auth
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── index.ts
│ │ ├── runtime
│ │ │ ├── Auth.tsx
│ │ │ └── index.tsx
│ │ └── types.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-cavans
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── plugin-css-assets-local
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── plugin-externals
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ └── webpack-plugin.ts
│ └── tsconfig.json
├── plugin-fusion
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── plugin-i18n
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.config.mts
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── runtime
│ │ │ ├── I18nContext.tsx
│ │ │ ├── hijackHistory.tsx
│ │ │ └── index.tsx
│ │ ├── templates
│ │ │ └── plugin-i18n.ts.ejs
│ │ ├── types.ts
│ │ ├── typings.d.ts
│ │ └── utils
│ │ │ ├── detectLocale.ts
│ │ │ ├── getLocaleFromCookie.ts
│ │ │ ├── getLocaleRedirectPath.ts
│ │ │ ├── getPreferredLocale.ts
│ │ │ ├── normalizeLocalePath.ts
│ │ │ ├── removeBasenameFromPath.ts
│ │ │ └── setLocaleToCookie.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-icestark
│ ├── CHANGELOG.md
│ ├── Context.d.ts
│ ├── README.md
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── index.ts
│ │ ├── runtime
│ │ │ ├── Context.tsx
│ │ │ ├── child.tsx
│ │ │ └── framework.tsx
│ │ └── types.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-intl
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── runtime-simple.d.ts
│ ├── runtime.d.ts
│ ├── src
│ │ ├── index.ts
│ │ ├── intl-until.ts
│ │ ├── runtime-simple.ts
│ │ ├── runtime.tsx
│ │ └── types.ts
│ ├── templates
│ │ └── locales.ts.ejs
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-jsx-plus
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tests
│ │ └── jsxplus.test.ts
│ └── tsconfig.json
├── plugin-miniapp
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── constant.ts
│ │ ├── helper
│ │ │ ├── constants.ts
│ │ │ ├── index.ts
│ │ │ ├── terminal.ts
│ │ │ └── utils.ts
│ │ ├── index.ts
│ │ ├── miniapp
│ │ │ ├── html
│ │ │ │ └── index.ts
│ │ │ ├── index.ts
│ │ │ └── webpack
│ │ │ │ ├── combination.ts
│ │ │ │ ├── dependencies
│ │ │ │ └── SingleEntryDependency.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── loaders
│ │ │ │ ├── miniTemplateLoader.ts
│ │ │ │ └── miniXScriptLoader.ts
│ │ │ │ ├── module.ts
│ │ │ │ ├── plugin.ts
│ │ │ │ ├── plugins
│ │ │ │ ├── LoadChunksPlugin.ts
│ │ │ │ ├── MiniPlugin.ts
│ │ │ │ ├── NormalModule.ts
│ │ │ │ ├── NormalModulesPlugin.ts
│ │ │ │ └── SingleEntryPlugin.ts
│ │ │ │ ├── template
│ │ │ │ ├── comp.ts
│ │ │ │ └── custom-wrapper.ts
│ │ │ │ └── utils
│ │ │ │ ├── component.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── webpack.ts
│ │ ├── runtime
│ │ │ └── index.ts
│ │ ├── targets
│ │ │ ├── ali
│ │ │ │ ├── components.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── runtime.ts
│ │ │ │ └── template.ts
│ │ │ ├── baidu
│ │ │ │ ├── components.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── runtime.ts
│ │ │ │ └── template.ts
│ │ │ ├── bytedance
│ │ │ │ ├── components.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── runtime.ts
│ │ │ │ └── template.ts
│ │ │ ├── index.ts
│ │ │ └── wechat
│ │ │ │ ├── components.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── runtime.ts
│ │ │ │ └── template.ts
│ │ └── types.ts
│ └── tsconfig.json
├── plugin-moment-locales
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── plugin-pha
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── constants.ts
│ │ ├── generateManifest.ts
│ │ ├── index.ts
│ │ ├── manifestHelpers.ts
│ │ ├── phaMiddleware.ts
│ │ └── types.ts
│ ├── template
│ │ └── appWorker.ejs
│ ├── tests
│ │ ├── app-worker.ts
│ │ ├── fixtures
│ │ │ ├── export-specifier.ts
│ │ │ ├── export-variable.ts
│ │ │ ├── function-exports.ts
│ │ │ ├── if.ts
│ │ │ ├── iife.ts
│ │ │ ├── import.ts
│ │ │ ├── reference.ts
│ │ │ ├── vars.ts
│ │ │ └── while.ts
│ │ ├── manifestHelper.test.ts
│ │ ├── mockConfig.mjs
│ │ ├── mockServer.mjs
│ │ ├── pha-work.js
│ │ └── route-manifest.json
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-rax-compat
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ └── transform-styles.ts
│ │ ├── services
│ │ │ ├── alias.ts
│ │ │ ├── jsx.ts
│ │ │ ├── styles
│ │ │ │ ├── applyClientSideProcessor.ts
│ │ │ │ ├── applyJSXClassNameTransormer.ts
│ │ │ │ ├── applyServerSideProcessor.ts
│ │ │ │ └── index.ts
│ │ │ └── typings.ts
│ │ ├── templates
│ │ │ ├── rax-compat-legacy-exports.ts.template
│ │ │ └── rax-compat.d.ts
│ │ ├── typings.ts
│ │ └── utils.ts
│ └── tsconfig.json
├── plugin-request
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── hooks.d.ts
│ ├── package.json
│ ├── request.d.ts
│ ├── runtime.d.ts
│ ├── src
│ │ ├── hooks.ts
│ │ ├── index.ts
│ │ ├── request.ts
│ │ ├── runtime.ts
│ │ └── types.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-store
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── runtime.d.ts
│ ├── src
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── runtime.tsx
│ │ └── types.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── plugin-stream-error
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── components
│ │ │ └── headStreamErrorRecoverScript.tsx
│ │ └── index.tsx
│ └── tsconfig.json
├── plugin-unocss
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── uno.css
├── rax-compat
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.config.mts
│ ├── package.json
│ ├── plugin.mjs
│ ├── src
│ │ ├── children.ts
│ │ ├── clone-element.ts
│ │ ├── compat
│ │ │ ├── element.ts
│ │ │ └── input.ts
│ │ ├── component.ts
│ │ ├── container-root-map.ts
│ │ ├── context.ts
│ │ ├── create-class.ts
│ │ ├── create-element.ts
│ │ ├── create-factory.ts
│ │ ├── create-portal.ts
│ │ ├── events.ts
│ │ ├── exports.ts
│ │ ├── find-dom-node.ts
│ │ ├── fragment.ts
│ │ ├── hooks.ts
│ │ ├── index.ts
│ │ ├── is-valid-element.ts
│ │ ├── is.ts
│ │ ├── possible-standard-names.ts
│ │ ├── props.ts
│ │ ├── ref.ts
│ │ ├── render.ts
│ │ ├── runtime
│ │ │ ├── index.ts
│ │ │ ├── jsx-dev-runtime.ts
│ │ │ └── jsx-runtime.ts
│ │ ├── shared.ts
│ │ ├── style.ts
│ │ ├── type.ts
│ │ ├── typing.d.ts
│ │ └── unmount-component-at-node.ts
│ ├── tests
│ │ ├── children.test.tsx
│ │ ├── cloneElement.test.tsx
│ │ ├── component.test.tsx
│ │ ├── createElement.test.tsx
│ │ ├── createFactory.test.tsx
│ │ ├── createPortal.test.tsx
│ │ ├── createReactClass.test.tsx
│ │ ├── events.test.tsx
│ │ ├── findDomNode.test.tsx
│ │ ├── fragment.test.tsx
│ │ ├── hooks.test.tsx
│ │ ├── inputElement.test.tsx
│ │ ├── isValidElement.test.tsx
│ │ ├── libs
│ │ │ ├── rax-clone-element.js
│ │ │ ├── rax-create-portal.js
│ │ │ ├── rax-is-valid-element.js
│ │ │ └── rax-unmount-component-at-node.js
│ │ ├── props.test.tsx
│ │ ├── render.test.tsx
│ │ └── shared.test.tsx
│ └── tsconfig.json
├── route-manifest
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ └── routes.ts
│ ├── tests
│ │ ├── __snapshots__
│ │ │ ├── formatNestedRouteManifest.spec.ts.snap
│ │ │ ├── generateRouteManifest.spec.ts.snap
│ │ │ └── parseRoute.spec.ts.snap
│ │ ├── fixtures
│ │ │ ├── basic-routes
│ │ │ │ └── src
│ │ │ │ │ ├── document.tsx
│ │ │ │ │ └── pages
│ │ │ │ │ ├── About
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── me
│ │ │ │ │ │ └── index.tsx
│ │ │ │ │ ├── home.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── layout.tsx
│ │ │ ├── define-absolute-route
│ │ │ │ └── src
│ │ │ │ │ └── inedx.tsx
│ │ │ ├── dot-delimeters-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── home.news.tsx
│ │ │ │ │ └── layout.tsx
│ │ │ ├── dynamic-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── about.tsx
│ │ │ │ │ ├── blog
│ │ │ │ │ ├── $id.tsx
│ │ │ │ │ └── index.tsx
│ │ │ │ │ └── index.tsx
│ │ │ ├── escape-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── 1[.pdf].tsx
│ │ │ │ │ └── [index].tsx
│ │ │ ├── invalid-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── #a.tsx
│ │ │ │ │ ├── home.tsx
│ │ │ │ │ └── layout.tsx
│ │ │ ├── layout-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── about.tsx
│ │ │ │ │ ├── blog
│ │ │ │ │ ├── $id.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── layout.tsx
│ │ │ │ │ ├── home
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ ├── layout.tsx
│ │ │ │ │ └── layout
│ │ │ │ │ │ └── index.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── layout.tsx
│ │ │ ├── nested-routes
│ │ │ │ └── src
│ │ │ │ │ └── pages
│ │ │ │ │ ├── a
│ │ │ │ │ └── b
│ │ │ │ │ │ └── c.tsx
│ │ │ │ │ └── d.e.f.tsx
│ │ │ └── splat-routes
│ │ │ │ └── src
│ │ │ │ └── pages
│ │ │ │ ├── $.tsx
│ │ │ │ ├── home.tsx
│ │ │ │ └── layout.tsx
│ │ ├── formatNestedRouteManifest.spec.ts
│ │ ├── generateRouteManifest.spec.ts
│ │ └── parseRoute.spec.ts
│ └── tsconfig.json
├── rspack-config
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── assetsRule.ts
│ │ ├── client
│ │ │ └── reactRefresh.cts
│ │ ├── cssRules.ts
│ │ ├── index.ts
│ │ └── splitChunks.ts
│ └── tsconfig.json
├── runtime
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── data-loader.d.ts
│ ├── document.d.ts
│ ├── matchRoutes.d.ts
│ ├── package.json
│ ├── router.d.ts
│ ├── scripts
│ │ └── postinstall.mjs
│ ├── server.d.ts
│ ├── src
│ │ ├── Activity.tsx
│ │ ├── App.tsx
│ │ ├── AppContext.tsx
│ │ ├── AppErrorBoundary.tsx
│ │ ├── ClientOnly.tsx
│ │ ├── ClientRouter.tsx
│ │ ├── Document.tsx
│ │ ├── KeepAliveOutlet.tsx
│ │ ├── RouteContext.ts
│ │ ├── RouteWrapper.tsx
│ │ ├── ServerRouter.tsx
│ │ ├── Suspense.tsx
│ │ ├── appConfig.ts
│ │ ├── appData.ts
│ │ ├── dataLoader.ts
│ │ ├── domRender.ts
│ │ ├── dynamic.tsx
│ │ ├── history.ts
│ │ ├── index.server.ts
│ │ ├── index.ts
│ │ ├── jsx-dev-runtime.ts
│ │ ├── jsx-runtime.ts
│ │ ├── matchRoutes.ts
│ │ ├── polyfills
│ │ │ ├── abortcontroller.js
│ │ │ └── signal.ts
│ │ ├── proxyData.ts
│ │ ├── react.ts
│ │ ├── renderDocument.tsx
│ │ ├── reportRecoverableError.ts
│ │ ├── requestContext.ts
│ │ ├── router.ts
│ │ ├── routes.tsx
│ │ ├── routesConfig.ts
│ │ ├── runClientApp.tsx
│ │ ├── runServerApp.tsx
│ │ ├── runtime.tsx
│ │ ├── server
│ │ │ ├── getDocumentData.ts
│ │ │ ├── response.ts
│ │ │ └── streamRender.tsx
│ │ ├── singleRouter.tsx
│ │ ├── types.ts
│ │ ├── useMounted.tsx
│ │ ├── usePageLifecycle.ts
│ │ └── utils
│ │ │ ├── addLeadingSlash.ts
│ │ │ ├── createSearchParams.ts
│ │ │ ├── deprecatedHistory.ts
│ │ │ └── getCurrentRoutePath.ts
│ ├── tests
│ │ ├── appConfig.test.ts
│ │ ├── domRender.test.ts
│ │ ├── proxyData.test.ts
│ │ ├── routes.test.tsx
│ │ ├── routesConfig.test.ts
│ │ ├── runClientApp.test.tsx
│ │ ├── runServerApp.test.tsx
│ │ ├── singleRoute.test.tsx
│ │ └── templateParse.test.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── shared-config
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── compileExcludes.ts
│ │ ├── getAlias.ts
│ │ ├── getCSSModuleLocalIdent.ts
│ │ ├── getCompilerPlugins.ts
│ │ ├── getDefineVars.ts
│ │ ├── getPostcssOpts.ts
│ │ ├── index.ts
│ │ ├── types.ts
│ │ ├── unPlugins
│ │ │ ├── compilation.ts
│ │ │ └── redirectImport.ts
│ │ ├── utils
│ │ │ ├── getDevtool.ts
│ │ │ └── transformImport.ts
│ │ └── webpackLoaders
│ │ │ └── compilationLoader.cts
│ ├── tests
│ │ ├── fixtures
│ │ │ ├── redirectImport
│ │ │ │ ├── alias.js
│ │ │ │ ├── aliasWithAs.js
│ │ │ │ ├── as.js
│ │ │ │ ├── basic.js
│ │ │ │ ├── matched.js
│ │ │ │ ├── missmatch.js
│ │ │ │ └── multiple.js
│ │ │ └── transformImport
│ │ │ │ ├── cjs.js
│ │ │ │ ├── esm.js
│ │ │ │ ├── importMeta.js
│ │ │ │ ├── match.js
│ │ │ │ ├── missmatch.js
│ │ │ │ ├── specialIdentifier.js
│ │ │ │ ├── stringInclude.js
│ │ │ │ ├── swc-esm.js
│ │ │ │ └── swc.js
│ │ ├── redirectImport.test.ts
│ │ └── transformImport.test.ts
│ ├── tsconfig.json
│ └── types.d.ts
├── shared
│ ├── CHANGELOG.md
│ ├── package.json
│ ├── src
│ │ ├── event-emitter.ts
│ │ ├── index.ts
│ │ ├── is.ts
│ │ ├── miniapp
│ │ │ ├── components.ts
│ │ │ ├── runtime-hooks.ts
│ │ │ ├── shortcuts.ts
│ │ │ ├── template.ts
│ │ │ └── utils.ts
│ │ └── utils.ts
│ └── tsconfig.json
├── style-import
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tests
│ │ └── importStyle.test.ts
│ └── tsconfig.json
├── webpack-config
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── config
│ │ │ ├── assets.ts
│ │ │ ├── css.ts
│ │ │ └── splitChunks.ts
│ │ ├── index.ts
│ │ └── webpackPlugins
│ │ │ ├── AssetsManifestPlugin.ts
│ │ │ └── EnvReplacementPlugin.ts
│ ├── tsconfig.json
│ └── types.d.ts
└── webpack-modify
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ └── index.ts
│ ├── tests
│ └── api.test.ts
│ └── tsconfig.json
├── patches
├── @rspack__core@0.5.7.patch
└── unplugin@1.6.0.patch
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── scripts
├── dependencyCheck.ts
├── getPackages.ts
└── setupUser.ts
├── tests
├── integration
│ ├── app-config.test.ts
│ ├── basic-project.test.ts
│ ├── disable-data-loader.test.ts
│ ├── hash-router.test.ts
│ ├── icestark-child.test.ts
│ ├── icestark-layout.test.ts
│ ├── memory-router.test.ts
│ ├── miniapp-project.test.ts
│ ├── multi-target.test.ts
│ ├── rax-inline-style.test.ts
│ ├── rax-project.test.ts
│ ├── routes-config.test.ts
│ ├── routes-generate.test.ts
│ ├── single-router.test.ts
│ ├── with-antd-mobile.test.ts
│ ├── with-auth.test.ts
│ ├── with-data-loader.test.ts
│ ├── with-dynamic.test.ts
│ ├── with-fallback-entry.test.ts
│ ├── with-i18n.test.ts
│ ├── with-request.test.ts
│ ├── with-ssg.test.ts
│ ├── with-store.test.ts
│ └── with-suspense-ssr.test.ts
└── utils
│ ├── browser.ts
│ ├── build.ts
│ ├── executeCommand.ts
│ ├── start.ts
│ └── test-plugin.ts
├── tsconfig.base.json
├── vitest.config.ts
└── website
├── README.md
├── babel.config.js
├── config
├── footer.js
├── navbar.js
└── sidebars.js
├── docs
└── guide
│ ├── about.md
│ ├── advanced
│ ├── antd.md
│ ├── auth.md
│ ├── code-splitting.md
│ ├── css-assets-local.md
│ ├── deploy.md
│ ├── faas.md
│ ├── fusion.md
│ ├── i18n.md
│ ├── icestark.md
│ ├── integrate-from-rax.md
│ ├── jsx-plus.md
│ ├── keep-alive.md
│ ├── micro-frontends.md
│ ├── rax-compat.md
│ ├── request.md
│ ├── store.md
│ ├── unit-test.md
│ ├── unocss.md
│ └── update-from-icejs2.md
│ ├── basic
│ ├── api.md
│ ├── app.md
│ ├── appear.md
│ ├── assets.md
│ ├── cli.md
│ ├── config.md
│ ├── data-loader.md
│ ├── development.md
│ ├── directory.md
│ ├── document.md
│ ├── env.md
│ ├── mock.md
│ ├── page.md
│ ├── router.md
│ ├── ssg.md
│ ├── ssr.md
│ └── style.md
│ ├── miniapp
│ ├── api.md
│ ├── app-config.md
│ ├── component-use.md
│ ├── native-lifecycle-events.md
│ ├── project-config.md
│ ├── router.md
│ ├── start.md
│ ├── sub-packages.md
│ └── use-html.md
│ ├── plugins
│ ├── plugin-dev.md
│ └── plugin-list.md
│ ├── practice.md
│ └── start.md
├── docusaurus.config.js
├── package.json
├── plugins
└── redirect.js
├── scripts
└── getDocsFromDir.js
├── src
├── components
│ ├── AreaWrapper
│ │ ├── area.module.css
│ │ └── index.jsx
│ ├── Badge
│ │ ├── badge.module.css
│ │ └── index.jsx
│ ├── Button
│ │ ├── button.module.css
│ │ └── index.jsx
│ ├── Ecology
│ │ ├── ecology.module.css
│ │ └── index.jsx
│ ├── Feature
│ │ ├── feature.module.css
│ │ └── index.jsx
│ ├── Redirect
│ │ └── index.jsx
│ ├── Splash
│ │ ├── index.jsx
│ │ └── splash.module.css
│ ├── Support
│ │ ├── index.jsx
│ │ └── support.module.css
│ └── Users
│ │ ├── index.jsx
│ │ └── users.module.css
├── css
│ └── custom.css
├── pages
│ └── index.jsx
├── theme
│ ├── Root.js
│ └── Root.module.css
└── utils
│ ├── internal.js
│ ├── path.js
│ └── storage.js
└── static
├── .nojekyll
└── img
├── favicon.ico
├── logo.png
├── mf_01.png
├── mf_02.png
├── solution_01.png
├── solution_02.png
├── solution_03.png
├── solution_04.png
├── splash.png
└── svg
├── vite-gray.svg
├── vite.svg
├── webpack-gray.svg
└── webpack.svg
/.changeset/fast-falcons-serve.md:
--------------------------------------------------------------------------------
1 | ---
2 | '@ice/appear': patch
3 | ---
4 |
5 | fix appear event handler callback refs in WeexAppear component
6 |
--------------------------------------------------------------------------------
/.commitlintrc.js:
--------------------------------------------------------------------------------
1 | const { getCommitlintConfig } = require('@applint/spec');
2 |
3 | module.exports = getCommitlintConfig('common');
4 |
--------------------------------------------------------------------------------
/.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 | quote_type=single
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [makefile]
16 | indent_style = tab
17 | indent_size = 4
18 |
19 | [*.rs]
20 | indent_style = space
21 | indent_size = 4
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | # 忽略目录
2 | build/
3 | fixtures/
4 | node_modules/
5 | dist/
6 | out/
7 | compiled/
8 | public/
9 |
10 | # node 覆盖率文件
11 | coverage/
12 |
13 | # 忽略测试文件
14 | /packages/*/lib/
15 | /packages/*/esm/
16 | /packages/*/es2017/
17 | /packages/*/es2021/
18 | **/tests/libs/*.js
19 |
20 | # 忽略第三方包
21 | /vendor/loader.js
22 | override/
23 |
24 | # 忽略文件
25 | **/*-min.js
26 | **/*.min.js
27 |
28 | workspace/
29 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no -- commitlint --edit $1
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | strict-peer-dependencies=false
2 | registry=https://registry.npmjs.org/
3 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .ice
3 | dist
4 | *.d.ts
5 | *.js
6 | fixtures
7 | *.md
8 | *.yaml
9 | *.less
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | const { getPrettierConfig } = require('@applint/spec');
2 | module.exports = getPrettierConfig('common');
--------------------------------------------------------------------------------
/.puppeteerrc.cjs:
--------------------------------------------------------------------------------
1 | const { join } = require('path');
2 |
3 | /**
4 | * @type {import("puppeteer").Configuration}
5 | */
6 | module.exports = {
7 | // Changes the cache location for Puppeteer.
8 | cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
9 | };
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | patch: off
4 | project:
5 | default:
6 | threshold: 5%
7 |
8 | github_checks:
9 | annotations: false
--------------------------------------------------------------------------------
/examples/app-config/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/app-config/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import externals from '@ice/plugin-externals';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [externals({ preset: 'react' })]
6 | }));
7 |
--------------------------------------------------------------------------------
/examples/app-config/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/app-config/public/favicon.ico
--------------------------------------------------------------------------------
/examples/app-config/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | strict: true,
7 | errorBoundary: true,
8 | },
9 | router: {
10 | type: 'browser',
11 | basename: '/ice',
12 | },
13 | }));
14 |
--------------------------------------------------------------------------------
/examples/app-config/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/app-config/src/pages/error.tsx:
--------------------------------------------------------------------------------
1 | export default function Error() {
2 | // @ts-ignore
3 | window.test();
4 | return <>error>;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/app-config/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return
home
;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/app-config/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/basic-project/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/basic-project/.env:
--------------------------------------------------------------------------------
1 | ICE_ENV=common
--------------------------------------------------------------------------------
/examples/basic-project/.env.development:
--------------------------------------------------------------------------------
1 | ICE_ENV=development
--------------------------------------------------------------------------------
/examples/basic-project/compatHtml.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import defaultConfig from './ice.config.mjs';
3 |
4 | export default defineConfig(() => ({
5 | ...defaultConfig,
6 | htmlGenerating: {
7 | mode: 'compat'
8 | }
9 | }));
10 |
--------------------------------------------------------------------------------
/examples/basic-project/mock/foo.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | '/api/foo': { foo: 'foo' },
3 | };
--------------------------------------------------------------------------------
/examples/basic-project/mock/user.ts:
--------------------------------------------------------------------------------
1 | import type { Request, Response } from '@ice/app';
2 |
3 | export default {
4 | 'GET /api/users': ['a', 'b'],
5 | 'POST /api/users/:id': (request: Request, response: Response) => {
6 | const { id } = request.params;
7 | response.send({ id: id });
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/examples/basic-project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/basic-project/public/favicon.ico
--------------------------------------------------------------------------------
/examples/basic-project/splitChunks.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import defaultConfig from './ice.config.mjs';
3 |
4 | export default defineConfig(() => ({
5 | ...defaultConfig,
6 | splitChunks: false,
7 | minify: false,
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/basic-project/src/assets/robot.txt:
--------------------------------------------------------------------------------
1 | text
--------------------------------------------------------------------------------
/examples/basic-project/src/components/PageUrl.tsx:
--------------------------------------------------------------------------------
1 | export default function PageUrl() {
2 | return page url is {window.location.href};
3 | }
4 |
--------------------------------------------------------------------------------
/examples/basic-project/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | import style from './cssWithEscapedSymbols.module.css';
2 |
3 | console.log('style', style.test);
4 |
5 | export default function Bar() {
6 | return (
7 |
8 | bar
9 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/examples/basic-project/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/basic-project/src/pages/ice.png
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/index.css:
--------------------------------------------------------------------------------
1 | h2 {
2 | color: #000;
3 | }
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
6 | .data {
7 | margin-top: 10px;
8 | }
9 |
10 | .homeContainer {
11 | align-items: center;
12 | margin-top: 200rpx;
13 | }
14 |
15 | .homeTitle {
16 | font-size: 45rpx;
17 | font-weight: bold;
18 | margin: 20rpx 0;
19 | }
20 |
21 | .homeInfo {
22 | font-size: 36rpx;
23 | margin: 8rpx 0;
24 | color: #555;
25 | }
26 |
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/index.module.less:
--------------------------------------------------------------------------------
1 | .data {
2 | margin-top: 10px;
3 | }
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/index.module.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | .data {
4 | margin-top: 10px;
5 | }
--------------------------------------------------------------------------------
/examples/basic-project/src/pages/var.scss:
--------------------------------------------------------------------------------
1 | $color-1 : #fff;
--------------------------------------------------------------------------------
/examples/basic-project/src/standard-module.ts:
--------------------------------------------------------------------------------
1 | export function printOne() {
2 | console.log(1);
3 | }
4 |
--------------------------------------------------------------------------------
/examples/basic-project/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/basic-project/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare const HAHA: string;
--------------------------------------------------------------------------------
/examples/cavans-project/.browserslistrc:
--------------------------------------------------------------------------------
1 | defaults
2 | ios_saf 9
3 |
--------------------------------------------------------------------------------
/examples/cavans-project/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import canvasPlugin from '@ice/plugin-canvas';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [
6 | canvasPlugin(),
7 | ],
8 | ssr: true,
9 | ssg: false,
10 | }));
11 |
--------------------------------------------------------------------------------
/examples/cavans-project/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/cavans-project/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | export default function Bar() {
2 | return (
3 |
4 | bar
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/cavans-project/src/pages/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/cavans-project/src/pages/ice.png
--------------------------------------------------------------------------------
/examples/cavans-project/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | }
--------------------------------------------------------------------------------
/examples/cavans-project/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | }
--------------------------------------------------------------------------------
/examples/cavans-project/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/csr-project/.browserslistrc:
--------------------------------------------------------------------------------
1 | defaults
2 | ios_saf 9
3 |
--------------------------------------------------------------------------------
/examples/csr-project/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 | import { defineAuthConfig } from '@ice/plugin-auth/types';
3 |
4 | console.log('__LOG__');
5 | console.warn('__WARN__');
6 | console.error('__ERROR__');
7 |
8 | export const authConfig = defineAuthConfig(() => {
9 | return {
10 | initialAuth: {
11 | admin: true,
12 | },
13 | };
14 | });
15 |
16 | export default defineAppConfig(() => ({}));
17 |
--------------------------------------------------------------------------------
/examples/csr-project/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | export default function Bar() {
2 | return (
3 |
4 | bar
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/csr-project/src/pages/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/csr-project/src/pages/ice.png
--------------------------------------------------------------------------------
/examples/csr-project/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | }
--------------------------------------------------------------------------------
/examples/csr-project/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | auth: {
4 | [key: string]: boolean;
5 | };
6 | }
--------------------------------------------------------------------------------
/examples/csr-project/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/disable-data-loader/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | dataLoader: false,
5 | }));
6 |
--------------------------------------------------------------------------------
/examples/disable-data-loader/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig, defineDataLoader } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | },
7 | }));
8 |
9 | export const dataLoader = defineDataLoader(() => {
10 | return new Promise((resolve) => {
11 | resolve({
12 | title: 'gogogogo',
13 | auth: {
14 | admin: true,
15 | },
16 | });
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/examples/hash-router/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | ssr: false,
5 | ssg: false,
6 | }));
7 |
--------------------------------------------------------------------------------
/examples/hash-router/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | router: {
5 | type: 'hash',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/hash-router/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | About Page
7 | Home
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/hash-router/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | Home
7 | about
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/hash-router/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet, useConfig } from 'ice';
2 |
3 | export default () => {
4 | const config = useConfig();
5 | return (
6 |
7 |
Layout
8 | {config.title}
9 |
10 |
11 | );
12 | };
13 |
14 | export function pageConfig() {
15 | return {
16 | title: 'Hash Router Demo',
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/examples/icestark-child/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import icestark from '@ice/plugin-icestark';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [
6 | icestark({
7 | type: 'child',
8 | }),
9 | ]
10 | }));
11 |
--------------------------------------------------------------------------------
/examples/icestark-child/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/icestark-child/public/favicon.ico
--------------------------------------------------------------------------------
/examples/icestark-child/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function About() {
4 | return (
5 | <>
6 | About Page
7 | home
8 | >
9 | );
10 | }
--------------------------------------------------------------------------------
/examples/icestark-child/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | Home Page
7 | about
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/icestark-child/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/icestark-layout/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/icestark-layout/public/favicon.ico
--------------------------------------------------------------------------------
/examples/icestark-layout/public/page-waiter/assets/main.css:
--------------------------------------------------------------------------------
1 | .wrapper[data-v-123114aa]{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}a[data-v-3cf51fd6]{color:#42b983}label[data-v-3cf51fd6]{margin:0 .5em;font-weight:700}code[data-v-3cf51fd6]{background-color:#eee;padding:2px 4px;border-radius:4px;color:#304455}
2 |
--------------------------------------------------------------------------------
/examples/icestark-layout/public/page-waiter/index.html:
--------------------------------------------------------------------------------
1 | Vite App
2 |
--------------------------------------------------------------------------------
/examples/icestark-layout/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | }
--------------------------------------------------------------------------------
/examples/icestark-layout/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function About() {
4 | return (
5 | <>
6 | About Page
7 | home
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/icestark-layout/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | Home Page
7 | about
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/icestark-layout/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/memory-router/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | publicPath: '/',
5 | ssr: false,
6 | ssg: false,
7 | codeSplitting: 'page',
8 | routes: {
9 | injectInitialEntry: true,
10 | }
11 | }));
12 |
--------------------------------------------------------------------------------
/examples/memory-router/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | router: {
5 | type: 'memory',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/memory-router/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function About() {
4 | const [count, setCount] = useState(0);
5 | return (
6 |
7 |
About: {count}
8 |
{ setCount(count + 1); }}>+add
9 |
10 | );
11 | }
--------------------------------------------------------------------------------
/examples/memory-router/src/pages/dashboard/blog.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function Blog() {
4 | const [count, setCount] = useState(0);
5 | return (
6 |
7 |
Blog: {count}
8 |
{ setCount(count + 1); }}>+add
9 |
10 | );
11 | }
--------------------------------------------------------------------------------
/examples/memory-router/src/pages/dashboard/index.tsx:
--------------------------------------------------------------------------------
1 | export default function Dashboard() {
2 | return (
3 |
4 |
dashboard
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/memory-router/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function Home() {
4 | const [count, setCount] = useState(0);
5 | return (
6 |
7 |
Home: {count}
8 |
{ setCount(count + 1); }}>+add
9 |
10 | );
11 | }
--------------------------------------------------------------------------------
/examples/miniapp-project/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/miniapp-project/mock/foo.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | '/api/foo': { foo: 'foo' },
3 | };
--------------------------------------------------------------------------------
/examples/miniapp-project/mock/user.ts:
--------------------------------------------------------------------------------
1 | import type { Request, Response } from '@ice/app';
2 |
3 | export default {
4 | 'GET /api/users': ['a', 'b'],
5 | 'POST /api/users/:id': (req: Request, res: Response) => {
6 | const { id } = req.params;
7 | res.send({ id: id });
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/examples/miniapp-project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/miniapp-project/public/favicon.ico
--------------------------------------------------------------------------------
/examples/miniapp-project/src/components/Logo/index.css:
--------------------------------------------------------------------------------
1 | .logo {
2 | width: 200rpx;
3 | height: 180rpx;
4 | margin-bottom: 20rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/miniapp-project/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | export default function Bar() {
2 | return (
3 |
4 | bar
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/miniapp-project/src/global.less:
--------------------------------------------------------------------------------
1 | @import '@ice/miniapp-html-styles/html';
2 |
3 | .global {
4 | font-size: 14px;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/miniapp-project/src/pages/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/miniapp-project/src/pages/ice.png
--------------------------------------------------------------------------------
/examples/miniapp-project/src/pages/index.scss:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
6 | .data {
7 | margin-top: 10px;
8 | }
9 |
10 | .homeContainer {
11 | align-items: center;
12 | margin-top: 200rpx;
13 | }
14 |
15 | .homeTitle {
16 | font-size: 45rpx;
17 | font-weight: bold;
18 | margin: 20rpx 0;
19 | }
20 |
21 | .homeInfo {
22 | font-size: 36rpx;
23 | margin: 8rpx 0;
24 | color: #555;
25 | }
26 |
--------------------------------------------------------------------------------
/examples/miniapp-project/src/pages/third/index.tsx:
--------------------------------------------------------------------------------
1 | import url from '../ice.png';
2 | import json from './test.json';
3 |
4 | export default function Third() {
5 | console.log('[Third] get json', json);
6 | return (
7 | <>
8 | Third Page
9 | 我是 div 标签
10 | 我是 span 标签
11 |
12 | >
13 | );
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/examples/miniapp-project/src/pages/third/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chris",
3 | "age": 20
4 | }
5 |
--------------------------------------------------------------------------------
/examples/multi-target/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/multi-target/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | ssr: true,
5 | define: {
6 | 'process.env.NODE_ENV': JSON.stringify(true),
7 | },
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/multi-target/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/multi-target/public/favicon.ico
--------------------------------------------------------------------------------
/examples/multi-target/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({ }));
4 |
--------------------------------------------------------------------------------
/examples/multi-target/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/multi-target/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (Target={import.meta.target} Renderer={import.meta.renderer}
);
3 | }
4 |
--------------------------------------------------------------------------------
/examples/multi-target/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/examples/multi-target/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/rax-inline-style/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import compatRax from '@ice/plugin-rax-compat';
3 |
4 | export default defineConfig(() => ({
5 | publicPath: '/',
6 | plugins: [compatRax({
7 | inlineStyle: true,
8 | })],
9 | server: {
10 | bundle: true,
11 | format: 'cjs',
12 | },
13 | }));
14 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/rax-inline-style/public/favicon.ico
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/HybridReactComponent/index.tsx:
--------------------------------------------------------------------------------
1 | export default function HybridReactComponent() {
2 | return (
3 | HybridReactComponent in 400rpx * 200rpx red box.
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/InlineLess/x.less:
--------------------------------------------------------------------------------
1 | .foo {
2 | color: red;
3 | }
4 |
5 | .foo > a {
6 | color: green;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/InlineLess/x.module.less:
--------------------------------------------------------------------------------
1 | .foo {
2 | color: red;
3 | }
4 |
5 | .foo > a {
6 | color: green;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/Logo/index.jsx:
--------------------------------------------------------------------------------
1 | import { createElement } from 'rax';
2 | import Image from 'rax-image';
3 |
4 | import styles from './index.module.less';
5 |
6 | export default (props) => {
7 | const { uri } = props;
8 | const source = { uri };
9 | return ;
10 | };
11 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/Logo/index.module.less:
--------------------------------------------------------------------------------
1 | .logo {
2 | width: 200rpx;
3 | height: 180rpx;
4 | margin-bottom: 20rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/Title/index.jsx:
--------------------------------------------------------------------------------
1 | import { createElement } from 'rax';
2 | import Text from 'rax-text';
3 |
4 | import styles from './index.module.css';
5 |
6 | export default () => {
7 | return Welcome to Your Rax App;
8 | };
9 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/components/Title/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | font-size: 45rpx;
3 | font-weight: bold;
4 | margin: 20rpx 0;
5 | }
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/pages/index.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
6 | .data {
7 | margin-top: 10px;
8 | }
9 |
10 | .homeContainer {
11 | align-items: center;
12 | margin-top: 200rpx;
13 | }
14 |
15 | .homeInfo {
16 | font-size: 36rpx;
17 | margin: 8rpx 0;
18 | color: #555;
19 | }
20 |
--------------------------------------------------------------------------------
/examples/rax-inline-style/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/rax-project/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/rax-project/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import compatRax from '@ice/plugin-rax-compat';
3 | import jsxPlus from '@ice/plugin-jsx-plus';
4 |
5 | export default defineConfig(() => ({
6 | publicPath: '/',
7 | plugins: [
8 | compatRax(),
9 | jsxPlus(),
10 | ],
11 | }));
12 |
--------------------------------------------------------------------------------
/examples/rax-project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/rax-project/public/favicon.ico
--------------------------------------------------------------------------------
/examples/rax-project/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/rax-project/src/components/Logo/index.jsx:
--------------------------------------------------------------------------------
1 | import { createElement } from 'rax';
2 | import Image from 'rax-image';
3 |
4 | import styles from './index.module.css';
5 |
6 | export default (props) => {
7 | const { uri } = props;
8 | const source = { uri };
9 | return ;
10 | };
11 |
--------------------------------------------------------------------------------
/examples/rax-project/src/components/Logo/index.module.css:
--------------------------------------------------------------------------------
1 | .logo {
2 | width: 200rpx;
3 | height: 180rpx;
4 | margin-bottom: 20rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/rax-project/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/rax-project/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
6 | .data {
7 | margin-top: 10px;
8 | }
9 |
10 | .homeContainer {
11 | align-items: center;
12 | margin-top: 200rpx;
13 | }
14 |
15 | .homeTitle {
16 | font-size: 45rpx;
17 | font-weight: bold;
18 | margin: 20rpx 0;
19 | }
20 |
21 | .homeInfo {
22 | font-size: 36rpx;
23 | margin: 8rpx 0;
24 | color: #555;
25 | }
26 |
--------------------------------------------------------------------------------
/examples/rax-project/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/routes-config/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/routes-config/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import routeConfig from './src/routes';
3 |
4 | export default defineConfig({
5 | routes: {
6 | ignoreFiles: ['**'],
7 | config: routeConfig,
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/examples/routes-config/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig({});
4 |
--------------------------------------------------------------------------------
/examples/routes-config/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | export default function Bar() {
2 | return (
3 |
4 | bar
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/routes-config/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | link to sales page
7 | >
8 | );
9 | }
10 |
--------------------------------------------------------------------------------
/examples/routes-config/src/pages/sales/favorites.tsx:
--------------------------------------------------------------------------------
1 | export default function Favorites() {
2 | return (
3 | <>
4 | my favorite items
5 | >
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/routes-config/src/pages/sales/overview.tsx:
--------------------------------------------------------------------------------
1 | export default function Overview() {
2 | return (
3 |
4 | overview all sale items
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/routes-config/src/pages/sales/recommends.tsx:
--------------------------------------------------------------------------------
1 | export default function Recommends() {
2 | return (
3 | <>
4 | recommend items
5 | >
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/routes-config/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | auth: {
4 | [key: string]: boolean;
5 | };
6 | }
--------------------------------------------------------------------------------
/examples/routes-config/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/routes-generate/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/$.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export default function Fallback() {
4 | return <>Fallback
>;
5 | }
6 |
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Link, definePageConfig } from 'ice';
3 |
4 | export default function About() {
5 | return <>About
home>;
6 | }
7 |
8 | export const pageConfig = definePageConfig(() => ({
9 |
10 | }));
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/dashboard/a.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default () => {
4 | return (
5 | A page
6 | );
7 | };
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/dashboard/b.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default () => {
4 | return (
5 | B page
6 | );
7 | };
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/dashboard/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default () => {
4 | return (
5 | Index
6 | );
7 | };
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/dashboard/layout.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Outlet, Link } from 'ice';
3 |
4 | export default () => {
5 | return (
6 |
7 |
Dashboard
8 |
12 |
13 |
14 | );
15 | };
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/detail/$id.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { useParams, Link } from 'ice';
3 |
4 | export default function DetailId() {
5 | const params = useParams();
6 |
7 | return (
8 |
9 |
Detail id: {params.id}
10 | Back to Detail
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/detail/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Link } from 'ice';
3 |
4 | export default function Detail() {
5 | return (
6 |
7 |
Detail
8 |
9 | - join
10 | - dashboard
11 |
12 |
13 | );
14 | }
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Link } from 'ice';
3 |
4 | export default function Home() {
5 | return (
6 | <>
7 | Home
8 |
9 | - about
10 | - detail
11 | - dashboard
12 |
13 | >
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Outlet } from 'ice';
3 |
4 | export default () => {
5 | return (
6 |
7 |
Layout
8 |
9 |
10 | );
11 | };
--------------------------------------------------------------------------------
/examples/routes-generate/src/pages/products.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { Link } from 'ice';
3 |
4 | export default function Products() {
5 | return <>Products Page
home>;
6 | }
7 |
--------------------------------------------------------------------------------
/examples/single-route/.env:
--------------------------------------------------------------------------------
1 | ICE_A=env
2 | ICE_VERSION=$npm_package_version
--------------------------------------------------------------------------------
/examples/single-route/.env.development:
--------------------------------------------------------------------------------
1 | ICE_A=env-development
--------------------------------------------------------------------------------
/examples/single-route/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | publicPath: '/',
5 | optimization: {
6 | router: false,
7 | },
8 | ssr: true,
9 | }));
10 |
--------------------------------------------------------------------------------
/examples/single-route/optimization.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | publicPath: '/',
5 | optimization: {
6 | disableRouter: true,
7 | },
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/single-route/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | if (process.env.ICE_CORE_ERROR_BOUNDARY) {
4 | console.log('__REMOVED__');
5 | }
6 |
7 | console.log('ICE_VERSION', process.env.ICE_VERSION);
8 |
9 | export default defineAppConfig(() => ({
10 | app: {},
11 | }));
12 |
--------------------------------------------------------------------------------
/examples/single-route/src/pages/home.tsx:
--------------------------------------------------------------------------------
1 | const home = () => {
2 | return (
3 | <>home>
4 | );
5 | };
6 |
7 | export default home;
8 |
--------------------------------------------------------------------------------
/examples/with-antd-mobile/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | polyfill: 'usage',
5 | server: {
6 | bundle: true,
7 | format: 'cjs',
8 | },
9 | }));
10 |
--------------------------------------------------------------------------------
/examples/with-antd-mobile/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-antd-mobile/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-antd-mobile/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-antd-mobile/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | }
4 |
5 | .count {
6 | font-size: 18rpx;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-antd-mobile/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 | import { StoreProvider } from '@/store';
3 |
4 | export default () => {
5 | return (
6 |
7 | Layout
8 |
9 |
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/examples/with-antd-mobile/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-antd/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/with-antd/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/with-antd/src/pages/index.less:
--------------------------------------------------------------------------------
1 | .color {
2 | color: @blue-base;
3 | }
--------------------------------------------------------------------------------
/examples/with-antd/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from 'antd';
2 | import './index.less';
3 |
4 | export default function Home() {
5 | return (
6 |
7 |
antd example
8 |
9 |
10 | );
11 | }
--------------------------------------------------------------------------------
/examples/with-antd/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-antd5/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | ssg: false,
5 | optimization: {
6 | optimizePackageImport: true,
7 | }
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/with-antd5/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | app: {
5 | rootId: 'app',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/with-antd5/src/locales.ts:
--------------------------------------------------------------------------------
1 | export const messages: Record = {
2 | en: {
3 | changeLanguageTitle: 'Change locale:',
4 | indexTitle: 'Index',
5 | },
6 | 'zh-cn': {
7 | changeLanguageTitle: '修改语言:',
8 | indexTitle: '首页',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/examples/with-antd5/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { DatePicker, Pagination } from 'antd';
2 | import { FormattedMessage } from 'react-intl';
3 |
4 | export default function Index() {
5 | return (
6 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/with-antd5/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-antd5/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "module": "ESNext",
5 | "target": "ESNext",
6 | "lib": ["DOM", "ESNext", "DOM.Iterable"],
7 | "jsx": "react-jsx",
8 | "moduleResolution": "node",
9 | "strict": true,
10 | "skipLibCheck": true,
11 | "paths": {
12 | "@/*": ["./src/*"],
13 | "ice": [".ice"]
14 | }
15 | },
16 | "include": ["src", ".ice"],
17 | }
18 |
--------------------------------------------------------------------------------
/examples/with-auth/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import auth from '@ice/plugin-auth';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | auth(),
7 | ],
8 | });
9 |
--------------------------------------------------------------------------------
/examples/with-auth/src/components/CustomAuth.tsx:
--------------------------------------------------------------------------------
1 | import { useAuth } from 'ice';
2 |
3 | function CustomAuth({ children, authKey, fallback }) {
4 | const [auth] = useAuth();
5 | // 判断是否有权限
6 | const hasAuth = auth[authKey];
7 | // 有权限时直接渲染内容
8 | if (hasAuth) {
9 | return children;
10 | } else {
11 | // 无权限时显示指定 UI
12 | return fallback || (<>No Auth>);
13 | }
14 | }
15 |
16 | export default CustomAuth;
17 |
--------------------------------------------------------------------------------
/examples/with-auth/src/pages/blog.tsx:
--------------------------------------------------------------------------------
1 | import { definePageConfig, Link } from 'ice';
2 |
3 | export default function Blog() {
4 | return (
5 | <>
6 | Blog
7 | Index
8 | >
9 | );
10 | }
11 |
12 | export const pageConfig = definePageConfig(() => {
13 | return {
14 | title: 'Blog',
15 | auth: ['guest'],
16 | };
17 | });
18 |
--------------------------------------------------------------------------------
/examples/with-basename/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | }));
5 |
--------------------------------------------------------------------------------
/examples/with-basename/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({
4 | router: {
5 | basename: '/app',
6 | },
7 | }));
8 |
--------------------------------------------------------------------------------
/examples/with-basename/src/pages/about.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | About
7 | Home
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-basename/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | Home
7 | about
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-basename/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 |
3 | export default () => {
4 | return (
5 |
6 |
Layout
7 |
8 |
9 | );
10 | };
11 |
12 |
--------------------------------------------------------------------------------
/examples/with-data-loader/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-data-loader/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig({
4 | ssr: false,
5 | ssg: false,
6 | });
7 |
--------------------------------------------------------------------------------
/examples/with-data-loader/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineDataLoader } from 'ice';
2 |
3 | export default {
4 | app: {
5 | rootId: 'app',
6 | },
7 | };
8 |
9 | export const dataLoader = defineDataLoader(async () => {
10 | return {
11 | id: 123,
12 | };
13 | });
14 |
--------------------------------------------------------------------------------
/examples/with-data-loader/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/with-data-loader/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-dynamic/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-dynamic/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | ssr: true,
5 | }));
6 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/app.tsx:
--------------------------------------------------------------------------------
1 | export default {
2 | app: {
3 | rootId: 'app',
4 | type: 'browser',
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/components/nonssr.tsx:
--------------------------------------------------------------------------------
1 | export default (props) => {
2 | window.addEventListener('load', () => {
3 | console.log('load');
4 | });
5 | return {props.text}
;
6 | };
7 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/components/normal.tsx:
--------------------------------------------------------------------------------
1 | export default () => {
2 | return normal text
;
3 | };
4 |
5 | export function NameExportComp() {
6 | return name exported
;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/nonssr/no-ssr-fallback.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const NonSSR = dynamic(() => import('@/components/nonssr'), {
4 | ssr: false,
5 | fallback: () => fallback
,
6 | });
7 |
8 | export default () => {
9 | return ;
10 | };
11 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/nonssr/no-ssr-no-fallback.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const NonSSR = dynamic(() => import('@/components/nonssr'), {
4 | ssr: false,
5 | });
6 |
7 | export default () => {
8 | return ;
9 | };
10 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/nonssr/ssr-no-fallback.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const NonSSR = dynamic(() => import('@/components/nonssr'));
4 |
5 | export default () => {
6 | return ;
7 | };
8 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/nonssr/without-dynamic.tsx:
--------------------------------------------------------------------------------
1 | import NonSsr from '@/components/nonssr';
2 |
3 | export default () => {
4 | return ;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/normal/bare-import.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const Normal = dynamic(import('../../components/normal'), {
4 | fallback: () => bare import fallback
,
5 | });
6 |
7 | export default () => {
8 | return ;
9 | };
10 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/normal/basic.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const Normal = dynamic(() => import('../../components/normal'), {
4 | fallback: () => normal fallback
,
5 | });
6 |
7 | export default () => {
8 | return ;
9 | };
10 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/pages/normal/name-export.tsx:
--------------------------------------------------------------------------------
1 | import { dynamic } from '@ice/runtime';
2 |
3 | const Normal = dynamic(
4 | import('../../components/normal').then((mod) => {
5 | return {
6 | default: mod.NameExportComp,
7 | };
8 | }),
9 | );
10 |
11 | export default () => {
12 | return ;
13 | };
14 |
--------------------------------------------------------------------------------
/examples/with-dynamic/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-fallback-entry/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import plugin from './plugin';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [plugin()],
6 | ssr: true,
7 | server: {
8 | format: 'cjs',
9 | }
10 | }));
11 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/plugin.ts:
--------------------------------------------------------------------------------
1 | export default function createPlugin() {
2 | return {
3 | name: 'custom-plugin',
4 | setup({ onGetConfig }) {
5 | onGetConfig((config) => {
6 | config.server = {
7 | fallbackEntry: true,
8 | };
9 | });
10 | },
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-fallback-entry/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-fallback-entry/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return home
;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/with-fallback-entry/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig({
4 | ssr: true,
5 | });
6 |
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-first-chunk-cache-ssr/ice.png
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-first-chunk-cache-ssr/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig({
4 | app: {
5 | rootId: 'app',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/src/components/Box/index.module.css:
--------------------------------------------------------------------------------
1 | .box {
2 | display: flex;
3 | width: 100%;
4 | height: 100px;
5 | flex-direction: row;
6 | background-color: white;
7 | }
8 |
9 | .item {
10 | flex: 1;
11 | }
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/src/components/List/index.module.css:
--------------------------------------------------------------------------------
1 | .list {
2 | background-color: rgba(0,0,0,.03);
3 | }
4 |
5 | .item{
6 | padding: 20px;
7 | background-color: aliceblue;
8 | margin: 20px;
9 | display: flex;
10 | }
11 |
12 | .image {
13 | padding: 10px;
14 | }
15 |
16 | .title {
17 | padding: 15px 0px;
18 | }
--------------------------------------------------------------------------------
/examples/with-first-chunk-cache-ssr/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/examples/with-fusion/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-fusion/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 | import moment from 'moment';
3 |
4 | moment.locale('af');
5 |
6 | export default defineAppConfig(() => ({
7 | app: {
8 | rootId: 'app',
9 | },
10 | }));
11 |
--------------------------------------------------------------------------------
/examples/with-fusion/src/global.scss:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | color: $primary-color;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/with-fusion/src/locales.ts:
--------------------------------------------------------------------------------
1 | export const messages: Record = {
2 | en: {
3 | buttonText: 'Button',
4 | },
5 | 'zh-cn': {
6 | buttonText: '按钮',
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/examples/with-fusion/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Button, DatePicker } from '@alifd/next';
2 | import '@alifd/next/dist/next.css';
3 | import { FormattedMessage } from 'react-intl';
4 |
5 | export default function Home() {
6 | return (
7 |
8 |
with fusion
9 |
10 |
13 |
14 | );
15 | }
--------------------------------------------------------------------------------
/examples/with-fusion/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-i18n/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import i18n from '@ice/plugin-i18n';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | i18n({
7 | locales: ['zh-CN', 'en-US'],
8 | defaultLocale: 'zh-CN',
9 | autoRedirect: true,
10 | }),
11 | ],
12 | ssr: true,
13 | });
14 |
--------------------------------------------------------------------------------
/examples/with-i18n/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 | import { defineI18nConfig } from '@ice/plugin-i18n/types';
3 |
4 | export default defineAppConfig(() => ({
5 | router: {
6 | basename: '/app',
7 | },
8 | }));
9 |
10 | export const i18nConfig = defineI18nConfig(() => ({
11 | // disabledCookie: true,
12 | }));
13 |
--------------------------------------------------------------------------------
/examples/with-i18n/src/locales.ts:
--------------------------------------------------------------------------------
1 | export const messages: Record = {
2 | 'en-US': {
3 | buttonText: 'Normal Button',
4 | },
5 | 'zh-CN': {
6 | buttonText: '普通按钮',
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/examples/with-i18n/src/pages/blog/a.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function BlogA() {
4 | return (
5 | <>
6 | Blog A
7 |
11 | >
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/examples/with-i18n/src/pages/blog/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Blog() {
4 | return (
5 | <>
6 | Blog
7 |
8 | - Index
9 | - Blog A
10 |
11 | >
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/examples/with-i18n/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 | import { FormattedMessage } from 'react-intl';
3 |
4 | export default function Home() {
5 | return (
6 |
7 |
I18n Example
8 | Blog
9 |
10 |
13 |
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/examples/with-intl/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-intl/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import intl from '@ice/plugin-intl';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [intl()],
6 | }));
7 |
--------------------------------------------------------------------------------
/examples/with-intl/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-intl/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-intl/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 | import type { LocaleConfig } from '@ice/plugin-intl/types';
3 |
4 | export default defineAppConfig(() => ({}));
5 |
6 | export const locale: LocaleConfig = {
7 | getLocale: () => 'en-US',
8 | };
9 |
--------------------------------------------------------------------------------
/examples/with-intl/src/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 14px;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/with-intl/src/locales/en-US.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | new: 'New',
3 | };
4 |
--------------------------------------------------------------------------------
/examples/with-intl/src/locales/zh-CN.json:
--------------------------------------------------------------------------------
1 | {
2 | "new": "新建"
3 | }
4 |
--------------------------------------------------------------------------------
/examples/with-intl/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { intl } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | home
7 |
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-intl/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-jest/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-jest/jest-setup.ts:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 |
--------------------------------------------------------------------------------
/examples/with-jest/jest.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineJestConfig } from '@ice/app';
2 |
3 | export default defineJestConfig({
4 | preset: 'ts-jest',
5 | setupFilesAfterEnv: ['/jest-setup.ts'],
6 | testEnvironment: 'jest-environment-jsdom',
7 | });
8 |
--------------------------------------------------------------------------------
/examples/with-jest/src/add.ts:
--------------------------------------------------------------------------------
1 | import log from '@/log';
2 |
3 | export default function add(a: number, b: number) {
4 | log();
5 | return a + b;
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/examples/with-jest/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-jest/src/components/Header.tsx:
--------------------------------------------------------------------------------
1 |
2 | export default function Header() {
3 | return (
4 | Jest Test
5 | );
6 | }
--------------------------------------------------------------------------------
/examples/with-jest/src/log.ts:
--------------------------------------------------------------------------------
1 | export default function log() {
2 | console.log('log');
3 | }
--------------------------------------------------------------------------------
/examples/with-jest/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import Header from '../components/Header';
2 |
3 | export default function Home() {
4 | return (
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-jest/tests/Header.spec.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import Header from '../src/components/Header';
3 |
4 | test('test Header component', () => {
5 | render();
6 | expect(screen.getByTestId('title')).toHaveTextContent('Jest Test');
7 | });
8 |
--------------------------------------------------------------------------------
/examples/with-jest/tests/add.spec.ts:
--------------------------------------------------------------------------------
1 | import add from '../src/add';
2 |
3 | test('add', () => {
4 | expect(add(1, 2)).toBe(3);
5 | });
6 |
--------------------------------------------------------------------------------
/examples/with-jsx-plus/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-jsx-plus/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import jsxPlus from '@ice/plugin-jsx-plus';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [
6 | jsxPlus(),
7 | ],
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/with-jsx-plus/src/app.tsx:
--------------------------------------------------------------------------------
1 | export default {
2 | app: {
3 | rootId: 'app',
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/examples/with-jsx-plus/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/with-jsx-plus/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/components/Counter.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function Counter() {
4 | const [count, setCount] = useState(0);
5 |
6 | return (
7 |
8 | count: {count}
9 |
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/pages/about/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 |
3 | export default function AboutLayout() {
4 | return (
5 | <>
6 | About Layout
7 |
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/pages/about/me.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function About() {
4 | return (
5 | <>
6 | About Me
7 |
8 |
9 | About
10 | >
11 | );
12 | }
13 |
14 | export function pageConfig() {
15 | return {
16 | title: 'About Me',
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 | import Counter from '@/components/Counter';
3 |
4 | export default function Home() {
5 | return (
6 |
7 | Home
8 |
9 | About
10 |
11 | );
12 | }
13 |
14 | export function pageConfig() {
15 | return {
16 | title: 'Home',
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/examples/with-keep-alive-react/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { KeepAliveOutlet } from 'ice';
2 |
3 | export default function Layout() {
4 | return (
5 | <>
6 | I'm Keep Alive
7 |
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-keep-alive/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-keep-alive/src/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-keep-alive/src/components/Count.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function Count() {
4 | const [count, setCount] = useState(0);
5 | return (
6 |
7 |
count: {count}
8 |
9 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/examples/with-keep-alive/src/pages/home.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 | import Count from '@/components/Count';
3 |
4 | export default function Home() {
5 | return (
6 |
7 |
Home
8 |
9 | Index
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/with-keep-alive/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { KeepAliveOutlet } from 'ice';
2 |
3 | export default function Layout() {
4 | return (
5 |
6 |
Layout
7 |
8 |
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-nested-routes/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig({
4 | codeSplitting: false,
5 | });
6 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig({});
4 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/components/bar.tsx:
--------------------------------------------------------------------------------
1 | export default function Bar() {
2 | return (
3 |
4 | bar
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/about/$id[.pdf].tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (
3 | About 111.pdf
4 | );
5 | }
6 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/about/[index].tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (
3 | About [Index]
4 | );
5 | }
6 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/about/a.b.tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (
3 | About a/b
4 | );
5 | }
6 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/about/abc[.pdf].tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (
3 | About abc.pdf
4 | );
5 | }
6 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/about/index.tsx:
--------------------------------------------------------------------------------
1 | export default function About() {
2 | return (
3 | About Index
4 | );
5 | }
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | link to sales page
7 | >
8 | );
9 | }
10 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/sales/favorites.tsx:
--------------------------------------------------------------------------------
1 | export default function Favorites() {
2 | return (
3 | <>
4 | my favorite items
5 | >
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/sales/overview.tsx:
--------------------------------------------------------------------------------
1 | export default function Overview() {
2 | return (
3 | <>
4 | overview all sale items
5 | >
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/pages/sales/recommends.tsx:
--------------------------------------------------------------------------------
1 | export default function Recommends() {
2 | return (
3 | <>
4 | recommend items
5 | >
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface AppData {
2 | title: string;
3 | auth: {
4 | [key: string]: boolean;
5 | };
6 | }
--------------------------------------------------------------------------------
/examples/with-nested-routes/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-pha/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-pha/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import pha from '@ice/plugin-pha';
3 |
4 | export default defineConfig({
5 | plugins: [pha({ template: true })],
6 | server: {
7 | onDemand: true,
8 | format: 'esm',
9 | },
10 | routes: {
11 | defineRoutes: (route) => {
12 | route('/custom', 'Custom/index.tsx');
13 | },
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/examples/with-pha/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-pha/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-pha/src/app-worker.ts:
--------------------------------------------------------------------------------
1 | addEventListener('tabbaritemclick', (data) => {
2 | console.log('tabbaritemclick: ', data);
3 | });
--------------------------------------------------------------------------------
/examples/with-pha/src/pages/home.tsx:
--------------------------------------------------------------------------------
1 | import { definePageConfig } from 'ice';
2 |
3 | export default function Home() {
4 | return (
5 | <>
6 | Home Page
7 | >
8 | );
9 | }
10 |
11 | export const pageConfig = definePageConfig(() => {
12 | return {
13 | queryParamsPassKeys: [
14 | 'questionId',
15 | 'source',
16 | 'disableNav',
17 | ],
18 | title: 'Home',
19 | };
20 | });
21 |
--------------------------------------------------------------------------------
/examples/with-pha/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
6 | .data {
7 | margin-top: 10px;
8 | }
9 |
10 | .homeContainer {
11 | align-items: center;
12 | margin-top: 200rpx;
13 | }
14 |
15 | .homeTitle {
16 | font-size: 45rpx;
17 | font-weight: bold;
18 | margin: 20rpx 0;
19 | }
20 |
21 | .homeInfo {
22 | font-size: 36rpx;
23 | margin: 8rpx 0;
24 | color: #555;
25 | }
26 |
--------------------------------------------------------------------------------
/examples/with-pha/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-request/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-request/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import request from '@ice/plugin-request';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [
6 | request(),
7 | ],
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/with-request/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | .title {
2 | color: red;
3 | margin-left: 10rpx;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/with-request/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-ssg/.browserslistrc:
--------------------------------------------------------------------------------
1 | chrome 55
--------------------------------------------------------------------------------
/examples/with-ssg/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig({
4 | ssr: false,
5 | });
6 |
--------------------------------------------------------------------------------
/examples/with-ssg/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineDataLoader } from 'ice';
2 |
3 | export default {
4 | app: {
5 | rootId: 'app',
6 | },
7 | };
8 |
9 | export const dataLoader = defineDataLoader(async () => {
10 | return {
11 | id: 123,
12 | };
13 | });
14 |
--------------------------------------------------------------------------------
/examples/with-ssg/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 |
3 | export default function Layout() {
4 | console.log('render layout');
5 |
6 | return (
7 | <>
8 | With SSG
9 |
10 | >
11 | );
12 | }
--------------------------------------------------------------------------------
/examples/with-ssg/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-store/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import store from '@ice/plugin-store';
3 |
4 | export default defineConfig(() => ({
5 | ssg: false,
6 | plugins: [
7 | store({
8 | resetPageState: true,
9 | }),
10 | ],
11 | }));
12 |
--------------------------------------------------------------------------------
/examples/with-store/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-store/public/favicon.ico
--------------------------------------------------------------------------------
/examples/with-store/src/models/user.ts:
--------------------------------------------------------------------------------
1 | import { createModel } from 'ice';
2 |
3 | export default createModel({
4 | state: {
5 | name: '',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/blog/first-post.tsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'ice';
2 | import pageStore from './store';
3 |
4 | function FirstPost() {
5 | const [infoState] = pageStore.useModel('info');
6 |
7 | return (
8 | <>
9 |
10 | {infoState.posts[0].title}
11 |
12 | Back
13 | >
14 | );
15 | }
16 |
17 | export default FirstPost;
18 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/blog/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 | import store from './store';
3 |
4 | function layout() {
5 | const [infoState] = store.useModel('info');
6 | return (
7 | <>
8 | {infoState.title}
9 |
10 | >
11 | );
12 | }
13 |
14 | export default layout;
--------------------------------------------------------------------------------
/examples/with-store/src/pages/blog/models/info.ts:
--------------------------------------------------------------------------------
1 | import { createModel } from 'ice';
2 |
3 | export default createModel({
4 | state: {
5 | title: 'ICE Blog',
6 | posts: [
7 | { title: 'First Post', id: 'first-post' },
8 | ],
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/blog/store.ts:
--------------------------------------------------------------------------------
1 | import { createStore } from 'ice';
2 | import info from './models/info';
3 |
4 | export default createStore({ info });
5 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/examples/with-store/src/pages/ice.png
--------------------------------------------------------------------------------
/examples/with-store/src/pages/login.tsx:
--------------------------------------------------------------------------------
1 | import { history } from 'ice';
2 | import store from '@/store';
3 |
4 | export default function Login() {
5 | const [, userDispatcher] = store.useModel('user');
6 |
7 | function login() {
8 | userDispatcher.setState({ name: 'Hello' });
9 | history?.push('/');
10 | }
11 |
12 | return (
13 | login()} id="login-click">Click Me to Login
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/models/counter.ts:
--------------------------------------------------------------------------------
1 | import { createModel } from 'ice';
2 |
3 | export default createModel({
4 | state: {
5 | count: 0,
6 | },
7 | reducers: {
8 | inc(prevState, count = 1) {
9 | prevState.count += count;
10 | },
11 | dec(prevState, count = 1) {
12 | prevState.count -= count;
13 | },
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/examples/with-store/src/pages/store.ts:
--------------------------------------------------------------------------------
1 | import { createStore } from 'ice';
2 | import counter from './models/counter';
3 |
4 | const store = createStore({ counter });
5 |
6 | export default store;
7 |
--------------------------------------------------------------------------------
/examples/with-store/src/store.ts:
--------------------------------------------------------------------------------
1 | import { createStore } from 'ice';
2 | import user from './models/user';
3 | console.log('app store depend on window', window);
4 | export default createStore({ user });
5 |
--------------------------------------------------------------------------------
/examples/with-store/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/examples/with-suspense-ssr/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig({
4 | ssr: true,
5 | });
6 |
--------------------------------------------------------------------------------
/examples/with-suspense-ssr/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig({
4 | app: {
5 | rootId: 'app',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/examples/with-suspense-ssr/src/pages/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'ice';
2 |
3 | export default function Layout() {
4 | console.log('Render: Layout');
5 |
6 | return (
7 |
8 |
Suspense App
9 |
10 |
11 | );
12 | }
--------------------------------------------------------------------------------
/examples/with-suspense-ssr/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/examples/with-tailwindcss/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({
4 | postcss: {
5 | plugins: [
6 | 'tailwindcss',
7 | ],
8 | },
9 | }));
10 |
--------------------------------------------------------------------------------
/examples/with-tailwindcss/src/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-tailwindcss/src/global.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/examples/with-tailwindcss/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return (
3 |
4 | Hello world!
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-tailwindcss/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./src/**/*.{js,jsx,ts,tsx}'],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | };
--------------------------------------------------------------------------------
/examples/with-unocss/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 | import Unocss from '@ice/plugin-unocss';
3 |
4 | export default defineConfig(() => ({
5 | plugins: [
6 | Unocss(),
7 | ]
8 | }));
9 |
--------------------------------------------------------------------------------
/examples/with-unocss/src/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-unocss/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return (
3 |
4 | Hello world!
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/examples/with-vitest/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-vitest/src/add.ts:
--------------------------------------------------------------------------------
1 | import log from '@/log';
2 |
3 | export default function add(a: number, b: number) {
4 | log();
5 | return a + b;
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/examples/with-vitest/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-vitest/src/components/Header.tsx:
--------------------------------------------------------------------------------
1 |
2 | export default function Header() {
3 | return (
4 | Vitest Test
5 | );
6 | }
--------------------------------------------------------------------------------
/examples/with-vitest/src/log.ts:
--------------------------------------------------------------------------------
1 | export default function log() {
2 | console.log('log');
3 | }
--------------------------------------------------------------------------------
/examples/with-vitest/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 |
2 | export default function Home() {
3 | return (
4 | Vitest Test
5 | );
6 | }
7 |
--------------------------------------------------------------------------------
/examples/with-vitest/tests/Header.spec.tsx:
--------------------------------------------------------------------------------
1 | import { test, expect } from 'vitest';
2 | import { render, screen } from '@testing-library/react';
3 | import Header from '../src/components/Header';
4 |
5 | test('test Header component', () => {
6 | render();
7 | expect(screen.getByTestId('title')).toHaveTextContent('Vitest Test');
8 | });
9 |
--------------------------------------------------------------------------------
/examples/with-vitest/tests/add.spec.ts:
--------------------------------------------------------------------------------
1 | import { test, expect } from 'vitest';
2 | import add from '../src/add';
3 |
4 | test('add', () => {
5 | expect(add(1, 2)).toBe(3);
6 | });
7 |
--------------------------------------------------------------------------------
/examples/with-vitest/vitest-setup.ts:
--------------------------------------------------------------------------------
1 | import matchers from '@testing-library/jest-dom/matchers';
2 | import { expect } from 'vitest';
3 |
4 | expect.extend(matchers);
5 |
--------------------------------------------------------------------------------
/examples/with-vitest/vitest.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineVitestConfig } from '@ice/app';
2 | import react from '@vitejs/plugin-react';
3 |
4 | export default defineVitestConfig(() => ({
5 | plugins: [react()],
6 | test: {
7 | environment: 'jsdom',
8 | setupFiles: ['./vitest-setup.ts'],
9 | },
10 | }));
11 |
--------------------------------------------------------------------------------
/examples/with-web-worker/ice.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/app';
2 |
3 | export default defineConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-web-worker/src/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from 'ice';
2 |
3 | export default defineAppConfig(() => ({}));
4 |
--------------------------------------------------------------------------------
/examples/with-web-worker/src/utils/pi.ts:
--------------------------------------------------------------------------------
1 | // https://stackoverflow.com/a/39575124
2 | export default function pi(n: number) {
3 | let v = 0;
4 | for (let i = 1; i <= n; i += 4) {
5 | // increment by 4
6 | v += 1 / i - 1 / (i + 2); // add the value of the series
7 | }
8 | return 4 * v; // apply the factor at last
9 | }
10 |
--------------------------------------------------------------------------------
/examples/with-web-worker/src/worker.ts:
--------------------------------------------------------------------------------
1 | // This is a module worker, so we can use imports (in the browser too!)
2 | import pi from './utils/pi';
3 |
4 | addEventListener('message', (event: MessageEvent) => {
5 | postMessage(pi(event.data));
6 | });
7 |
--------------------------------------------------------------------------------
/packages/appear/src/index.tsx:
--------------------------------------------------------------------------------
1 | import type * as React from 'react';
2 | import WebAppear from './web';
3 | import WeexAppear from './weex';
4 | import type { AppearProps } from './typings.js';
5 |
6 | let Appear: React.ForwardRefExoticComponent>;
7 |
8 | if (import.meta.target === 'weex') {
9 | Appear = WeexAppear;
10 | } else {
11 | Appear = WebAppear as any;
12 | }
13 |
14 | export default Appear;
15 |
--------------------------------------------------------------------------------
/packages/appear/src/runtime.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | interface ImportMeta {
4 | // The build target
5 | target: 'weex' | 'web';
6 | }
7 |
8 |
9 | interface Node {
10 | _nativeNode: Node;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/appear/src/web/type.ts:
--------------------------------------------------------------------------------
1 | export function isFunction(obj: any): obj is Function {
2 | return typeof obj === 'function';
3 | }
4 |
--------------------------------------------------------------------------------
/packages/appear/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "allowJs": true,
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/bundles/README.md:
--------------------------------------------------------------------------------
1 | # @ice/bundles
2 |
3 | Prepacked bundles for ice.js.
4 |
5 | **DO NOT USE THIS PACKAGE DIRECTLY.**
6 |
--------------------------------------------------------------------------------
/packages/bundles/override/rspack/bindingVersionCheck.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | const checkVersion = function() {
3 | // Skip binding version check, framework will lock the binding version.
4 | return null;
5 | }
6 | exports.checkVersion = checkVersion;
7 |
--------------------------------------------------------------------------------
/packages/bundles/src/dev-server.ts:
--------------------------------------------------------------------------------
1 | export * from '../compiled/@rspack/dev-server/dist/index.js';
2 |
--------------------------------------------------------------------------------
/packages/bundles/src/plugin-refresh.ts:
--------------------------------------------------------------------------------
1 | import RefreshPlugin from '../compiled/@rspack/plugin-react-refresh/dist/index.js';
2 |
3 | export default RefreshPlugin;
4 |
--------------------------------------------------------------------------------
/packages/bundles/src/react-refresh-runtime.ts:
--------------------------------------------------------------------------------
1 | import runtime from 'react-refresh/runtime';
2 |
3 | export default runtime;
4 |
--------------------------------------------------------------------------------
/packages/bundles/src/rspack.ts:
--------------------------------------------------------------------------------
1 | export * from '../compiled/@rspack/core/dist/index.js';
2 |
--------------------------------------------------------------------------------
/packages/bundles/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
--------------------------------------------------------------------------------
/packages/bundles/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "commonjs"
3 | }
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/BasicEvaluatedExpression.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').BasicEvaluatedExpression;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ChunkHelpers.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ChunkHelpers;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/Compilation.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').Compilation;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/EntryDependency.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').EntryDependency;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ExternalsPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ExternalsPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/FetchCompileAsyncWasmPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').FetchCompileAsyncWasmPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/FetchCompileWasmPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').FetchCompileWasmPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/FetchCompileWasmTemplatePlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').FetchCompileWasmTemplatePlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/GraphHelpers.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').GraphHelpers;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/HotUpdateChunk.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').HotUpdateChunk;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/JavascriptModulesPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').JavascriptModulesPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/LazySet.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').LazySet;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/LibraryTemplatePlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').LibraryTemplatePlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/LimitChunkCountPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').LimitChunkCountPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ModuleDependency.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ModuleDependency;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ModuleFactory.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ModuleFactory;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ModuleFilenameHelpers.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ModuleFilenameHelpers;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/ModuleNotFoundError.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').ModuleNotFoundError;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/NodeEnvironmentPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').NodeEnvironmentPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/NodeTargetPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').NodeTargetPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/NodeTemplatePlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').NodeTemplatePlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/NormalModule.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').NormalModule;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/SetHelpers.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').SetHelpers;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/SingleEntryPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').SingleEntryPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/SortableSet.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').SortableSet;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/StartupChunkDependenciesPlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').StartupChunkDependenciesPlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/StartupEntrypointRuntimeModule.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').StartupEntrypointRuntimeModule;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/StartupHelpers.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').StartupHelpers;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/StaticExportsDependency.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').StaticExportsDependency;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/WebWorkerTemplatePlugin.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').WebWorkerTemplatePlugin;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/WebpackError.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').WebpackError;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/comparators.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').comparators;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/compileBooleanMatcher.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').compileBooleanMatcher;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/create-schema-validation.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').createSchemaValidation;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/extractUrlAndGlobal.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').extractUrlAndGlobal;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/fs.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').fs;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/identifier.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').identifier;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').webpack;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/makeSerializable.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').makeSerializable;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/package.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').package;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/semver.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').semver;
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/sources.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').sources;
2 |
--------------------------------------------------------------------------------
/packages/bundles/webpack/packages/webpack-lib.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./bundle').webpack;
2 |
--------------------------------------------------------------------------------
/packages/cache-canvas/src/type.ts:
--------------------------------------------------------------------------------
1 | export function isFunction(obj: any): obj is Function {
2 | return typeof obj === 'function';
3 | }
--------------------------------------------------------------------------------
/packages/cache-canvas/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "allowJs": true,
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/create-ice/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "esm",
6 | "baseUrl": "./"
7 | },
8 | "include": ["src"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ice/src/index.ts:
--------------------------------------------------------------------------------
1 | import type { Request, Response } from 'express';
2 | import type { UserConfig } from './types';
3 | import { defineConfig } from './config.js';
4 |
5 | export type {
6 | UserConfig,
7 |
8 | // Expose for dynamic mock.
9 | Request,
10 | Response,
11 | };
12 | export { defineConfig };
13 | export * from './test/index.js';
14 |
15 | export * from './utils/logger.js';
--------------------------------------------------------------------------------
/packages/ice/src/service/webpackServerCompiler/removeMagicString.ts:
--------------------------------------------------------------------------------
1 | export default function (source: string) {
2 | const result = source.replace(
3 | /webpackChunkName:\s*["'][^"']+["']/g,
4 | 'webpackMode: "eager"',
5 | );
6 |
7 | // Return the modified source
8 | return result;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ice/src/test/index.ts:
--------------------------------------------------------------------------------
1 | export { default as defineJestConfig } from './defineJestConfig.js';
2 | export { default as defineVitestConfig } from './defineVitestConfig.js';
3 |
--------------------------------------------------------------------------------
/packages/ice/src/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './generator.js';
2 | export * from './plugin.js';
3 | export * from './userConfig.js';
4 | // Export type webpack for same instance of webpack.
5 | export type { Config, webpack } from '@ice/shared-config/types';
6 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/ServerCompileTask.ts:
--------------------------------------------------------------------------------
1 | import type { ServerCompiler } from '../types/plugin.js';
2 |
3 | /**
4 | * Get server compile promise task in middlewares or plugins.
5 | */
6 | class ServerCompileTask> {
7 | private task: T;
8 |
9 | set(task: T) {
10 | this.task = task;
11 | }
12 |
13 | public get(): T {
14 | return this.task;
15 | }
16 | }
17 |
18 | export default ServerCompileTask;
19 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/createSpinner.ts:
--------------------------------------------------------------------------------
1 | import ora from '@ice/bundles/compiled/ora/index.js';
2 |
3 | export default function createSpinner(
4 | text: string,
5 | options: ora.Options = {},
6 | ) {
7 | const spinner = ora({
8 | text,
9 | stream: process.stdout,
10 | isEnabled: process.stdout.isTTY,
11 | interval: 200,
12 | ...options,
13 | });
14 | spinner.start();
15 | return spinner;
16 | }
--------------------------------------------------------------------------------
/packages/ice/src/utils/emptyDir.ts:
--------------------------------------------------------------------------------
1 | import fse from 'fs-extra';
2 |
3 | export default async function emptyDir(dir: string) {
4 | if (await fse.pathExists(dir)) {
5 | await fse.emptyDir(dir);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/flattenId.ts:
--------------------------------------------------------------------------------
1 | export default function flattenId(id: string): string {
2 | return id.replace(/(\s*>\s*)/g, '__').replace(/[/.:]/g, '_');
3 | }
4 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/formatPath.ts:
--------------------------------------------------------------------------------
1 | import 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;
--------------------------------------------------------------------------------
/packages/ice/src/utils/getGlobalStyleGlobPattern.ts:
--------------------------------------------------------------------------------
1 | export default function getGlobalStyleGlobPattern() {
2 | return 'src/global.@(css|scss|less)';
3 | }
4 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/hasDocument.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 | import fg from 'fast-glob';
3 |
4 | export default function hasDocument(rootDir: string) {
5 | const document = fg.sync('document.{tsx,ts,jsx,js}', {
6 | cwd: path.join(rootDir, 'src'),
7 | });
8 | return document.length > 0;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ice/src/utils/warnOnHashRouterEnabled.ts:
--------------------------------------------------------------------------------
1 | import type { UserConfig } from '../types/userConfig';
2 | import { logger } from './logger.js';
3 |
4 | export default function warnOnHashRouterEnabled(userConfig: UserConfig) {
5 | if (userConfig.ssr || userConfig.ssg) {
6 | logger.warn('SSR and SSG are both enabled by default, but SSR and SSG is invalid in Hash Router. Please set "ssr: false" and "ssg: false" in your `ice.config.mts` file.');
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/ice/templates/core/env.server.ts.ejs:
--------------------------------------------------------------------------------
1 | // Define process.env in top make it possible to use ICE_CORE_* in @ice/runtime, esbuild define options doesn't have the ability
2 | // The runtime value such as __process.env.ICE_CORE_*__ will be replaced by esbuild define, so the value is real-time
3 | <% coreEnvKeys.forEach((key) => { %>
4 | process.env.<%= key %> = __process.env.<%= key %>__;<% }) %>
--------------------------------------------------------------------------------
/packages/ice/templates/core/route-manifest.json.ejs:
--------------------------------------------------------------------------------
1 | <%- JSON.stringify(routes, null, 2) %>
--------------------------------------------------------------------------------
/packages/ice/templates/core/routes.tsx.ejs:
--------------------------------------------------------------------------------
1 | import { createRouteLoader, WrapRouteComponent, RouteErrorComponent } from '@ice/runtime';
2 | import type { CreateRoutes } from '@ice/runtime';
3 | <%- routeImports.length ? routeImports.join('\n') + '\n\n' : ''; -%>
4 | const createRoutes: CreateRoutes = ({
5 | requestContext,
6 | renderMode,
7 | }) => ([
8 | <%- routeDefinition %>
9 | ]);
10 | export default createRoutes;
11 |
--------------------------------------------------------------------------------
/packages/ice/templates/exports/dataloader-config.ts.ejs:
--------------------------------------------------------------------------------
1 | <%- loaders %>
--------------------------------------------------------------------------------
/packages/ice/templates/exports/routes-config.ts.ejs:
--------------------------------------------------------------------------------
1 | <%- routesConfig %>
2 |
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/ignore/app.ts:
--------------------------------------------------------------------------------
1 | import './dir/ignored';
2 | import './dir/page';
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/ignore/dir/ignored.ts:
--------------------------------------------------------------------------------
1 | console.log('ignored');
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/ignore/dir/nested/content.ts:
--------------------------------------------------------------------------------
1 | console.log('content');
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/ignore/dir/page.ts:
--------------------------------------------------------------------------------
1 | import './nested/content';
2 | console.log('page');
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/basic/a.js:
--------------------------------------------------------------------------------
1 | __ice_exports__.default = 1;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/basic/entry.js:
--------------------------------------------------------------------------------
1 | const path = await __ice_import__('path');
2 | const a = await __ice_import__('./a.js');
3 | __ice_exports__.default = a.default;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/circular/a.js:
--------------------------------------------------------------------------------
1 | __ice_exports__.a = () => 'A';
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/circular/b.js:
--------------------------------------------------------------------------------
1 | const __import_a__ = await __ice_import__('./entry.js');
2 | __ice_exports__.b = () => `B${__import_a__.foo()}`;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/circular/entry.js:
--------------------------------------------------------------------------------
1 | const __import_a__ = await __ice_import__('./a.js');
2 | const __import_b__ = await __ice_import__('./b.js');
3 |
4 | __ice_exports__.foo = function() {
5 | return 'test';
6 | }
7 |
8 | __ice_exports__.default = {
9 | a: __import_a__.a(),
10 | b: __import_b__.b(),
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/cjs/a.js:
--------------------------------------------------------------------------------
1 | const a = 1;
2 | const b = 2;
3 |
4 | module.exports = { a, b };
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/cjs/entry.js:
--------------------------------------------------------------------------------
1 | const imported = require('./a.js');
2 | exports.a = imported.a;
3 | exports.default = {
4 | a: imported.a,
5 | };
6 | console.log(module.exports);
7 | module.exports = imported.a;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/cjs/package.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/export-all/a.js:
--------------------------------------------------------------------------------
1 | __ice_exports__.a = 1;
2 | __ice_exports__.b = 2;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/export-all/entry.js:
--------------------------------------------------------------------------------
1 | const __ice_import_all = await __ice_import__('./a.js');
2 |
3 | __ice_exports_all__(__ice_import_all);
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/nodeRunner/externalize/entry.js:
--------------------------------------------------------------------------------
1 | const consola = await __ice_import__('consola');
2 |
3 | __ice_exports__.default = Object.getOwnPropertyDescriptor(consola, 'default');
4 | __ice_exports__.log = consola.log;
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/preAnalyze/a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/ice/tests/fixtures/preAnalyze/a.png
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/preAnalyze/app.ts:
--------------------------------------------------------------------------------
1 | import type { AppConfig } from 'ice';
2 | import { runApp } from 'ice';
3 | import { request, type Request } from 'ice';
4 | import url from './a.png';
5 | import page from '@/page';
6 |
7 | console.log(url);
8 | runApp({
9 | request,
10 | page,
11 | } as AppConfig);
12 |
13 | export default () => { };
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/preAnalyze/component.ts:
--------------------------------------------------------------------------------
1 | export default () => {};
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/preAnalyze/page.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { store } from 'ice';
3 | // test loop include
4 | import app from './app';
5 | import component from './component';
6 | store();
7 | app();
8 | component();
9 |
10 | export default () => (<>test>);
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/scan/app.ts:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from '@ice/runtime';
2 | import { getAppConfig } from '@ice/runtime/client';
3 | import page from '@/page';
4 |
5 | console.log(page);
6 | console.log(getAppConfig);
7 | export default defineAppConfig({});
8 |
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/scan/import.js:
--------------------------------------------------------------------------------
1 | import { defineAppConfig } from '@ice/runtime';
2 | import { getAppConfig } from '@ice/runtime/client';
3 |
4 | console.log(getAppConfig);
5 | export default defineAppConfig({});
6 |
--------------------------------------------------------------------------------
/packages/ice/tests/fixtures/scan/page.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | // test loop include
3 | import app from './app';
4 |
5 | app();
6 |
7 | export default () => (<>test>);
8 |
--------------------------------------------------------------------------------
/packages/ice/tests/openBrowser.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, it, describe } from 'vitest';
2 | import openBrowser from '../src/utils/openBrowser';
3 |
4 | describe('openBrowser in node', () => {
5 | it('open localhost', () => {
6 | process.env.BROWSER = 'none';
7 | const result = openBrowser('http://localhost/');
8 | expect(result).toBe(false);
9 | });
10 |
11 | // TODO simulate open browser in node
12 | });
--------------------------------------------------------------------------------
/packages/ice/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "esm",
6 | "preserveSymlinks": true,
7 | "moduleDetection": "legacy"
8 | },
9 | "include": ["src"],
10 | "exclude": ["src/utils/*"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ice/typings.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules/
5 |
6 | # production
7 | .docusaurus/
8 | build/
9 | dist/
10 | tmp/
11 | cjs/
12 | esm/
13 | es2017/
14 |
15 | # misc
16 | .idea/
17 | .happypack
18 | .DS_Store
19 | *.swp
20 | *.dia~
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/README.md:
--------------------------------------------------------------------------------
1 | # @ice/jsx-runtime
2 |
3 | JSX runtime for ice.js.
4 |
5 | ## Install
6 |
7 | ```bash
8 | $ npm i @ice/jsx-runtime --save
9 | ```
10 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/build.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/pkg';
2 |
3 | export default defineConfig({
4 | transform: {
5 | formats: ['esm'],
6 | },
7 | sourceMaps: process.env.NODE_ENV === 'development',
8 | });
9 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/jsx-dev-runtime.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./esm/dev');
2 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/jsx-runtime.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./esm/prod');
2 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/src/createElement.ts:
--------------------------------------------------------------------------------
1 | import { createElement as reactCreateElement } from 'react';
2 | import { hijackElementProps } from './style.js';
3 | export function createElement(type: any, props: any, ...children: any[]) {
4 | return reactCreateElement(type, hijackElementProps(props), ...children);
5 | }
6 |
--------------------------------------------------------------------------------
/packages/jsx-runtime/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './prod.js';
2 | export { createElement } from './createElement.js';
3 |
--------------------------------------------------------------------------------
/packages/miniapp-loader/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const REG_POST = /^post:/;
2 |
--------------------------------------------------------------------------------
/packages/miniapp-loader/src/index.ts:
--------------------------------------------------------------------------------
1 | import type webpack from 'webpack';
2 |
3 | import pageLoader from './page.js';
4 |
5 | export default function (this: webpack.LoaderContext, source: string) {
6 | pageLoader.call(this, source);
7 | }
8 |
--------------------------------------------------------------------------------
/packages/miniapp-loader/src/raw.ts:
--------------------------------------------------------------------------------
1 | export function pitch() {
2 | // empty
3 | }
4 |
--------------------------------------------------------------------------------
/packages/miniapp-loader/src/utils/normalizePath.ts:
--------------------------------------------------------------------------------
1 | export default function normalizePath(path: string) {
2 | return path.replace(/\\/g, '/').replace(/\/{2,}/g, '/');
3 | }
4 |
--------------------------------------------------------------------------------
/packages/miniapp-loader/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "lib",
7 | "module": "CommonJS",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/miniapp-react-dom/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "ES2020",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/app/react-meta.ts:
--------------------------------------------------------------------------------
1 | import { EMPTY_OBJ } from '@ice/shared';
2 | import React from 'react';
3 |
4 | interface ReactMeta {
5 | PageContext: React.Context;
6 | R: typeof React;
7 | }
8 |
9 | export const reactMeta: ReactMeta = {
10 | PageContext: EMPTY_OBJ,
11 | R: React,
12 | };
13 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/app/suspense.ts:
--------------------------------------------------------------------------------
1 | export function withSuspense(cpt) {
2 | return cpt;
3 | }
4 |
5 | // TODO: 小程序场景下仅为套壳函数,暂不支持 useSuspenseData
6 | export function useSuspenseData(request) {
7 | console.warn('miniapp-runtime does not support `useSuspenseData` api yet.');
8 | return request;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/app/usePageLifecycle.ts:
--------------------------------------------------------------------------------
1 | import { pageLifecycleHooks, pgeLifecycleArray } from './hooks.js';
2 |
3 | export default function usePageLifecycle(lifecycle, callback) {
4 | if (pgeLifecycleArray.includes(lifecycle)) {
5 | return pageLifecycleHooks[lifecycle](callback);
6 | }
7 | return;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/app/useSearchParams.ts:
--------------------------------------------------------------------------------
1 | import { Current } from '../current.js';
2 |
3 | export default function useSearchParams() {
4 | const searchParams = Current.router.params;
5 | const setSearchParams = () => {
6 | console.warn('setSearchParams is not implemented in miniapp');
7 | };
8 | return [
9 | searchParams,
10 | setSearchParams,
11 | ] as const;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/bom/getComputedStyle.ts:
--------------------------------------------------------------------------------
1 | import type { Element } from '../dom/element.js';
2 | import type { Style } from '../dom/style.js';
3 |
4 | export function getComputedStyle(element: Element): Style {
5 | return element.style;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/dom-external/inner-html/utils.ts:
--------------------------------------------------------------------------------
1 | export function unquote(str: string): string {
2 | const car = str.charAt(0);
3 | const end = str.length - 1;
4 | const isQuoteStart = car === '"' || car === "'";
5 | if (isQuoteStart && car === str.charAt(end)) {
6 | return str.slice(1, end);
7 | }
8 | return str;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/dom/node_types.ts:
--------------------------------------------------------------------------------
1 | export const enum NodeType {
2 | ELEMENT_NODE = 1,
3 | ATTRIBUTE_NODE = 2,
4 | TEXT_NODE = 3,
5 | CDATA_SECTION_NODE = 4,
6 | ENTITY_REFERENCE_NODE = 5,
7 | COMMENT_NODE = 6,
8 | PROCESSING_INSTRUCTION_NODE = 7,
9 | DOCUMENT_NODE = 9,
10 | }
11 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/dom/svg.ts:
--------------------------------------------------------------------------------
1 | import { Element } from './element.js';
2 |
3 | // for Vue3
4 | export class SVGElement extends Element {}
5 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/emitter/emitter.ts:
--------------------------------------------------------------------------------
1 | import { Events, hooks } from '@ice/shared';
2 |
3 | const eventCenter = hooks.call('getEventCenter', Events)!;
4 |
5 | export type EventsType = typeof Events;
6 | export { eventCenter, Events };
7 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/env.ts:
--------------------------------------------------------------------------------
1 | import { EMPTY_OBJ } from '@ice/shared';
2 |
3 | import type { Document } from './dom/document.js';
4 |
5 | interface Env {
6 | window;
7 | document: Document;
8 | }
9 |
10 | const env: Env = {
11 | window: EMPTY_OBJ,
12 | document: EMPTY_OBJ,
13 | };
14 |
15 | export default env;
16 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/element.ts:
--------------------------------------------------------------------------------
1 | export interface Attributes {
2 | name: string;
3 | value: string;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/event-target.ts:
--------------------------------------------------------------------------------
1 | export interface EventListenerOptions {
2 | capture?: boolean;
3 | }
4 |
5 | export interface AddEventListenerOptions extends EventListenerOptions {
6 | once?: boolean;
7 | passive?: boolean;
8 | }
9 |
10 | export interface EventHandler extends Function {
11 | _stop?: boolean;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/event.ts:
--------------------------------------------------------------------------------
1 | export interface EventOptions {
2 | bubbles: boolean;
3 | cancelable: boolean;
4 | }
5 |
6 | type Target = Record & { dataset: Record; id: string };
7 |
8 | export interface MpEvent {
9 | type: string;
10 | detail: Record;
11 | target: Target;
12 | currentTarget: Target;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/index.ts:
--------------------------------------------------------------------------------
1 | export * from './element.js';
2 | export * from './event.js';
3 | export * from './event-target.js';
4 | export * from './hydrate.js';
5 | export * from './node.js';
6 | export * from './options.js';
7 | export * from './utils.js';
8 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/node.ts:
--------------------------------------------------------------------------------
1 | import type { HydratedData } from './index.js';
2 |
3 | export type UpdatePayloadValue = string | boolean | HydratedData;
4 | export type DataTree = Record>;
5 | export interface UpdatePayload {
6 | path: string;
7 | value: UpdatePayloadValue;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/interface/utils.ts:
--------------------------------------------------------------------------------
1 | export type Func = (...args: any[]) => any;
2 | export type Ctx = Record;
3 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/options.ts:
--------------------------------------------------------------------------------
1 | import type { Options } from './interface/index.js';
2 |
3 | export const options: Options = {
4 | prerender: true,
5 | debug: false,
6 | };
7 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/src/tests/utils.js:
--------------------------------------------------------------------------------
1 |
2 | export const delay = (ms = 2) => {
3 | return new Promise(resolve => {
4 | setTimeout(() => {
5 | resolve();
6 | }, ms);
7 | });
8 | };
9 |
--------------------------------------------------------------------------------
/packages/miniapp-runtime/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "ES2020",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
--------------------------------------------------------------------------------
/packages/plugin-antd/README.md:
--------------------------------------------------------------------------------
1 | # `@ice/plugin-antd`
2 |
3 | An ice.js plugin to use `antd` components.
4 |
5 | ## Usage
6 |
7 | ```js
8 | import { defineConfig } from '@ice/app';
9 | import antd from '@ice/plugin-antd';
10 |
11 | export default defineConfig(() => ({
12 | plugins: [antd({
13 | dark: true,
14 | compact: true,
15 | theme: {
16 | 'primary-color': '#fd8',
17 | },
18 | })],
19 | }));
20 | ```
21 |
--------------------------------------------------------------------------------
/packages/plugin-antd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
--------------------------------------------------------------------------------
/packages/plugin-auth/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.0.2
4 |
5 | ### Patch Changes
6 |
7 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
8 |
9 | ## 1.0.1
10 |
11 | ### Patch Changes
12 |
13 | - 56fb406e: fix: support types definition without specify esm folder
14 |
15 | ## 1.0.0-rc.3
16 |
17 | - [feat] support initialize auth by app data.
18 |
--------------------------------------------------------------------------------
/packages/plugin-auth/README.md:
--------------------------------------------------------------------------------
1 | # `@ice/plugin-auth`
2 |
3 | An ice.js plugin to enable auth ability.
4 |
5 | ## Usage
6 |
7 | ```js
8 | import { defineConfig } from '@ice/app';
9 | import auth from '@ice/plugin-auth';
10 |
11 | export default defineConfig(() => ({
12 | plugins: [
13 | auth(),
14 | ],
15 | }));
16 | ```
17 |
18 | More details to see https://v3.ice.work/docs/guide/advanced/auth
19 |
--------------------------------------------------------------------------------
/packages/plugin-auth/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime';
2 |
--------------------------------------------------------------------------------
/packages/plugin-auth/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-auth/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-cavans/README.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-canvas
2 |
3 | An ice.js plugin for canvas projects.
4 |
5 | ## Usage
6 |
7 | Add plugin in `ice.config.mts`:
8 |
9 | ```js
10 | import { defineConfig } from 'ice';
11 | import canvasPlugin from '@ice/plugin-canvas';
12 |
13 | export default defineConfig(() => ({
14 | plugins: [canvasPlugin({ /* options */ })],
15 | }));
16 | ```
17 |
--------------------------------------------------------------------------------
/packages/plugin-cavans/src/index.ts:
--------------------------------------------------------------------------------
1 | import type { Plugin } from '@ice/app/types';
2 |
3 | const PLUGIN_NAME = '@ice/plugin-canvas';
4 |
5 | const plugin: Plugin = () => ({
6 | name: PLUGIN_NAME,
7 | setup: async ({ generator }) => {
8 | generator.addExport({
9 | source: '@ice/cache-canvas',
10 | specifier: ['CacheCanvas'],
11 | });
12 | },
13 | });
14 |
15 | export default plugin;
16 |
--------------------------------------------------------------------------------
/packages/plugin-cavans/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-css-assets-local/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.0.2
4 |
5 | ### Patch Changes
6 |
7 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
8 |
9 | ## 1.0.1
10 |
11 | ### Patch Changes
12 |
13 | - 56fb406e: fix: support types definition without specify esm folder
14 |
15 | ## 1.0.0
16 |
17 | - feat: init plugin
18 |
--------------------------------------------------------------------------------
/packages/plugin-css-assets-local/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-externals/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-externals
2 |
3 | ## 1.0.0
4 |
5 | - Initial release
6 |
--------------------------------------------------------------------------------
/packages/plugin-externals/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "NodeNext",
8 | "moduleResolution": "NodeNext"
9 | },
10 | "include": ["src"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/plugin-fusion/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
--------------------------------------------------------------------------------
/packages/plugin-i18n/build.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/pkg';
2 |
3 | // https://pkg.ice.work/reference/config-list/
4 | export default defineConfig({
5 | transform: {
6 | formats: ['es2017'],
7 | },
8 | sourceMaps: process.env.NODE_ENV === 'development',
9 | });
10 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './es2017/runtime/index';
--------------------------------------------------------------------------------
/packages/plugin-i18n/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const LOCALE_COOKIE_NAME = 'ice_locale';
2 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/src/templates/plugin-i18n.ts.ejs:
--------------------------------------------------------------------------------
1 | export function getDefaultLocale() {
2 | return '<%= defaultLocale %>';
3 | }
4 |
5 | export function getAllLocales() {
6 | return <%- locales %>;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/src/utils/setLocaleToCookie.ts:
--------------------------------------------------------------------------------
1 | import Cookies from 'universal-cookie';
2 | import { LOCALE_COOKIE_NAME } from '../constants.js';
3 |
4 | /**
5 | * NOTE: Call this function in browser.
6 | */
7 | export default function setLocaleToCookie(locale: string) {
8 | const cookies = new Cookies();
9 | cookies.set(LOCALE_COOKIE_NAME, locale, { path: '/' });
10 | }
11 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | },
7 | "include": ["src"]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/plugin-i18n/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './es2017/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-icestark/Context.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime/Context';
--------------------------------------------------------------------------------
/packages/plugin-icestark/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime/child';
2 | export * from './esm/runtime/framework';
3 |
--------------------------------------------------------------------------------
/packages/plugin-icestark/src/runtime/Context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext, useContext } from 'react';
2 |
3 | export const FrameworkContext = createContext({});
4 |
5 | export const useFrameworkContext = (): T => {
6 | return useContext(FrameworkContext) as T;
7 | };
8 |
--------------------------------------------------------------------------------
/packages/plugin-icestark/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-icestark/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-intl/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-intl
2 |
3 | ## 1.1.0
4 |
5 | ### Minor Changes
6 |
7 | - 2626dcdc: feat: support the simple mode of intl solution
8 |
9 | ## 1.0.2
10 |
11 | fix: compat with the navigator language return with underslash.
12 |
13 | ## 1.0.1
14 |
15 | ### Patch Changes
16 |
17 | - d06826ef: feat: support get locale messages for global
18 |
19 | ## 1.0.0
20 |
21 | - Initial release
22 |
--------------------------------------------------------------------------------
/packages/plugin-intl/runtime-simple.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime-simple';
2 |
--------------------------------------------------------------------------------
/packages/plugin-intl/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime';
2 |
--------------------------------------------------------------------------------
/packages/plugin-intl/src/types.ts:
--------------------------------------------------------------------------------
1 | import type { IntlConfig } from 'react-intl';
2 |
3 | interface AdditionalConfig {
4 | getLocale: () => string;
5 | }
6 |
7 | export type LocaleConfig = Partial & AdditionalConfig;
8 |
--------------------------------------------------------------------------------
/packages/plugin-intl/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "ES2020",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
--------------------------------------------------------------------------------
/packages/plugin-intl/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-jsx-plus/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-miniapp/README.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-miniapp
2 |
3 | > Forked from [taro](https://github.com/NervJS/taro) with respect ❤️
4 | > Licensed under the MIT License
5 | > https://github.com/NervJS/taro/blob/main/LICENSE
6 |
7 | ice.js plugin to enable miniapp development.
8 |
9 | See [documentation](https://v3.ice.work) for more details.
10 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime/index';
2 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/helper/index.ts:
--------------------------------------------------------------------------------
1 | export * from './constants.js';
2 | export * from './terminal.js';
3 | export * from './utils.js';
4 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/helper/terminal.ts:
--------------------------------------------------------------------------------
1 | import chalk from 'chalk';
2 | export { chalk };
3 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/miniapp/webpack/index.ts:
--------------------------------------------------------------------------------
1 | import type { MiniappWebpackOptions, MiniappWebpackConfig } from '../../types.js';
2 | import { MiniCombination } from './combination.js';
3 |
4 | export default function getMiniappWebpackConfig(rawConfig: MiniappWebpackOptions): MiniappWebpackConfig {
5 | const combination = new MiniCombination(rawConfig.rootDir, rawConfig);
6 |
7 | return combination.process();
8 | }
9 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/miniapp/webpack/template/comp.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-undef */
2 | import { createRecursiveComponentConfig } from '@ice/miniapp-runtime';
3 | // @ts-ignore
4 | Component(createRecursiveComponentConfig());
5 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/miniapp/webpack/template/custom-wrapper.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-undef */
2 | import { createRecursiveComponentConfig } from '@ice/miniapp-runtime';
3 | // @ts-ignore
4 | Component(createRecursiveComponentConfig('custom-wrapper'));
5 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/baidu/index.ts:
--------------------------------------------------------------------------------
1 | import Template from './template.js';
2 | import { components } from './components.js';
3 |
4 | export default {
5 | globalObject: 'swan',
6 | fileType: {
7 | templ: '.swan',
8 | style: '.css',
9 | config: '.json',
10 | script: '.js',
11 | xs: '.sjs',
12 | },
13 | template: new Template(),
14 | components,
15 | };
16 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/baidu/runtime.ts:
--------------------------------------------------------------------------------
1 | import { mergeInternalComponents } from '@ice/shared';
2 | import { components } from './components.js';
3 |
4 | mergeInternalComponents(components);
5 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/bytedance/index.ts:
--------------------------------------------------------------------------------
1 | import Template from './template.js';
2 | import { components } from './components.js';
3 |
4 | export default {
5 | globalObject: 'tt',
6 | projectConfigJson: 'project.tt.json',
7 | fileType: {
8 | templ: '.ttml',
9 | style: '.ttss',
10 | config: '.json',
11 | script: '.js',
12 | },
13 | template: new Template(),
14 | components,
15 | };
16 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/bytedance/runtime.ts:
--------------------------------------------------------------------------------
1 | import { mergeInternalComponents } from '@ice/shared';
2 | import { components } from './components.js';
3 |
4 | mergeInternalComponents(components);
5 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/wechat/index.ts:
--------------------------------------------------------------------------------
1 | import Template from './template.js';
2 | import { components } from './components.js';
3 |
4 | export default {
5 | globalObject: 'wx',
6 | projectConfigJson: 'project.config.json',
7 | fileType: {
8 | templ: '.wxml',
9 | style: '.wxss',
10 | config: '.json',
11 | script: '.js',
12 | xs: '.wxs',
13 | },
14 | template: new Template(),
15 | components,
16 | };
17 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/src/targets/wechat/runtime.ts:
--------------------------------------------------------------------------------
1 | import { mergeInternalComponents } from '@ice/shared';
2 | import { components } from './components.js';
3 |
4 | mergeInternalComponents(components);
5 |
--------------------------------------------------------------------------------
/packages/plugin-miniapp/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-moment-locales/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.0.2
4 |
5 | ### Patch Changes
6 |
7 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
8 |
9 | ## 1.0.1
10 |
11 | ### Patch Changes
12 |
13 | - 56fb406e: fix: support types definition without specify esm folder
14 |
15 | ## 1.0.0
16 |
17 | - [feat] support config locales of moment.
18 |
--------------------------------------------------------------------------------
/packages/plugin-moment-locales/README.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-moment-locales
2 |
3 | ice.js Plugin for load moment locales and reduce size of moment.
4 |
5 | ## Usage
6 |
7 | ```js
8 | import { defineConfig } from '@ice/app';
9 | import moment from '@ice/plugin-moment-locales';
10 |
11 | export default defineConfig(() => ({
12 | plugins: [
13 | moment({
14 | locales: ['zh-CN'],
15 | }),
16 | ],
17 | }));
18 | ```
19 |
--------------------------------------------------------------------------------
/packages/plugin-moment-locales/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-pha/README.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-pha
2 |
3 | An ice.js plugin to enable PHA features.
4 |
5 | ## Usage
6 |
7 | ```js
8 | import { defineConfig } from '@ice/app';
9 | import pha from '@ice/plugin-pha';
10 |
11 | export default defineConfig(() => ({
12 | plugins: [pha()],
13 | }));
14 | ```
15 |
--------------------------------------------------------------------------------
/packages/plugin-pha/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime';
2 |
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/app-worker.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/plugin-pha/tests/app-worker.ts
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/export-specifier.ts:
--------------------------------------------------------------------------------
1 | const pageConfig = () => {};
2 | const getData = () => {};
3 | export {
4 | pageConfig,
5 | getData,
6 | };
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/export-variable.ts:
--------------------------------------------------------------------------------
1 | export const getData = () => {};
2 | export const pageConfig = () => {};
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/function-exports.ts:
--------------------------------------------------------------------------------
1 | export default function Bar() {}
2 | export function pageConfig() {}
3 | export function getData() {}
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/if.ts:
--------------------------------------------------------------------------------
1 | let a = 1;
2 | if (true) {
3 | a = 2;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/iife.ts:
--------------------------------------------------------------------------------
1 | function a() {}
2 | a();
3 | console.log('test', window.a);
4 | const b = [];
5 | b.map(() => {});
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/import.ts:
--------------------------------------------------------------------------------
1 | import { a, b } from 'test';
2 | import { a as c } from 'test-a';
3 | import d from 'test-d';
4 | import 'test-c';
5 |
6 | export function pageConfig() {
7 | return { a: 1 };
8 | }
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/reference.ts:
--------------------------------------------------------------------------------
1 | import { a, b } from 'test';
2 |
3 | function test() {
4 | a();
5 | }
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/vars.ts:
--------------------------------------------------------------------------------
1 | import { a, z } from 'a';
2 | import b from 'b';
3 | import c from 'c';
4 | import d from 'd';
5 |
6 | const [e, f, ...rest] = a;
7 | const { h, j } = b;
8 | const [x, ...m] = c;
9 | const zz = 'x';
10 | const { k, l, ...s } = d;
11 |
12 | export function pageConfig() {
13 | return {
14 | x,
15 | k,
16 | };
17 | }
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/fixtures/while.ts:
--------------------------------------------------------------------------------
1 | let j = 2;
2 | let i = 2;
3 | while (j < 3) {
4 | j++;
5 | }
6 | do {
7 | i++;
8 | } while (i < 5);
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/mockServer.mjs:
--------------------------------------------------------------------------------
1 | export function renderToHTML(requestContext, documentOnly) {
2 | const { req } = requestContext;
3 | return {
4 | value: `${req.url}${documentOnly ? '-document' : ''}`,
5 | code: 200,
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/pha-work.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/plugin-pha/tests/pha-work.js
--------------------------------------------------------------------------------
/packages/plugin-pha/tests/route-manifest.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "path": "home",
4 | "id": "home"
5 | },
6 | {
7 | "path": "about",
8 | "id": "about"
9 | },
10 | {
11 | "path": "app/nest",
12 | "id": "app/nest"
13 | }
14 | ]
--------------------------------------------------------------------------------
/packages/plugin-pha/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | },
8 | "include": ["src"],
9 | "exclude": ["tests"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-pha/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-rax-compat/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-request/hooks.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/hooks';
--------------------------------------------------------------------------------
/packages/plugin-request/request.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/request';
2 |
--------------------------------------------------------------------------------
/packages/plugin-request/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime';
2 |
--------------------------------------------------------------------------------
/packages/plugin-request/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/plugin-request/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-store/runtime.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/runtime';
2 |
--------------------------------------------------------------------------------
/packages/plugin-store/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const PAGE_STORE_MODULE = '__PAGE_STORE__';
2 | export const PAGE_STORE_PROVIDER = '__PAGE_STORE_PROVIDER__';
3 | export const PAGE_STORE_INITIAL_STATES = '__PAGE_STORE_INITIAL_STATES__';
4 |
--------------------------------------------------------------------------------
/packages/plugin-store/src/types.ts:
--------------------------------------------------------------------------------
1 | export interface StoreConfig {
2 | initialStates: Record;
3 | }
4 |
5 | type Store = ((data?: any) => Promise) | StoreConfig;
6 |
7 | function defineStoreConfig(fn: Store) {
8 | return fn;
9 | }
10 |
11 | export {
12 | defineStoreConfig,
13 | };
14 |
--------------------------------------------------------------------------------
/packages/plugin-store/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
--------------------------------------------------------------------------------
/packages/plugin-store/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/plugin-stream-error/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-stream-error
2 |
3 | ## 1.0.0
4 |
5 | ### Major Changes
6 |
7 | - f2c7df96: feat: plugin deal with stream error
8 |
9 | ## 1.0.1
10 |
11 | ### Patch Change
12 |
13 | - 2928447c: plugin export head stream error recover component
14 |
15 | ## 1.0.2
16 |
17 | ### Patch Change
18 |
19 | - 069579a3: add head stream error types exports
20 |
--------------------------------------------------------------------------------
/packages/plugin-stream-error/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "jsx": "react"
8 | },
9 | "include": ["src"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/plugin-unocss/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @ice/plugin-unocss
2 |
3 | ## 1.1.0
4 |
5 | ### Minor Changes
6 |
7 | - e0b2eae1: fix: use postcss plugin to transform unocss
8 |
9 | ## 1.0.2
10 |
11 | ### Patch Changes
12 |
13 | - 2920b011: fix: disable persistent cache for unocss generation
14 |
15 | ## 1.0.1
16 |
17 | ### Patch Changes
18 |
19 | - f58d2068: fix: always add preset-uno
20 |
--------------------------------------------------------------------------------
/packages/plugin-unocss/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/plugin-unocss/uno.css:
--------------------------------------------------------------------------------
1 | @unocss all;
2 |
--------------------------------------------------------------------------------
/packages/rax-compat/.gitignore:
--------------------------------------------------------------------------------
1 | es2017/
2 | es2021/
3 | dist/
4 | esm/
5 |
--------------------------------------------------------------------------------
/packages/rax-compat/build.config.mts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@ice/pkg';
2 |
3 | export default defineConfig({
4 | transform: {
5 | formats: ['esm', 'es2017'],
6 | },
7 | sourceMaps: process.env.NODE_ENV === 'development',
8 | plugins: [
9 | './plugin.mjs',
10 | ],
11 | });
12 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/children.ts:
--------------------------------------------------------------------------------
1 | import { Children } from 'react';
2 |
3 | // See https://github.com/alibaba/rax/blob/master/packages/rax-children/src/index.js
4 | // Imported by 'rax-compat/children'
5 | export default Children;
6 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/clone-element.ts:
--------------------------------------------------------------------------------
1 | import { cloneElement } from 'react';
2 |
3 | // See https://github.com/alibaba/rax/blob/master/packages/rax-clone-element/src/index.js
4 | // Imported by 'rax-compat/cloneElement'
5 | export default cloneElement;
--------------------------------------------------------------------------------
/packages/rax-compat/src/component.ts:
--------------------------------------------------------------------------------
1 | import { Component, PureComponent, memo } from 'react';
2 |
3 | export {
4 | Component,
5 | PureComponent,
6 | memo,
7 | };
8 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/container-root-map.ts:
--------------------------------------------------------------------------------
1 | import type { Root } from 'react-dom/client';
2 |
3 | /**
4 | * A WeakMap that keeps track of container mouted root.
5 | * @key The container element passed to `render` function, which call `createRoot` and `root.render` internally.
6 | * @value The root instance returned by `createRoot` function.
7 | */
8 | export const containerRootMap = new WeakMap();
9 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from 'react';
2 |
3 | export {
4 | createContext,
5 | };
6 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/create-factory.ts:
--------------------------------------------------------------------------------
1 | import { createFactory } from 'react';
2 |
3 | // See https://github.com/alibaba/rax/blob/master/packages/rax-create-factory/src/index.js
4 | // Imported by 'rax-compat/createFactory'
5 | export default createFactory;
6 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/create-portal.ts:
--------------------------------------------------------------------------------
1 | import { createPortal } from 'react-dom';
2 |
3 | // See https://github.com/alibaba/rax/blob/master/packages/rax-create-portal/src/index.js
4 | // Imported by 'rax-compat/createPortal'
5 | export default createPortal;
--------------------------------------------------------------------------------
/packages/rax-compat/src/find-dom-node.ts:
--------------------------------------------------------------------------------
1 | import { findDOMNode } from 'react-dom';
2 |
3 | // See https://github.com/alibaba/rax/blob/master/packages/rax-find-dom-node/src/index.js
4 | // Imported by 'rax-compat/findDOMNode'
5 | export default findDOMNode;
6 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/fragment.ts:
--------------------------------------------------------------------------------
1 | import { Fragment } from 'react';
2 |
3 | export default Fragment;
4 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/index.ts:
--------------------------------------------------------------------------------
1 | import * as Rax from './exports.js';
2 |
3 | export * from './exports.js';
4 |
5 | export default Rax;
6 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/is-valid-element.ts:
--------------------------------------------------------------------------------
1 | import { isValidElement } from 'react';
2 |
3 | export default isValidElement;
4 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/runtime/index.ts:
--------------------------------------------------------------------------------
1 | export { createElement } from '../create-element.js';
2 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/runtime/jsx-dev-runtime.ts:
--------------------------------------------------------------------------------
1 |
2 | // @ts-ignore
3 | import { jsxDEV as _jsxDEV } from 'react/jsx-dev-runtime';
4 | import { createJSXElementFactory } from '../compat/element.js';
5 |
6 | export { Fragment } from 'react';
7 | export const jsxDEV = createJSXElementFactory(_jsxDEV);
8 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/runtime/jsx-runtime.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore
2 | import { jsxs as _jsxs, jsx as _jsx } from 'react/jsx-runtime';
3 | import { createJSXElementFactory } from '../compat/element.js';
4 |
5 | export { Fragment } from 'react';
6 | export const jsx = createJSXElementFactory(_jsx);
7 | export const jsxs = createJSXElementFactory(_jsxs);
8 |
--------------------------------------------------------------------------------
/packages/rax-compat/src/typing.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'style-unit';
--------------------------------------------------------------------------------
/packages/rax-compat/tests/libs/rax-is-valid-element.js:
--------------------------------------------------------------------------------
1 | export default function isValidElement(object) {
2 | return !!(typeof object === 'object' && object !== null && object.type && object.props);
3 | }
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/document.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/document.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/pages/About/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/pages/About/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/pages/About/me/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/pages/About/me/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/pages/home.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/pages/home.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/pages/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/pages/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/basic-routes/src/pages/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/basic-routes/src/pages/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/define-absolute-route/src/inedx.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/define-absolute-route/src/inedx.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dot-delimeters-routes/src/pages/home.news.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dot-delimeters-routes/src/pages/home.news.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dot-delimeters-routes/src/pages/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dot-delimeters-routes/src/pages/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/about.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/about.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/blog/$id.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/blog/$id.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/blog/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/blog/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/dynamic-routes/src/pages/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/escape-routes/src/pages/1[.pdf].tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/escape-routes/src/pages/1[.pdf].tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/escape-routes/src/pages/[index].tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/escape-routes/src/pages/[index].tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/#a.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/#a.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/home.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/home.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/invalid-routes/src/pages/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/about.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/about.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/$id.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/$id.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/blog/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/layout/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/home/layout/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/index.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/index.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/layout-routes/src/pages/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/layout-routes/src/pages/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/nested-routes/src/pages/a/b/c.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/nested-routes/src/pages/a/b/c.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/nested-routes/src/pages/d.e.f.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/nested-routes/src/pages/d.e.f.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/splat-routes/src/pages/$.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/splat-routes/src/pages/$.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/splat-routes/src/pages/home.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/splat-routes/src/pages/home.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tests/fixtures/splat-routes/src/pages/layout.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/packages/route-manifest/tests/fixtures/splat-routes/src/pages/layout.tsx
--------------------------------------------------------------------------------
/packages/route-manifest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./src",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"],
9 | "exclude": ["tests"]
10 | }
--------------------------------------------------------------------------------
/packages/rspack-config/README.md:
--------------------------------------------------------------------------------
1 | # @ice/rspack-config
2 |
3 | This package providers basic rspack configuration.
4 |
--------------------------------------------------------------------------------
/packages/rspack-config/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "moduleDetection": "legacy"
8 | },
9 | "include": ["src"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/runtime/README.md:
--------------------------------------------------------------------------------
1 | # @ice/runtime
2 |
3 | runtime dependencies for webpack framework `ice`.
4 |
5 | `@ice/runtime` includes almost every runtime dependencies for `ice`, the dependencies version will be locked to keep the stability of web framework.
--------------------------------------------------------------------------------
/packages/runtime/data-loader.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/dataLoader';
2 |
--------------------------------------------------------------------------------
/packages/runtime/document.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/Document';
2 |
--------------------------------------------------------------------------------
/packages/runtime/matchRoutes.d.ts:
--------------------------------------------------------------------------------
1 | import matchRoutes from './esm/matchRoutes';
2 |
3 | export default matchRoutes;
4 |
--------------------------------------------------------------------------------
/packages/runtime/router.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/router';
2 |
--------------------------------------------------------------------------------
/packages/runtime/server.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/index.server';
2 |
--------------------------------------------------------------------------------
/packages/runtime/src/RouteContext.ts:
--------------------------------------------------------------------------------
1 | import { useLoaderData } from 'react-router-dom';
2 | import type { RouteConfig } from './types.js';
3 |
4 | function useData(): T {
5 | return (useLoaderData() as any)?.data;
6 | }
7 |
8 | function useConfig(): RouteConfig {
9 | return (useLoaderData() as any)?.pageConfig;
10 | }
11 |
12 | export {
13 | useData,
14 | useConfig,
15 | };
16 |
--------------------------------------------------------------------------------
/packages/runtime/src/history.ts:
--------------------------------------------------------------------------------
1 | import type { History } from '@remix-run/router';
2 |
3 | // Value of history will be modified after render Router.
4 | let routerHistory: History | null = null;
5 |
6 | function setHistory(customHistory: History) {
7 | routerHistory = customHistory;
8 | }
9 |
10 | export {
11 | routerHistory,
12 | setHistory,
13 | };
14 |
--------------------------------------------------------------------------------
/packages/runtime/src/index.server.ts:
--------------------------------------------------------------------------------
1 | export { renderToResponse, renderToHTML } from './runServerApp.js';
2 | export { renderToResponse as renderDocumentToResponse, getDocumentResponse } from './renderDocument.js';
3 | export * from './index.js';
4 |
--------------------------------------------------------------------------------
/packages/runtime/src/jsx-dev-runtime.ts:
--------------------------------------------------------------------------------
1 | export * from '@ice/jsx-runtime/jsx-dev-runtime';
2 |
--------------------------------------------------------------------------------
/packages/runtime/src/jsx-runtime.ts:
--------------------------------------------------------------------------------
1 | export * from '@ice/jsx-runtime/jsx-runtime';
2 |
--------------------------------------------------------------------------------
/packages/runtime/src/polyfills/abortcontroller.js:
--------------------------------------------------------------------------------
1 | import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only.js';
2 |
--------------------------------------------------------------------------------
/packages/runtime/src/react.ts:
--------------------------------------------------------------------------------
1 | import { createElement } from 'react';
2 | export {
3 | // Export createElement while `@ice/runtime` is configured as `importSource` in swc jsx transform options.
4 | createElement,
5 | };
6 |
--------------------------------------------------------------------------------
/packages/runtime/src/router.ts:
--------------------------------------------------------------------------------
1 | export {
2 | Link,
3 | NavLink,
4 | Outlet,
5 | useParams,
6 | useSearchParams,
7 | useLocation,
8 | useNavigate,
9 | useNavigation,
10 | useRevalidator,
11 | useAsyncValue,
12 | } from 'react-router-dom';
13 |
14 | export { useData, useConfig } from './RouteContext.js';
15 |
--------------------------------------------------------------------------------
/packages/runtime/src/useMounted.tsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react';
2 |
3 | export default function useMounted() {
4 | const [mounted, setMounted] = useState(false);
5 |
6 | useEffect(() => {
7 | setMounted(true);
8 | }, []);
9 | return mounted;
10 | }
11 |
--------------------------------------------------------------------------------
/packages/runtime/src/usePageLifecycle.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-unused-vars */
2 | export default function usePageLifecycle(lifecycle: string, callback: any) {
3 | // Just compatible with miniapp
4 | return;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/runtime/src/utils/addLeadingSlash.ts:
--------------------------------------------------------------------------------
1 | const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : `/${url}`);
2 |
3 | export default addLeadingSlash;
4 |
--------------------------------------------------------------------------------
/packages/runtime/src/utils/getCurrentRoutePath.ts:
--------------------------------------------------------------------------------
1 | import type { RouteMatch } from '../types.js';
2 |
3 | /**
4 | * Get the current route path exclude the basename.
5 | */
6 | export default function getCurrentRoutePath(matches: RouteMatch[]): string | undefined {
7 | return matches.length && matches[matches.length - 1].pathname;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/runtime/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "ES2020",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
--------------------------------------------------------------------------------
/packages/runtime/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/shared-config/README.md:
--------------------------------------------------------------------------------
1 | # @ice/shared-config
2 |
3 | This package providers shared configuration for rspack and webpack.
4 |
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/alias.js:
--------------------------------------------------------------------------------
1 | import { Head } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/aliasWithAs.js:
--------------------------------------------------------------------------------
1 | import { Head as Header } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/as.js:
--------------------------------------------------------------------------------
1 | import { runApp as run } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/basic.js:
--------------------------------------------------------------------------------
1 | import { runApp } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/matched.js:
--------------------------------------------------------------------------------
1 | import { runApp, defineDataLoader } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/missmatch.js:
--------------------------------------------------------------------------------
1 | import { defineDataLoader } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/redirectImport/multiple.js:
--------------------------------------------------------------------------------
1 | import { request, store, test } from 'ice';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/cjs.js:
--------------------------------------------------------------------------------
1 | import 'core-js/modules/test';module.exports = {};
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/esm.js:
--------------------------------------------------------------------------------
1 | import 'core-js/modules/test';export default 'a';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/importMeta.js:
--------------------------------------------------------------------------------
1 | if (import.meta.rerender === 'client') console.log(true);
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/match.js:
--------------------------------------------------------------------------------
1 | import 'core-js/modules/test';import 'react';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/missmatch.js:
--------------------------------------------------------------------------------
1 | import 'react';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/specialIdentifier.js:
--------------------------------------------------------------------------------
1 | import { _ as _create_class } from '@swc/helpers/_/_create_class';module.exports = {};
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/stringInclude.js:
--------------------------------------------------------------------------------
1 | import 'somepack/core-js/modules/test';import 'react';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/swc-esm.js:
--------------------------------------------------------------------------------
1 | import { _ as _object_spread } from '@swc/helpers/_/_object_spread';import 'react';
--------------------------------------------------------------------------------
/packages/shared-config/tests/fixtures/transformImport/swc.js:
--------------------------------------------------------------------------------
1 | import { _ as _object_spread } from '@swc/helpers/_/_object_spread';module.exports = {};
--------------------------------------------------------------------------------
/packages/shared-config/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "moduleDetection": "legacy"
8 | },
9 | "include": ["src"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/shared-config/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/shared/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @ice/shared
2 |
3 | ## 1.1.0
4 |
5 | ### Minor Changes
6 |
7 | - 710b2e48: feat: improve miniapp runtime
8 |
9 | ## 1.0.2
10 |
11 | ### Patch Changes
12 |
13 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
14 |
15 | ## 1.0.1
16 |
17 | ### Patch Changes
18 |
19 | - ddee1c3e: support miniapp native events
20 | - 57219848: support miniapp native lifecycle events
21 |
--------------------------------------------------------------------------------
/packages/shared/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './is.js';
2 | export * from './utils.js';
3 | export * from './event-emitter.js';
4 | export * from './miniapp/shortcuts.js';
5 | export * from './miniapp/template.js';
6 | export * from './miniapp/components.js';
7 | export * from './miniapp/runtime-hooks.js';
8 | export * from './miniapp/utils.js';
9 |
--------------------------------------------------------------------------------
/packages/shared/src/miniapp/shortcuts.ts:
--------------------------------------------------------------------------------
1 | // 字符串简写
2 | export enum Shortcuts {
3 | Container = 'container',
4 | Childnodes = 'cn',
5 | Text = 'v',
6 | NodeType = 'nt',
7 | NodeName = 'nn',
8 |
9 | // Attrtibutes
10 | Style = 'st',
11 | Class = 'cl',
12 | Src = 'src',
13 | }
14 |
--------------------------------------------------------------------------------
/packages/shared/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "module": "ES2020",
8 | "moduleResolution": "NodeNext",
9 | },
10 | "include": ["src"]
11 | }
--------------------------------------------------------------------------------
/packages/style-import/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.1.0
4 |
5 | ### Minor Changes
6 |
7 | - 79c32a77: feat: optimize function theme injection
8 |
9 | ## 1.0.1
10 |
11 | ### Patch Changes
12 |
13 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
14 |
15 | ## 1.0.0
16 |
17 | - [feat] support import style
18 |
--------------------------------------------------------------------------------
/packages/style-import/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
--------------------------------------------------------------------------------
/packages/webpack-config/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm",
7 | "moduleDetection": "legacy"
8 | },
9 | "include": ["src"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/webpack-config/types.d.ts:
--------------------------------------------------------------------------------
1 | export * from './esm/types';
2 |
--------------------------------------------------------------------------------
/packages/webpack-modify/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.0.1
4 |
5 | ### Patch Changes
6 |
7 | - b8b1d5e4: fix: sourceMap url in prod files but not publish with sourceMap file
8 |
9 | ## 1.0.0
10 |
11 | - [feat] support several APIs to modify webpack.
12 |
--------------------------------------------------------------------------------
/packages/webpack-modify/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "rootDir": "src",
6 | "outDir": "esm"
7 | },
8 | "include": ["src"]
9 | }
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - 'packages/*'
3 | - 'examples/*'
4 | - 'website'
5 | - '!examples/with-keep-alive-react/'
6 |
--------------------------------------------------------------------------------
/scripts/setupUser.ts:
--------------------------------------------------------------------------------
1 | import { exec } from '@actions/exec';
2 |
3 | const setupUser = async () => {
4 | await exec('git', [
5 | 'config',
6 | 'user.name',
7 | '"ClarkXia"',
8 | ]);
9 | await exec('git', [
10 | 'config',
11 | 'user.email',
12 | '"xiawenwu41@gmail.com"',
13 | ]);
14 | };
15 |
16 | (async () => {
17 | await setupUser();
18 | })();
19 |
--------------------------------------------------------------------------------
/tests/utils/executeCommand.ts:
--------------------------------------------------------------------------------
1 | import { spawnSync } from 'child_process';
2 |
3 | export default (order: string, cwd: string) => {
4 | const [command, ...args] = order.split(' ');
5 | spawnSync(command, args, {
6 | stdio: 'inherit',
7 | cwd,
8 | });
9 | };
10 |
--------------------------------------------------------------------------------
/tests/utils/test-plugin.ts:
--------------------------------------------------------------------------------
1 | export default ({ modifyUserConfig }) => {
2 | // disable minify to speed-up fixture builds
3 | modifyUserConfig('minify', false);
4 | // disable sourceMap to speed-up fixture start
5 | modifyUserConfig('sourceMap', false);
6 | };
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2019",
4 | "module": "ES2020",
5 | "jsx": "react",
6 | "experimentalDecorators": true,
7 | "declaration": true,
8 | "skipLibCheck": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "moduleResolution": "node",
11 | "allowSyntheticDefaultImports": true,
12 | "allowJs": true
13 | }
14 | }
--------------------------------------------------------------------------------
/website/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3 | };
4 |
--------------------------------------------------------------------------------
/website/docs/guide/advanced/faas.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 一体化
3 | hide: true
4 | ---
5 |
6 | @TODO
7 |
--------------------------------------------------------------------------------
/website/docs/guide/advanced/micro-frontends.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 微前端
3 | hide: true
4 | ---
5 |
6 | @TODO
7 |
--------------------------------------------------------------------------------
/website/docs/guide/practice.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 实战教程
3 | order: 3
4 | hide: true
5 | ---
6 |
7 | @TODO.
8 |
--------------------------------------------------------------------------------
/website/src/components/Badge/badge.module.css:
--------------------------------------------------------------------------------
1 | .badge {
2 | display: inline-block;
3 | font-size: 12px;
4 | font-weight: 600;
5 | padding: 2px 5px;
6 | text-shadow: 0 -1px 0 rgb(0 0 0 / 10%);
7 | box-shadow: 0 0 0 1px #fff;
8 | border-radius: 1px;
9 | vertical-align: top;
10 | color: #FFF;
11 | border-radius: 4px;
12 | }
13 |
14 | .error {
15 | background-color: #ff4d4f;
16 | }
--------------------------------------------------------------------------------
/website/src/components/Badge/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './badge.module.css';
3 |
4 | function Badge({ type = 'error', text }) {
5 | return (
6 |
7 | {text}
8 |
9 | );
10 | }
11 |
12 | export default Badge;
13 |
--------------------------------------------------------------------------------
/website/src/components/Support/support.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | position: relative;
3 | top: 2px;
4 | }
5 |
6 | .container img {
7 | margin-right: 5px;
8 | }
9 |
10 | .webpack {
11 | height: 18px;
12 | }
13 |
14 | .vite {
15 | height: 16px;
16 | position: relative;
17 | top: -2px;
18 | }
--------------------------------------------------------------------------------
/website/src/utils/path.js:
--------------------------------------------------------------------------------
1 | // Similar with nodejs's path.join, not a full version support.
2 | const separator = '/';
3 |
4 | export function join(...args) {
5 | const replace = new RegExp(`${separator}{1,}`, 'g');
6 | return args.join(separator).replace(replace, separator);
7 | }
8 |
--------------------------------------------------------------------------------
/website/static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/.nojekyll
--------------------------------------------------------------------------------
/website/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/favicon.ico
--------------------------------------------------------------------------------
/website/static/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/logo.png
--------------------------------------------------------------------------------
/website/static/img/mf_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/mf_01.png
--------------------------------------------------------------------------------
/website/static/img/mf_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/mf_02.png
--------------------------------------------------------------------------------
/website/static/img/solution_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/solution_01.png
--------------------------------------------------------------------------------
/website/static/img/solution_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/solution_02.png
--------------------------------------------------------------------------------
/website/static/img/solution_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/solution_03.png
--------------------------------------------------------------------------------
/website/static/img/solution_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/solution_04.png
--------------------------------------------------------------------------------
/website/static/img/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/ice/4334c4040927e6da9fdddf7e640fa47c6b6b47cc/website/static/img/splash.png
--------------------------------------------------------------------------------