Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/components dependencies #15604

Merged
merged 12 commits into from
May 10, 2024
14 changes: 14 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
hooks: {
readPackage: (pkg) => {
// @stencil/core 没有锁住 jest 的版本,所以需要手动锁住
if (pkg.name === '@stencil/core') {
pkg.dependencies = {
'jest-runner': '27.5.1',
'jest-environment-node': '27.5.1',
}
}
return pkg
},
},
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-node-externals": "^7.1.1",
"@types/node": "^18",
"eslint": "^8.57.0",
Expand All @@ -100,6 +101,7 @@

"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.6",
"@rollup/plugin-commonjs": "^25.0.7",
"@types/debug": "^4.1.5",
"@types/fs-extra": "^8.0.1",
"@types/history": "^4.7.5",
Expand Down
14 changes: 5 additions & 9 deletions packages/taro-components-library-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@
"keywords": [],
"author": "ZakaryCode",
"license": "MIT",
"engines": {
"node": ">= 18"
},
"dependencies": {
"@tarojs/components": "workspace:*",
"react-dom": "^18.2.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.5",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tarojs/helper": "workspace:*",
"babel-preset-taro": "workspace:*",
"postcss": "^8.4.18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.79.0",
"rollup-plugin-node-externals": "^5.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-ts": "^3.0.2",
"typescript": "^4.7.4"
"react-dom": "^18.2.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import externals from 'rollup-plugin-node-externals'
import postcss from 'rollup-plugin-postcss'
import ts from 'rollup-plugin-ts'

const config = {
input: ['src/index.ts', 'src/component-lib/index.ts'],
Expand All @@ -24,9 +24,7 @@ const config = {
preferBuiltins: false,
mainFields: ['browser', 'module', 'jsnext:main', 'main'],
}),
ts({
sourceMap: true,
}),
typescript(),
commonjs({
transformMixedEsModules: true,
dynamicRequireTargets: ['./src/**/*.js'],
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-library-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"declarationDir": "../taro-components/lib/react",
"jsx": "react",
"jsxFactory": "React.createElement",
"module": "ESNext",
"noUnusedLocals": false,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"sourceMap": false,
"strictNullChecks": false,
"target": "ES2017",
"typeRoots": ["./node_modules/@types"]
Expand Down
17 changes: 5 additions & 12 deletions packages/taro-components-library-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,15 @@
"keywords": [],
"author": "ZakaryCode",
"license": "MIT",
"engines": {
"node": ">= 18"
},
"dependencies": {
"@tarojs/components": "workspace:*",
"tslib": "^2.6.2"
"@tarojs/components": "workspace:*"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.5",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"babel-preset-taro": "workspace:*",
"@tarojs/helper": "workspace:*",
"postcss": "^8.4.18",
"rollup": "^2.79.0",
"rollup-plugin-node-externals": "^5.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-ts": "^3.0.2",
"typescript": "^4.7.4",
"vue": "3.2.47"
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import externals from 'rollup-plugin-node-externals'
import postcss from 'rollup-plugin-postcss'
import ts from 'rollup-plugin-ts'

const config = {
input: ['src/index.ts', 'src/components-loader.ts', 'src/component-lib/index.ts'],
output: {
dir: '../taro-components/lib/vue3',
exports: 'named',
preserveModules: true,
preserveModulesRoot: 'src',
sourcemap: true,
preserveModulesRoot: 'src',
},
treeshake: false,
plugins: [
Expand All @@ -24,9 +24,7 @@ const config = {
preferBuiltins: false,
mainFields: ['browser', 'module', 'jsnext:main', 'main'],
}),
ts({
sourceMap: true,
}),
typescript(),
commonjs({
transformMixedEsModules: true,
dynamicRequireTargets: ['./src/**/*.js'],
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-library-vue3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"declarationDir": "../taro-components/lib/vue3",
"module": "ESNext",
"noUnusedLocals": false,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"sourceMap": false,
"strictNullChecks": false,
"target": "ES2017",
"typeRoots": ["./node_modules/@types"]
Expand Down
5 changes: 0 additions & 5 deletions packages/taro-components/__tests__/swiper.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import { Swiper } from '../src/components/swiper/swiper'
import { SwiperItem } from '../src/components/swiper/swiper-item'

describe('Swiper', () => {
beforeAll(() => {
// https://github.com/ionic-team/stencil/issues/2056#issuecomment-598086745
jest.useFakeTimers()
})

let page: SpecPage
const itemStyle = {
height: '100%'
Expand Down
18 changes: 12 additions & 6 deletions packages/taro-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@
"keywords": [],
"author": "",
"license": "MIT",
"engines": {
"node": ">= 18"
},
"dependencies": {
"@stencil/core": "^2.22.2",
"@stencil/core": "2.22.3",
"@tarojs/runtime": "workspace:*",
"@tarojs/components-advanced": "workspace:*",
"@tarojs/taro": "workspace:*",
"classnames": "^2.2.5",
Expand All @@ -58,6 +62,7 @@
"swiper": "6.8.0"
},
"devDependencies": {
"@tarojs/taro-h5": "workspace:*",
"@babel/generator": "^7.21.4",
"@babel/parser": "^7.23.0",
"@babel/traverse": "^7.21.4",
Expand All @@ -68,18 +73,19 @@
"change-case": "^4.1.2",
"csstype": "^3.1.1",
"esbuild": "~0.19.5",
"jquery": "^3.4.1",
"lightningcss": "^1.22.1",
"lodash": "^4.17.21",
"miniapp-types": "1.6.0",
"puppeteer": "^19.2.0",
"rollup": "^3.8.1",
"rollup-plugin-node-externals": "^5.0.0",
"sass": "^1.58.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^3.14.1",
"typescript": "^5.3.3",
"mkdirp": "^1.0.4"
"mkdirp": "^1.0.4",
"rollup-plugin-node-externals": "^5.0.0",
"jest": "27.5.1",
"jest-cli": "27.5.1",
"jest-runner": "27.5.1",
"jest-environment-node": "27.5.1"
},
"peerDependenciesMeta": {
"@types/react": {
Expand Down
2 changes: 2 additions & 0 deletions packages/taro-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"@tarojs/components": "workspace:*",
"@tarojs/runtime": "workspace:*",
"@tarojs/taro": "workspace:*",
"@tarojs/taro-h5": "workspace:*",
"@tarojs/shared": "workspace:*",
"jest-environment-jsdom": "^29.6.4",
"jsdom": "^21.1.0"
},
Expand Down
Loading