Skip to content

Commit

Permalink
Setup repository
Browse files Browse the repository at this point in the history
Use more self-explainary trick flags

Cleanup imports

Cleanup unused test methods
  • Loading branch information
Pal3love authored and otbbuilder-dev committed Aug 17, 2019
0 parents commit bd1f254
Show file tree
Hide file tree
Showing 554 changed files with 32,152 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{js,jsx,ts,tsx}]
insert_final_newline = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{*.yml,*.yaml,package.json}]
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
tmp
*.log
.idea
packages/*/lib
.cache
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .prettierrc
printWidth: 100
useTabs: false
tabWidth: 4
168 changes: 168 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"cSpell.words": [
"Aglfn",
"Bimap",
"Bopomofo",
"Buginese",
"Buhid",
"CVARGVAR",
"Carian",
"Chiki",
"Cntr",
"Coord",
"Deseret",
"Dflt",
"Dont",
"Eliminable",
"Falses",
"Flippable",
"Freetype",
"Fullwidth",
"Gdef",
"Gpos",
"Gsub",
"Gurmukhi",
"Gvar",
"HASC",
"HDSC",
"HHVV",
"HLGP",
"HVVH",
"Halfwidth",
"Hanunoo",
"Hhea",
"Hmtx",
"Hvar",
"Installable",
"Interp",
"Jamo",
"Jing",
"Johab",
"Kanbun",
"Kangxi",
"Kayah",
"Kharoshthi",
"Lepcha",
"Letterform",
"Letterlike",
"Limbu",
"Loca",
"Loggable",
"Malloc",
"Monoid",
"Mvar",
"Nagri",
"Osmanya",
"Panose",
"Phags",
"Phagspa",
"Phaistos",
"Ppem",
"Rejang",
"Saurashtra",
"Semigroup",
"Sfnt",
"Sidebearing",
"Sinhala",
"Skia",
"Struct",
"Subr",
"Subrs",
"Subsetting",
"Subtable",
"Subtables",
"Syloti",
"Tagbanwa",
"Thaana",
"Tifinagh",
"Vhea",
"Vorg",
"Vvar",
"XUID",
"Xuan",
"Yijing",
"canonicalize",
"cmap",
"comap",
"coronaot",
"cpht",
"cvar",
"dlng",
"eigen",
"fontkit",
"fpgm",
"fvar",
"fvid",
"gids",
"glyf",
"gord",
"hasher",
"hcla",
"hcld",
"hcof",
"hcrn",
"hcrs",
"lsid",
"maxp",
"notdef",
"nullptr",
"opsz",
"otvar",
"pmod",
"relo",
"repo",
"romn",
"sbxo",
"sbxs",
"sbyo",
"sbys",
"slng",
"spxo",
"spxs",
"spyo",
"spys",
"stid",
"stro",
"strs",
"structs",
"unds",
"vasc",
"vcof",
"vcrn",
"vcrs",
"vdsc",
"vlgp",
"vmtx",
"vrtr",
"vwid",
"wdth",
"wght",
"xhgt"
],
"codemetrics.nodeconfiguration.ReturnStatement": 0,
"codemetrics.nodeconfiguration.CaseClause": 0,
"codemetrics.nodeconfiguration.DefaultClause": 0,
"codemetrics.nodeconfiguration.ContinueStatement": 0,
"codemetrics.nodeconfiguration.BreakStatement": 0,
"codemetrics.basics.CodeLensHiddenUnder": 20,
"codemetrics.basics.ComplexityLevelNormal": 10,
"codemetrics.basics.ComplexityLevelHigh": 20,
"codemetrics.basics.ComplexityLevelExtreme": 30,
"codemetrics.basics.ComplexityColorLow": "#00baff",
"codemetrics.basics.ComplexityColorNormal": "#9500ff",
"codemetrics.basics.ComplexityColorHigh": "#ff0066",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"node_modules": true,
"packages/*/node_modules": true,
"packages/*/lib": true,
"**/.cache": true
},
"typescript.tsdk": "./node_modules/typescript/lib",
"prettier.tslintIntegration": true,
"typescript.preferences.importModuleSpecifier": "non-relative"
}
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// 有关 tasks.json 格式的文档,请参见
// https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"label": "TypeScript watch",
"type": "npm",
"script": "watch",
"problemMatcher": [],
"auto": true,
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
}
}
]
}
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# `ot-builder`

DOCUMENTS TBD

----------


# Typescript Composite Project with Lerna

[TypeScript Composite Project(Project References)](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#project-references) + [Lerna](https://github.com/lerna/lerna)


## Usage

### Initialization

```
git clone https://github.com/hanpama/typescript-composite-lerna
cd typescript-composite-lerna
npm run boostrap
npm run watch
```

#### `npm run bootstrap`

* installs the project dependencies (in `/package.json`)
* links each packages
* and builds the project with `npm run build` (`tsc --build packages/tsconfig.project.json`)

#### `npm run watch`

* run tsc project build mode with `--watch` flag (`tsc --build --watch packages/tsconfig.project.json`)

You can watch the entire project with a single tsc running.

### Updating `tsconfig.package.json`

```
npm run update:tsconfig.json
```

Each package has its `tsconfig.package.json` file for individual build.
To integrate those building process into project, we need `references` field listing its build dependencies.

```json
// GENERATED by scripts/update-package-tsconfig.ts
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src",
"composite": true
},
"references": [
{
"path": "../foo/tsconfig.package.json"
},
{
"path": "../bar/tsconfig.package.json"
}
],
"include": [
"src"
],
"exclude": [
"tests",
"lib"
]
}
```

`update:tsconfig.json` is a script which resolves and updates those dependencies.

8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const os = require("os");

module.exports = {
testEnvironment: "node",
testMatch: ["**/packages/*/lib/**/*.test.js"],
roots: ["packages/"],
maxConcurrency: os.cpus().length // use how many processors you have
};
7 changes: 7 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"lerna": "3.4.0",
"packages": [
"packages/*"
],
"version": "0.1.0"
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ot-builder-monorepo",
"private": true,
"license": "MIT",
"scripts": {
"boot": "npm i && npm run update:package.json && lerna bootstrap --hoist --ignore-scripts && npm run update:tsconfig.json",
"clean": "rimraf .cache && lerna run clean && lerna clean --yes",
"build": "tsc --build packages/tsconfig.json",
"rebuild": "npm run clean && npm run boot && npm run build",
"watch": "tsc --build --watch packages/tsconfig.json",
"update:tsconfig.json": "ts-node scripts/update-package-tsconfig.ts",
"update:package.json": "ts-node scripts/update-package-json.ts",
"create-package": "ts-node scripts/create-package.ts",
"test": "jest"
},
"devDependencies": {
"@types/node": "^12.6.1",
"lerna": "^3.15.0",
"typescript": "^3.5.3",
"ts-node": "^8.3.0",
"rimraf": "^2.6.3",
"jest": "^24.8.0",
"vrsource-tslint-rules": "^6.0.0",
"tslint-lerna-rules": "^1.0.4",
"prettier": "^1.15.2",
"prettier-tslint": "^0.4.0"
}
}
1 change: 1 addition & 0 deletions packages/bin-util/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
37 changes: 37 additions & 0 deletions packages/bin-util/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@ot-builder/bin-util",
"description": "",
"license": "MIT",
"dependencies": {
"tslib": "^1.9.3",
"@ot-builder/prelude": "0.1.0",
"@ot-builder/errors": "0.1.0"
},
"devDependencies": {
"jest": "^24.8.0",
"@types/jest": "^24.0.15",
"@types/node": "^12.6.1"
},
"jest": {
"testMatch": [
"**/*.test.js"
],
"rootDir": "lib/"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc -b ./tsconfig.package.json",
"clean": "rimraf lib .cache",
"test": "jest --passWithNoTests"
},
"main": "./lib/index.js",
"version": "0.1.0",
"types": "./lib/index.d.ts",
"files": [
"lib/**/*.js",
"lib/**/*.json",
"lib/**/*.d.ts"
]
}
Loading

0 comments on commit bd1f254

Please sign in to comment.