Skip to content

Commit

Permalink
yarn workspaces WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-daragan-pandadoc committed Apr 26, 2023
1 parent 8124126 commit 66e8679
Show file tree
Hide file tree
Showing 28 changed files with 1,124 additions and 1,066 deletions.
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 1,5 @@
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
20 changes: 0 additions & 20 deletions compat/src/index.ts

This file was deleted.

22 changes: 22 additions & 0 deletions package-shared-sync.js
Original file line number Diff line number Diff line change
@@ -0,0 1,22 @@
const fs = require('fs');
const path = require('path');

const sharedPropertiesPath = path.join(__dirname, 'package.shared.json');
const sharedProperties = require(sharedPropertiesPath);

function mergeSharedProperties(targetPackagePath) {
const packageBasePath = path.join(__dirname, targetPackagePath, 'package.base.json');
const packagePath = path.join(__dirname, targetPackagePath, 'package.json');

const packageBaseJson = require(packageBasePath);

const extendedPackage = {
...sharedProperties,
...packageBaseJson,
};

fs.writeFileSync(packagePath, JSON.stringify(extendedPackage, null, 2));
}

mergeSharedProperties('packages/onek');
mergeSharedProperties('packages/onek-compat');
123 changes: 9 additions & 114 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,118 1,13 @@
{
"name": "onek",
"version": "0.0.9",
"description": "⚡️1.7KB full-featured state management inspired by MobX and Solid, batteries included ⚡️",
"main": "./dist/onek.js",
"source": "src/index.ts",
"umd:main": "./dist/onek.umd.js",
"module": "./dist/onek.module.js",
"unpkg": "./dist/onek.umd.js",
"types": "./types/index.d.ts",
"exports": {
".": {
"types": "./types/index.d.ts",
"browser": "./dist/onek.module.js",
"umd": "./dist/onek.umd.js",
"import": "./dist/onek.mjs",
"require": "./dist/onek.js"
},
"./compat": {
"types": "./compat/types/index.d.ts",
"browser": "./compat/dist/onek.module.js",
"umd": "./compat/dist/onek.umd.js",
"import": "./compat/dist/onek.mjs",
"require": "./compat/dist/onek.js"
}
},
"packageManager": "[email protected]",
"scripts": {
"build": "microbundle & microbundle --cwd=compat --generateTypes=false",
"build-full": "microbundle --no-compress & microbundle --no-compress --cwd=compat --generateTypes=false",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git https://github.com/zheksoon/onek.git"
},
"peerDependencies": {
"react": ">=18.0.0"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/react": ">=18.0.0",
"jest": "^29.0.3",
"microbundle": "^0.15.1",
"njstrace": "^2.0.1",
"prettier": "^2.8.7",
"react": ">=18.0.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1"
},
"files": [
"src/",
"dist/",
"types/",
"LICENSE",
"README.md",
"package.json",
"yarn.lock",
"compat/src",
"compat/dist",
"compat/types",
"compat/package.json"
],
"keywords": [
"state",
"state management",
"reactive",
"observable",
"computed",
"autorun",
"frp",
"functional reactive programming",
"zustand",
"jotai",
"react",
"mobx",
"solid",
"solid.js",
"recoil",
"preact signals",
"valtio",
"unstated",
"1kb",
"tiny",
"small",
"compact",
"lightweight",
"minimal",
"performance",
"typescript",
"hooks",
"shallow equality"
"name": "onek-workspace",
"private": true,
"workspaces": [
"packages/*"
],
"author": "Eugene Daragan",
"license": "MIT",
"bugs": {
"url": "https://github.com/zheksoon/onek/issues"
},
"homepage": "https://github.com/zheksoon/onek#readme",
"reserved": [
"Observable",
"Computed",
"Reaction"
],
"minify": {
"mangle": {
"properties": {
"regex": "^_"
},
"keep_classnames": true,
"reserved": [
"Observable",
"Computed",
"Reaction"
]
}
"scripts": {
"publish": "yarn run sync && yarn workspaces foreach run -p publish",
"build": "yarn run sync && yarn workspaces foreach -p run build",
"build-full": "yarn run sync && yarn workspaces foreach -p run buld-full",
"sync": "node ./package-shared-sync.js"
}
}
86 changes: 86 additions & 0 deletions package.shared.json
Original file line number Diff line number Diff line change
@@ -0,0 1,86 @@
{
"version": "0.0.9",
"description": "⚡️1.7KB full-featured state management inspired by MobX and Solid, batteries included ⚡️",
"repository": {
"type": "git",
"url": "git https://github.com/zheksoon/onek.git"
},
"main": "./dist/onek.js",
"source": "src/index.ts",
"umd:main": "./dist/onek.umd.js",
"module": "./dist/onek.module.js",
"unpkg": "./dist/onek.umd.js",
"types": "./types/index.d.ts",
"exports": {
".": {
"types": "./types/index.d.ts",
"browser": "./dist/onek.module.js",
"umd": "./dist/onek.umd.js",
"import": "./dist/onek.mjs",
"require": "./dist/onek.js"
}
},
"packageManager": "[email protected]",
"scripts": {
"publish": "yarn run build && yarn publish",
"build": "yarn exec microbundle",
"build-full": "yarn exec microbundle --no-compress",
"test": "yarn exec jest"
},
"files": [
"dist/",
"types/",
"LICENSE",
"README.md",
"package.json"
],
"keywords": [
"state",
"state management",
"reactive",
"observable",
"computed",
"autorun",
"frp",
"functional reactive programming",
"zustand",
"jotai",
"react",
"mobx",
"solid",
"solid.js",
"recoil",
"preact signals",
"valtio",
"unstated",
"1kb",
"tiny",
"small",
"compact",
"lightweight",
"minimal",
"performance",
"typescript",
"hooks",
"shallow equality"
],
"author": "Eugene Daragan",
"license": "MIT",
"bugs": {
"url": "https://github.com/zheksoon/onek/issues"
},
"homepage": "https://github.com/zheksoon/onek#readme",
"minify": {
"mangle": {
"properties": {
"regex": "^_"
},
"keep_classnames": true,
"reserved": [
"Observable",
"Computed",
"Reaction"
]
}
}
}
17 changes: 17 additions & 0 deletions packages/onek-compat/package.base.json
Original file line number Diff line number Diff line change
@@ -0,0 1,17 @@
{
"name": "onek-compat",
"peerDependencies": {
"react": ">=16.8.0"
},
"devDependencies": {
"onek": "workspace:*",
"@types/jest": "^29.4.0",
"@types/react": ">=16.8.0",
"jest": "^29.0.3",
"microbundle": "^0.15.1",
"prettier": "^2.8.7",
"react": ">=18.0.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1"
}
}
89 changes: 63 additions & 26 deletions compat/package.json → packages/onek-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,5 1,10 @@
{
"name": "onek-compat",
"version": "0.0.9",
"description": "⚡️1.7KB full-featured state management inspired by MobX and Solid, batteries included ⚡️",
"repository": {
"type": "git",
"url": "git https://github.com/zheksoon/onek.git"
},
"main": "./dist/onek.js",
"source": "src/index.ts",
"umd:main": "./dist/onek.umd.js",
Expand All @@ -15,36 20,49 @@
"require": "./dist/onek.js"
}
},
"packageManager": "[email protected]",
"scripts": {
"build": "microbundle --generateTypes=false",
"build-full": "microbundle --no-compress --generateTypes=false",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git https://github.com/zheksoon/onek.git"
},
"peerDependencies": {
"react": ">=16.8.0"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/react": ">=16.8.0",
"jest": "^29.0.3",
"microbundle": "^0.15.1",
"prettier": "^2.8.7",
"react": ">=16.8.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1"
"publish": "yarn run build && yarn publish",
"build": "yarn exec microbundle",
"build-full": "yarn exec microbundle --no-compress",
"test": "yarn exec jest"
},
"files": [
"src/",
"dist/",
"types/",
"LICENSE",
"README.md",
"package.json",
"yarn.lock"
"package.json"
],
"keywords": [
"state",
"state management",
"reactive",
"observable",
"computed",
"autorun",
"frp",
"functional reactive programming",
"zustand",
"jotai",
"react",
"mobx",
"solid",
"solid.js",
"recoil",
"preact signals",
"valtio",
"unstated",
"1kb",
"tiny",
"small",
"compact",
"lightweight",
"minimal",
"performance",
"typescript",
"hooks",
"shallow equality"
],
"author": "Eugene Daragan",
"license": "MIT",
Expand All @@ -58,7 76,26 @@
"regex": "^_"
},
"keep_classnames": true,
"reserved": ["Observable", "Computed", "Reaction"]
"reserved": [
"Observable",
"Computed",
"Reaction"
]
}
},
"name": "onek-compat",
"peerDependencies": {
"react": ">=16.8.0"
},
"devDependencies": {
"onek": "workspace:*",
"@types/jest": "^29.4.0",
"@types/react": ">=16.8.0",
"jest": "^29.0.3",
"microbundle": "^0.15.1",
"prettier": "^2.8.7",
"react": ">=18.0.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1"
}
}
}
Loading

0 comments on commit 66e8679

Please sign in to comment.