diff --git a/example/basic/mock/.gitkeep b/example/.gitkeep similarity index 100% rename from example/basic/mock/.gitkeep rename to example/.gitkeep diff --git a/example/basic/.editorconfig b/example/basic/.editorconfig deleted file mode 100755 index 7e3649acc2..0000000000 --- a/example/basic/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab diff --git a/example/basic/.gitignore b/example/basic/.gitignore deleted file mode 100644 index bee1cf61ce..0000000000 --- a/example/basic/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/npm-debug.log* -/yarn-error.log -/yarn.lock -/package-lock.json - -# production -/dist - -# misc -.DS_Store - -# umi -/src/.umi -/src/.umi-production -/src/.umi-test -/.env.local diff --git a/example/basic/.prettierignore b/example/basic/.prettierignore deleted file mode 100644 index 0d4222f544..0000000000 --- a/example/basic/.prettierignore +++ /dev/null @@ -1,8 +0,0 @@ -**/*.md -**/*.svg -**/*.ejs -**/*.html -package.json -.umi -.umi-production -.umi-test diff --git a/example/basic/.prettierrc b/example/basic/.prettierrc deleted file mode 100644 index 94beb14840..0000000000 --- a/example/basic/.prettierrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all", - "printWidth": 80, - "overrides": [ - { - "files": ".prettierrc", - "options": { "parser": "json" } - } - ] -} diff --git a/example/basic/.umirc.ts b/example/basic/.umirc.ts deleted file mode 100644 index e21d25ee86..0000000000 --- a/example/basic/.umirc.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'umi'; - -export default defineConfig({ - nodeModulesTransform: { - type: 'none', - }, - routes: [{ path: '/', component: '@/pages/index' }], - fastRefresh: {}, - ssr: {}, -}); diff --git a/example/basic/README.md b/example/basic/README.md deleted file mode 100644 index 07afeb7fd6..0000000000 --- a/example/basic/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# umi project - -## Getting Started - -Install dependencies, - -```bash -$ yarn -``` - -Start the dev server, - -```bash -$ yarn start -``` diff --git a/example/basic/package.json b/example/basic/package.json deleted file mode 100644 index 8f46f6d3f3..0000000000 --- a/example/basic/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "private": true, - "scripts": { - "start": "umi dev", - "build": "umi build", - "postinstall": "umi generate tmp", - "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", - "test": "umi-test", - "test:coverage": "umi-test --coverage" - }, - "gitHooks": { - "pre-commit": "lint-staged" - }, - "lint-staged": { - "*.{js,jsx,less,md,json}": [ - "prettier --write" - ], - "*.ts?(x)": [ - "prettier --parser=typescript --write" - ] - }, - "dependencies": { - "@ant-design/pro-layout": "^6.5.0", - "@umijs/preset-react": "1.x", - "umi": "^3.4.20" - }, - "devDependencies": { - "@types/react": "^17.0.0", - "@types/react-dom": "^17.0.0", - "@umijs/test": "^3.4.20", - "lint-staged": "^10.0.7", - "prettier": "^3.2.2", - "react": "17.x", - "react-dom": "17.x", - "typescript": "^5.1.3", - "yorkie": "^2.0.0" - } -} diff --git a/example/basic/src/pages/index.less b/example/basic/src/pages/index.less deleted file mode 100644 index 586302bfc8..0000000000 --- a/example/basic/src/pages/index.less +++ /dev/null @@ -1,3 +0,0 @@ -.title { - background: rgb(121, 242, 157); -} diff --git a/example/basic/src/pages/index.tsx b/example/basic/src/pages/index.tsx deleted file mode 100644 index ebdd169f7d..0000000000 --- a/example/basic/src/pages/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import styles from './index.less'; - -export default function IndexPage() { - return ( -
-

Page index

-
- ); -} diff --git a/example/basic/tsconfig.json b/example/basic/tsconfig.json deleted file mode 100644 index bc5250b036..0000000000 --- a/example/basic/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "moduleResolution": "node", - "importHelpers": true, - "jsx": "react-jsx", - "esModuleInterop": true, - "sourceMap": true, - "baseUrl": "./", - "strict": true, - "paths": { - "@/*": ["src/*"], - "@@/*": ["src/.umi/*"] - }, - "allowSyntheticDefaultImports": true - }, - "include": [ - "mock/**/*", - "src/**/*", - "config/**/*", - ".umirc.ts", - "typings.d.ts" - ], - "exclude": [ - "node_modules", - "lib", - "es", - "dist", - "typings", - "**/__test__", - "test", - "docs", - "tests" - ] -} diff --git a/example/basic/typings.d.ts b/example/basic/typings.d.ts deleted file mode 100644 index 06c8a5b8ca..0000000000 --- a/example/basic/typings.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare module '*.css'; -declare module '*.less'; -declare module '*.png'; -declare module '*.svg' { - export function ReactComponent( - props: React.SVGProps, - ): React.ReactElement; - const url: string; - export default url; -} diff --git a/example/taro/.editorconfig b/example/taro/.editorconfig deleted file mode 100644 index 5760be5836..0000000000 --- a/example/taro/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/example/taro/.eslintrc b/example/taro/.eslintrc deleted file mode 100644 index 7809e66a31..0000000000 --- a/example/taro/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["taro/react"], - "rules": { - "react/jsx-uses-react": "off", - "react/react-in-jsx-scope": "off" - } -} diff --git a/example/taro/.gitignore b/example/taro/.gitignore deleted file mode 100644 index 2cea3efd8c..0000000000 --- a/example/taro/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -dist/ -deploy_versions/ -.temp/ -.rn_temp/ -node_modules/ -.DS_Store diff --git a/example/taro/.npmrc b/example/taro/.npmrc deleted file mode 100644 index 7147182c1c..0000000000 --- a/example/taro/.npmrc +++ /dev/null @@ -1,10 +0,0 @@ -registry=https://registry.npmmirror.com -disturl=https://npmmirror.com/dist -sass_binary_site=https://npmmirror.com/mirrors/node-sass/ -phantomjs_cdnurl=https://npmmirror.com/mirrors/phantomjs/ -electron_mirror=https://npmmirror.com/mirrors/electron/ -chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver -operadriver_cdnurl=https://npmmirror.com/mirrors/operadriver -selenium_cdnurl=https://npmmirror.com/mirrors/selenium -node_inspector_cdnurl=https://npmmirror.com/mirrors/node-inspector -fsevents_binary_host_mirror=https://npmmirror.com/mirrors/fsevents/ diff --git a/example/taro/README.md b/example/taro/README.md deleted file mode 100644 index b4d3cad8ed..0000000000 --- a/example/taro/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## CLI 工具安装 - -```bash -$ tnpm install -g @tarojs/cli -``` - -## 运行 - -支付宝环境运行 - -```bash -$ npm run dev:alipay -``` - -### 支付宝小程序 IDE 下载 - -下载并打开[https://render.alipay.com/p/f/fd-jwq8nu2a/pages/home/index.html](支付宝小程序开发者工具),然后选择项目根目录下 dist 目录(根目录 config 中的 outputRoot 设置的目录)进行预览。 - -> 支付宝小程序开发者工具推荐使用 Lite 模式 - -## 编码地址 - -测试文件用 `pages/index/index.tsx` diff --git a/example/taro/babel.config.js b/example/taro/babel.config.js deleted file mode 100644 index 12f3043195..0000000000 --- a/example/taro/babel.config.js +++ /dev/null @@ -1,13 +0,0 @@ -// babel-preset-taro 更多选项和默认值: -// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md -module.exports = { - presets: [ - [ - 'taro', - { - framework: 'react', - ts: true, - }, - ], - ], -}; diff --git a/example/taro/config/dev.js b/example/taro/config/dev.js deleted file mode 100644 index ff3c9441e9..0000000000 --- a/example/taro/config/dev.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - env: { - NODE_ENV: '"development"', - }, - defineConstants: {}, - mini: {}, - h5: {}, -}; diff --git a/example/taro/config/index.js b/example/taro/config/index.js deleted file mode 100644 index e2959e44a1..0000000000 --- a/example/taro/config/index.js +++ /dev/null @@ -1,64 +0,0 @@ -const config = { - projectName: 'taro', - date: '2021-6-7', - designWidth: 750, - deviceRatio: { - 640: 2.34 / 2, - 750: 1, - 828: 1.81 / 2, - }, - sourceRoot: 'src', - outputRoot: 'dist', - plugins: [], - defineConstants: {}, - copy: { - patterns: [], - options: {}, - }, - framework: 'react', - mini: { - postcss: { - pxtransform: { - enable: true, - config: {}, - }, - url: { - enable: true, - config: { - limit: 1024, // 设定转换尺寸上限 - }, - }, - cssModules: { - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true - config: { - namingPattern: 'module', // 转换模式,取值为 global/module - generateScopedName: '[name]__[local]___[hash:base64:5]', - }, - }, - }, - }, - h5: { - publicPath: '/', - staticDirectory: 'static', - postcss: { - autoprefixer: { - enable: true, - config: {}, - }, - cssModules: { - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true - config: { - namingPattern: 'module', // 转换模式,取值为 global/module - generateScopedName: '[name]__[local]___[hash:base64:5]', - }, - }, - }, - }, -}; - -module.exports = function (merge) { - if (process.env.NODE_ENV === 'development') { - return merge({}, config, require('./dev')); - } - return merge({}, config, require('./prod')); -}; diff --git a/example/taro/config/prod.js b/example/taro/config/prod.js deleted file mode 100644 index 8221c9f5e8..0000000000 --- a/example/taro/config/prod.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - env: { - NODE_ENV: '"production"', - }, - defineConstants: {}, - mini: {}, - h5: { - /** - * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 - * 参考代码如下: - * webpackChain (chain) { - * chain.plugin('analyzer') - * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) - * } - */ - }, -}; diff --git a/example/taro/global.d.ts b/example/taro/global.d.ts deleted file mode 100644 index b04f7dca8c..0000000000 --- a/example/taro/global.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -declare module '*.png'; -declare module '*.gif'; -declare module '*.jpg'; -declare module '*.jpeg'; -declare module '*.svg'; -declare module '*.css'; -declare module '*.less'; -declare module '*.scss'; -declare module '*.sass'; -declare module '*.styl'; - -declare namespace NodeJS { - interface ProcessEnv { - TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd'; - } -} diff --git a/example/taro/package.json b/example/taro/package.json deleted file mode 100644 index f1716ad25f..0000000000 --- a/example/taro/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "taro", - "version": "1.0.0", - "private": true, - "description": "ahooks taro 测试环境", - "templateInfo": { - "name": "default", - "typescript": true, - "css": "sass" - }, - "scripts": { - "build:weapp": "taro build --type weapp", - "build:swan": "taro build --type swan", - "build:alipay": "taro build --type alipay", - "build:tt": "taro build --type tt", - "build:h5": "taro build --type h5", - "build:rn": "taro build --type rn", - "build:qq": "taro build --type qq", - "build:jd": "taro build --type jd", - "build:quickapp": "taro build --type quickapp", - "dev:weapp": "npm run build:weapp -- --watch", - "dev:swan": "npm run build:swan -- --watch", - "dev:alipay": "npm run build:alipay -- --watch", - "dev:tt": "npm run build:tt -- --watch", - "dev:h5": "npm run build:h5 -- --watch", - "dev:rn": "npm run build:rn -- --watch", - "dev:qq": "npm run build:qq -- --watch", - "dev:jd": "npm run build:jd -- --watch", - "dev:quickapp": "npm run build:quickapp -- --watch" - }, - "browserslist": [ - "last 3 versions", - "Android >= 4.1", - "ios >= 8" - ], - "author": "", - "dependencies": { - "@babel/runtime": "^7.7.7", - "@tarojs/components": "3.2.9", - "@tarojs/runtime": "3.2.9", - "@tarojs/taro": "3.2.9", - "@tarojs/react": "3.2.9", - "react-dom": "^17.0.0", - "react": "^17.0.0" - }, - "devDependencies": { - "@types/webpack-env": "^1.13.6", - "@types/react": "^17.0.2", - "@tarojs/mini-runner": "3.2.9", - "@babel/core": "^7.8.0", - "@tarojs/webpack-runner": "3.2.9", - "babel-preset-taro": "3.2.9", - "eslint-config-taro": "3.2.9", - "eslint": "^6.8.0", - "eslint-plugin-react": "^7.8.2", - "eslint-plugin-import": "^2.12.0", - "eslint-plugin-react-hooks": "^4.2.0", - "stylelint": "9.3.0", - "@typescript-eslint/parser": "^4.15.1", - "@typescript-eslint/eslint-plugin": "^4.15.1", - "typescript": "^5.1.3" - } -} diff --git a/example/taro/project.config.json b/example/taro/project.config.json deleted file mode 100644 index ec13320b36..0000000000 --- a/example/taro/project.config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "miniprogramRoot": "./dist", - "projectname": "taro", - "description": "ahooks taro 测试环境", - "appid": "touristappid", - "setting": { - "urlCheck": true, - "es6": false, - "postcss": false, - "minified": false - }, - "compileType": "miniprogram" -} diff --git a/example/taro/project.tt.json b/example/taro/project.tt.json deleted file mode 100644 index 2ccd1811f7..0000000000 --- a/example/taro/project.tt.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "miniprogramRoot": "./", - "projectname": "taro", - "appid": "touristappid", - "setting": { - "es6": false, - "minified": false - } -} diff --git a/example/taro/src/app.config.ts b/example/taro/src/app.config.ts deleted file mode 100644 index ab42835af5..0000000000 --- a/example/taro/src/app.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default { - pages: ['pages/index/index'], - window: { - backgroundTextStyle: 'light', - navigationBarBackgroundColor: '#fff', - navigationBarTitleText: 'WeChat', - navigationBarTextStyle: 'black', - }, -}; diff --git a/example/taro/src/app.scss b/example/taro/src/app.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/example/taro/src/app.ts b/example/taro/src/app.ts deleted file mode 100644 index 82bb720c04..0000000000 --- a/example/taro/src/app.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component } from 'react'; -import './app.scss'; - -class App extends Component { - componentDidMount() {} - - componentDidShow() {} - - componentDidHide() {} - - componentDidCatchError() {} - - // this.props.children 是将要会渲染的页面 - render() { - return this.props.children; - } -} - -export default App; diff --git a/example/taro/src/index.html b/example/taro/src/index.html deleted file mode 100644 index e857596e2b..0000000000 --- a/example/taro/src/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/example/taro/src/pages/index/index.config.ts b/example/taro/src/pages/index/index.config.ts deleted file mode 100644 index e9c431b3b6..0000000000 --- a/example/taro/src/pages/index/index.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - navigationBarTitleText: '首页', -}; diff --git a/example/taro/src/pages/index/index.scss b/example/taro/src/pages/index/index.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/example/taro/src/pages/index/index.tsx b/example/taro/src/pages/index/index.tsx deleted file mode 100644 index 587c5e4745..0000000000 --- a/example/taro/src/pages/index/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from 'react'; -import { View } from '@tarojs/components'; -import './index.scss'; - -const Index = () => { - return Taro 测试; -}; - -export default Index; diff --git a/example/taro/tsconfig.json b/example/taro/tsconfig.json deleted file mode 100644 index 72c432c7a5..0000000000 --- a/example/taro/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "removeComments": false, - "preserveConstEnums": true, - "moduleResolution": "node", - "experimentalDecorators": true, - "noImplicitAny": false, - "allowSyntheticDefaultImports": true, - "outDir": "lib", - "noUnusedLocals": true, - "noUnusedParameters": true, - "strictNullChecks": true, - "sourceMap": true, - "baseUrl": ".", - "rootDir": ".", - "jsx": "react-jsx", - "allowJs": true, - "resolveJsonModule": true, - "typeRoots": ["node_modules/@types", "global.d.ts"] - }, - "exclude": ["node_modules", "dist"], - "compileOnSave": false -}