init core package

This commit is contained in:
Yanzhen Yu 2021-07-02 16:06:02 +08:00
parent 322e72b1ef
commit cd8014c4eb
11 changed files with 2538 additions and 41 deletions

4
.gitignore vendored
View File

@ -7,3 +7,7 @@
*.log.* *.log.*
node_modules node_modules
# dist
lib
tsconfig.tsbuildinfo

16
config/jest.config.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
transform: {
".ts": "ts-jest",
},
globals: {
"ts-jest": {
diagnostics: false,
},
},
moduleFileExtensions: ["ts", "js"],
testMatch: ["<rootDir>/__tests__/**/**.spec.ts"],
testPathIgnorePatterns: ["/node_modules/", "/lib/", "<rootDir>/lib/"],
collectCoverage: Boolean(process.env.COVERAGE),
collectCoverageFrom: ["<rootDir>/src/**/*.ts"],
coveragePathIgnorePatterns: ["generated"],
};

11
config/tsconfig.base.json Normal file
View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "commonjs",
"strict": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}

View File

@ -5,6 +5,22 @@
"lerna": "lerna" "lerna": "lerna"
}, },
"devDependencies": { "devDependencies": {
"lerna": "^4.0.0" "husky": "^6.0.0",
"lerna": "^4.0.0",
"lint-staged": "^11.0.0"
},
"workspaces": [
"packages/*"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"packages/**/!(generated)/*.{js,ts,tsx,yml,json}": [
"prettier --write",
"git add"
]
} }
} }

11
packages/core/README.md Normal file
View File

@ -0,0 +1,11 @@
# `@meta-ui/core`
> TODO: description
## Usage
```
const core = require('@meta-ui/core');
// TODO: DEMONSTRATE API
```

View File

@ -0,0 +1,3 @@
module.exports = {
...require("../../config/jest.config"),
};

View File

@ -0,0 +1,41 @@
{
"name": "@meta-ui/core",
"version": "0.1.0",
"description": "meta-ui core runtime",
"author": "Yanzhen Yu <yanzhen@smartx.com>",
"homepage": "https://github.com/webzard-io/meta-ui#readme",
"license": "MIT",
"main": "lib/core.js",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/webzard-io/meta-ui.git"
},
"scripts": {
"build": "tsc -b .",
"typings": "tsc -d --emitDeclarationOnly --declarationDir typings",
"test": "jest",
"lint": "eslint src --ext .ts",
"prepublish": "npm run build && npm run typings"
},
"bugs": {
"url": "https://github.com/webzard-io/meta-ui/issues"
},
"devDependencies": {
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"ts-jest": "^27.0.3",
"typescript": "^4.3.5"
}
}

View File

View File

@ -0,0 +1,12 @@
{
"extends": "../../config/tsconfig.base.json",
"compilerOptions": {
"target": "es6",
"outDir": "lib",
"lib": ["es6"],
"composite": true,
"rootDir": "src"
},
"include": ["src/**/*.ts"],
"exclude": ["__tests__/**/*.ts"]
}

8
tsconfig.json Normal file
View File

@ -0,0 +1,8 @@
{
"extends": "./config/tsconfig.base.json",
"references": [
{
"path": "./packages/core"
}
]
}

2455
yarn.lock

File diff suppressed because it is too large Load Diff