Skip to content

Commit

Permalink
refactor: 重构为monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
phy-lei committed Jan 20, 2024
1 parent 3cf0e2d commit 065b416
Show file tree
Hide file tree
Showing 25 changed files with 219 additions and 96 deletions.
36 changes: 5 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"version": "0.0.1",
"description": "taro插件,支持使用 Solid 开发小程序",
"main": "dist/index.js",
"type": "module",
"files": [
"dist"
"workspaces": [
"packages/*"
],
"type": "module",
"scripts": {
"dev": "rollup -c -w --bundleConfigAsCjs",
"build": "rollup -c --bundleConfigAsCjs",
"test": "jest"
"dev-all": "pnpm run dev --parallel --filter ./packages/",
"build-all": "pnpm run dev --parallel --filter ./packages/",
},
"repository": {
"type": "git",
Expand All @@ -29,37 +28,12 @@
"url": "https://github.com/phy-lei/tarojs-plugin-solid/issues"
},
"homepage": "https://github.com/phy-lei/tarojs-plugin-solid#readme",
"peerDependencies": {
"@tarojs/runtime": ">=3.0.0",
"@tarojs/service": ">=3.0.0",
"@tarojs/shared": ">=3.0.0",
"@tarojs/webpack5-runner": ">=3.0.0",
"solid-js": ">=1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"volta": {
"node": "18.17.1",
"npm": "9.6.7"
},
"dependencies": {
"solid-js": "^1.8.11"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tarojs/runtime": "^3.6.23",
"@tarojs/service": "^3.6.23",
"@tarojs/shared": "^3.6.23",
"@tarojs/webpack5-runner": "^3.6.23",
"@types/jest": "^29.5.11",
"jest": "^29.7.0",
"rollup": "^4.9.5",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
}
}
21 changes: 21 additions & 0 deletions packages/tarojs-plugin-solid/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 phy-lei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions packages/tarojs-plugin-solid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# tarojs-plugin-solid
使用solidjs开发小程序🤖
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 66 additions & 0 deletions packages/tarojs-plugin-solid/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "tarojs-plugin-solid",
"version": "0.0.1",
"description": "taro插件,支持使用 Solid 开发小程序",
"main": "dist/index.js",
"workspaces": [
"packages/*"
],
"type": "module",
"files": [
"dist"
],
"scripts": {
"dev": "rollup -c -w --bundleConfigAsCjs",
"build": "rollup -c --bundleConfigAsCjs",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/phy-lei/tarojs-plugin-solid"
},
"keywords": [
"taro",
"taro3",
"tarojs",
"solid",
"solidjs"
],
"author": "phy-lei",
"license": "MIT",
"bugs": {
"url": "https://github.com/phy-lei/tarojs-plugin-solid/issues"
},
"homepage": "https://github.com/phy-lei/tarojs-plugin-solid#readme",
"peerDependencies": {
"@tarojs/runtime": ">=3.0.0",
"@tarojs/shared": ">=3.0.0",
"solid-js": ">=1",
"tarojs-solid-custom-render": "*"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"volta": {
"node": "18.17.1",
"npm": "9.6.7"
},
"dependencies": {
"solid-js": "^1.8.11",
"tarojs-solid-custom-render": "workspace:*"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tarojs/runtime": "^3.6.23",
"@tarojs/shared": "^3.6.23",
"@types/jest": "^29.5.11",
"jest": "^29.7.0",
"rollup": "^4.9.5",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@tarojs/runtime";
import { For } from "solid-js";
import { installGlobalShims } from './dom'
import { createComponent, render, h } from "../custom-render";
import { createComponent, render, h } from "tarojs-solid-custom-render"
import { hooks } from '@tarojs/shared'


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions packages/tarojs-solid-custom-render/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 phy-lei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions packages/tarojs-solid-custom-render/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# tarojs-plugin-solid
使用solidjs开发小程序🤖
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './render'
export * from './h'
export * from './src/render'
export * from './src/h'

// todo 将其打包成一个lib 外部使用该render进行调用
// todo 将其打包成一个lib 外部使用该render进行调用
// 需要改为monorepo了
File renamed without changes.
61 changes: 61 additions & 0 deletions packages/tarojs-solid-custom-render/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "tarojs-solid-custom-render",
"version": "0.0.1",
"description": "自定义solid编译器",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"dev": "rollup -c -w --bundleConfigAsCjs",
"build": "rollup -c --bundleConfigAsCjs",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/phy-lei/tarojs-plugin-solid"
},
"keywords": [
"taro",
"taro3",
"tarojs",
"solid",
"solidjs"
],
"author": "phy-lei",
"license": "MIT",
"bugs": {
"url": "https://github.com/phy-lei/tarojs-plugin-solid/issues"
},
"homepage": "https://github.com/phy-lei/tarojs-plugin-solid#readme",
"peerDependencies": {
"@tarojs/runtime": ">=3.0.0",
"@tarojs/shared": ">=3.0.0",
"solid-js": ">=1",
"babel-preset-solid": ">=1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"volta": {
"node": "18.17.1",
"npm": "9.6.7"
},
"dependencies": {
"solid-js": "^1.8.11"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tarojs/runtime": "^3.6.23",
"@tarojs/shared": "^3.6.23",
"@types/jest": "^29.5.11",
"jest": "^29.7.0",
"rollup": "^4.9.5",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
}
}
33 changes: 33 additions & 0 deletions packages/tarojs-solid-custom-render/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as path from 'path';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { externals } from 'rollup-plugin-node-externals';
import ts from 'rollup-plugin-ts';

const base = {
plugins: [
commonjs(),
nodeResolve(),
externals({
include: [
'@tarojs/runtime',
'@tarojs/shared',
],
}),
ts(),
],
};

// Solid custom render
const customRenderConfig = {
input: path.join(__dirname, 'src/custom-render/index.ts'),
output: {
file: path.join(__dirname, 'dist/custom-render.js'),
format: 'cjs',
sourcemap: true,
exports: 'named',
},
...base,
};

export default [customRenderConfig];
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- 'packages/**'
58 changes: 0 additions & 58 deletions rollup.config.js

This file was deleted.

1 change: 0 additions & 1 deletion todo

This file was deleted.

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "lib",
"module": "CommonJS",
"sourceMap": true,
"allowSyntheticDefaultImports": true,
Expand All @@ -16,5 +15,6 @@
"target": "ES6",
"lib": ["DOM"]
},
"include": ["src"]
"include": ["packages/*"],
"exclude": ["node_modules"]
}

0 comments on commit 065b416

Please sign in to comment.