From f48da67be2587c3bf8ac4f1ec9d73d6e1467e3c7 Mon Sep 17 00:00:00 2001 From: Shigma Date: Fri, 22 Dec 2023 00:27:09 +0800 Subject: [PATCH] refa: refactor to monorepo --- package.json | 56 +++++++++++---------------- packages/logger/package.json | 38 ++++++++++++++++++ packages/logger/readme.md | 1 + {src => packages/logger/src}/index.ts | 0 packages/logger/tsconfig.json | 12 ++++++ readme.md | 4 +- tsconfig.base.json | 13 +++++++ tsconfig.json | 20 +++------- 8 files changed, 96 insertions(+), 48 deletions(-) create mode 100644 packages/logger/package.json create mode 100644 packages/logger/readme.md rename {src => packages/logger/src}/index.ts (100%) create mode 100644 packages/logger/tsconfig.json create mode 100644 tsconfig.base.json diff --git a/package.json b/package.json index ff3e56b..d16c0cc 100644 --- a/package.json +++ b/package.json @@ -1,47 +1,37 @@ { - "name": "@cordisjs/logger", - "description": "Logger plugin for cordis", - "version": "0.1.2", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "files": [ - "lib", - "src" + "name": "@root/std", + "private": true, + "version": "1.0.0", + "workspaces": [ + "external/*", + "packages/*" ], - "author": "Shigma ", "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/cordisjs/logger.git", - "directory": "packages/core" - }, - "bugs": { - "url": "https://github.com/cordisjs/logger/issues" - }, - "homepage": "https://github.com/cordisjs/logger", - "keywords": [ - "cordis", - "logger", - "service", - "plugin" - ], "scripts": { "build": "tsc -b", - "lint": "eslint --cache" + "bump": "yarn yakumo version", + "dep": "yarn yakumo upgrade", + "pub": "yarn yakumo publish", + "lint": "eslint --cache", + "test": "yarn yakumo test -r esbuild-register", + "test:text": "shx rm -rf coverage && c8 -r text yarn test", + "test:json": "shx rm -rf coverage && c8 -r json yarn test", + "test:html": "shx rm -rf coverage && c8 -r html yarn test" }, "devDependencies": { "@cordisjs/eslint-config": "^1.0.4", + "@types/chai": "^4.3.11", "@types/node": "^20.10.2", - "cordis": "^3.4.0", + "c8": "^7.14.0", + "chai": "^4.3.10", "esbuild": "^0.18.20", "esbuild-register": "^3.5.0", "eslint": "^8.55.0", - "typescript": "^5.3.2" - }, - "peerDependencies": { - "cordis": "^3.4.0" - }, - "dependencies": { - "reggol": "^1.6.3" + "shx": "^0.3.4", + "typescript": "^5.3.2", + "yakumo": "^1.0.0-alpha.7", + "yakumo-esbuild": "^1.0.0-alpha.2", + "yakumo-publish-sync": "^1.0.0-alpha.1", + "yakumo-tsc": "^1.0.0-alpha.2" } } diff --git a/packages/logger/package.json b/packages/logger/package.json new file mode 100644 index 0000000..ee80701 --- /dev/null +++ b/packages/logger/package.json @@ -0,0 +1,38 @@ +{ + "name": "@cordisjs/logger", + "description": "Logger plugin for cordis", + "version": "0.1.2", + "main": "lib/index.js", + "module": "lib/index.mjs", + "types": "lib/index.d.ts", + "files": [ + "lib", + "src" + ], + "author": "Shigma ", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/cordisjs/std.git", + "directory": "packages/logger" + }, + "bugs": { + "url": "https://github.com/cordisjs/std/issues" + }, + "homepage": "https://github.com/cordisjs/std", + "keywords": [ + "cordis", + "logger", + "service", + "plugin" + ], + "devDependencies": { + "cordis": "^3.4.0" + }, + "peerDependencies": { + "cordis": "^3.4.0" + }, + "dependencies": { + "reggol": "^1.6.3" + } +} diff --git a/packages/logger/readme.md b/packages/logger/readme.md new file mode 100644 index 0000000..5ac3ac3 --- /dev/null +++ b/packages/logger/readme.md @@ -0,0 +1 @@ +# @cordisjs/logger diff --git a/src/index.ts b/packages/logger/src/index.ts similarity index 100% rename from src/index.ts rename to packages/logger/src/index.ts diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json new file mode 100644 index 0000000..6f11f32 --- /dev/null +++ b/packages/logger/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "strict": true, + "noImplicitAny": false, + }, + "include": [ + "src", + ], +} diff --git a/readme.md b/readme.md index 5ac3ac3..ea2d625 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,3 @@ -# @cordisjs/logger +# @cordisjs/std + +Standard library for Cordis. diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..18e906f --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es2022", + "module": "commonjs", + "declaration": true, + "composite": true, + "incremental": true, + "skipLibCheck": true, + "esModuleInterop": true, + "moduleResolution": "node", + "strictBindCallApply": true, + }, +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 6f657f4..7c1573f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,11 @@ { + "extends": "./tsconfig.base", "compilerOptions": { "baseUrl": ".", - "outDir": "lib", - "rootDir": "src", - "target": "es2022", - "module": "commonjs", - "strict": true, - "declaration": true, - "composite": true, - "incremental": true, - "skipLibCheck": true, - "esModuleInterop": true, - "moduleResolution": "node", + "paths": { + "@cordisjs/loader": ["packages/core/src"], + "@cordisjs/*": ["packages/*/src"], + }, }, - "include": [ - "src", - ], + "files": [], }