Skip to content

Commit

Permalink
migrated to lerna & yarn workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
giabao committed Apr 22, 2019
1 parent 66ae8e9 commit 6e1bb2d
Show file tree
Hide file tree
Showing 35 changed files with 485 additions and 264 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ node_modules
/tscOut/
/.rpt2_cache/
/lib/
/src/*/tsconfig.json
/scripts/*.js
/src/**/*.js
*.js.map
*.ts.map
*.tsbuildinfo
Expand All @@ -16,3 +14,6 @@ node_modules
/test/*.d.ts
!/test/typings.d.ts
/test/qunit-ex.js*
/packages/*/lib/
!/packages/*/lib/types/types.d.ts
yarn-error.log
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@
},
"scripts": {
"postinstall": "echo 'https://github.com/qunitjs/qunit/issues/1389' && patch -i qunit.patch node_modules/qunit/qunit/qunit.js",
"clean": "rimraf dist .rpt2_cache",
"tsc:scripts": "tsc -b scripts/tsconfig.json",
"watch:scripts": "tsc -b scripts/tsconfig.json --watch --pretty",
"dist-prepare": "node scripts/dist-prepare.js",
"tsc:src": "node $NODE_DEBUG_OPTION scripts/tsc.js -b",
"watch:tsc_src": "node scripts/tsc.js -b --watch --pretty",
"clean": "node scripts/clean.js && rimraf .rpt2_cache",
"tsc:es2018": "tsc -b",
"watch:tsc_es2018": "tsc -b --watch --pretty",
"tsc:es5": "lerna exec --stream --parallel -- ../../node_modules/.bin/tsc --outDir lib/esm5 --target es5",
"watch:tsc_es5": "lerna exec --stream --parallel -- ../../node_modules/.bin/tsc --outDir lib/esm5 --target es5 --watch --pretty",
"rollup:src": "rollup -c scripts/rollup.config.js",
"watch:rollup_src": "FORCE_COLOR=1 rollup -c scripts/rollup.config.js --watch",
"build:src": "npm-run-all tsc:src rollup:src",
"build:src": "npm-run-all tsc:es2018 tsc:es5 rollup:src",
"build:test": "rollup -c scripts/rollup.config.test.js",
"watch:test": "FORCE_COLOR=1 rollup -c scripts/rollup.config.test.js --watch",
"build": "run-s tsc:scripts build:src build:test",
"prerelease": "run-s clean build dist-prepare",
"release": "node scripts/publish.js",
"prerelease": "TODO run-s clean build dist-prepare",
"release": "TODO node scripts/publish.js",
"watch": "run-p -l watch:*",
"test": "echo 'pls browse test/*.html for testing'"
},
Expand All @@ -67,7 +68,9 @@
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/qunit": "^2.5.4",
"@types/rimraf": "^2.0.2",
"bowser": "^2.3.0",
"delete-empty": "^2.0.0",
"glob": "^7.1.3",
"lerna": "^3.13.3",
"log4javascript": "^1.4.15",
Expand Down
51 changes: 51 additions & 0 deletions packages/classapplier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@rangy/classapplier",
"description": "A cross-browser DOM range and selection library",
"version": "2.1.0",
"author": {
"name": "Tim Down",
"email": "tim@timdown.co.uk",
"url": "http://timdown.co.uk/"
},
"contributors": [
{
"name": "Bui Viet Thanh",
"email": "thanhbv@sandinh.net",
"url": "https://github.com/ohze"
}
],
"keywords": [
"range",
"selection",
"caret",
"DOM"
],
"homepage": "https://github.com/ohze/rangy",
"bugs": {
"url": "https://github.com/ohze/rangy/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"repository": {
"type": "git",
"url": "https://github.com/ohze/rangy.git"
},
"main": "lib/bundles/index.umd.js",
"module": "lib/esm5/index.js",
"es2015": "lib/esm2015/index.js",
"typings": "lib/types/types.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "tsc -b ."
},
"dependencies": {
"@rangy/core": "^2.1.0",
"core-js": "^3.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/classapplier/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* Build date: %%build:date%%
*/

import * as api from "rangy2";
import {dom, Module} from "rangy2";
import * as api from "@rangy/core";
import {dom, Module} from "@rangy/core";
const DomPosition = dom.DomPosition,
isHostMethod = api.util.isHostMethod;

Expand Down
14 changes: 0 additions & 14 deletions packages/classapplier/src/types.d.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/classapplier/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "lib/types",
"outDir": "lib/esm2015",
"target": "es2018"
},
"references": [{"path": "../core"}]
}
50 changes: 50 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "@rangy/core",
"description": "A cross-browser DOM range and selection library",
"version": "2.1.0",
"author": {
"name": "Tim Down",
"email": "tim@timdown.co.uk",
"url": "http://timdown.co.uk/"
},
"contributors": [
{
"name": "Bui Viet Thanh",
"email": "thanhbv@sandinh.net",
"url": "https://github.com/ohze"
}
],
"keywords": [
"range",
"selection",
"caret",
"DOM"
],
"homepage": "https://github.com/ohze/rangy",
"bugs": {
"url": "https://github.com/ohze/rangy/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"repository": {
"type": "git",
"url": "https://github.com/ohze/rangy.git"
},
"main": "lib/bundles/index.umd.js",
"module": "lib/esm5/index.js",
"es2015": "lib/esm2015/index.js",
"typings": "lib/types/types.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "tsc -b ."
},
"dependencies": {
"core-js": "^3.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {}
}
4 changes: 0 additions & 4 deletions packages/core/src/types.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "lib/types",
"outDir": "lib/esm2015",
"target": "es2018"
}
}
52 changes: 52 additions & 0 deletions packages/highlighter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@rangy/highlighter",
"description": "A cross-browser DOM range and selection library",
"version": "2.1.0",
"author": {
"name": "Tim Down",
"email": "tim@timdown.co.uk",
"url": "http://timdown.co.uk/"
},
"contributors": [
{
"name": "Bui Viet Thanh",
"email": "thanhbv@sandinh.net",
"url": "https://github.com/ohze"
}
],
"keywords": [
"range",
"selection",
"caret",
"DOM"
],
"homepage": "https://github.com/ohze/rangy",
"bugs": {
"url": "https://github.com/ohze/rangy/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"repository": {
"type": "git",
"url": "https://github.com/ohze/rangy.git"
},
"main": "lib/bundles/index.umd.js",
"module": "lib/esm5/index.js",
"es2015": "lib/esm2015/index.js",
"typings": "lib/types/types.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "tsc -b ."
},
"dependencies": {
"@rangy/classapplier": "^2.1.0",
"@rangy/core": "^2.1.0",
"core-js": "^3.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {}
}
6 changes: 3 additions & 3 deletions packages/highlighter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* Version: %%build:version%%
* Build date: %%build:date%%
*/
import * as api from "rangy2";
import {WrappedRange, WrappedSelection, dom, RangyRangeEx} from "rangy2";
import {ClassApplier} from "../classapplier";
import * as api from "@rangy/core";
import {WrappedRange, WrappedSelection, dom, RangyRangeEx} from "@rangy/core";
import {ClassApplier} from "@rangy/classapplier";
const getBody = dom.getBody;

// const module = new Module("Highlighter", ["ClassApplier"]);
Expand Down
11 changes: 0 additions & 11 deletions packages/highlighter/src/types.d.ts

This file was deleted.

13 changes: 13 additions & 0 deletions packages/highlighter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "lib/types",
"outDir": "lib/esm2015",
"target": "es2018"
},
"references": [
{"path": "../core"},
{"path": "../classapplier"}
]
}
51 changes: 51 additions & 0 deletions packages/selectionsaverestore/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@rangy/selectionsaverestore",
"description": "A cross-browser DOM range and selection library",
"version": "2.1.0",
"author": {
"name": "Tim Down",
"email": "tim@timdown.co.uk",
"url": "http://timdown.co.uk/"
},
"contributors": [
{
"name": "Bui Viet Thanh",
"email": "thanhbv@sandinh.net",
"url": "https://github.com/ohze"
}
],
"keywords": [
"range",
"selection",
"caret",
"DOM"
],
"homepage": "https://github.com/ohze/rangy",
"bugs": {
"url": "https://github.com/ohze/rangy/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"repository": {
"type": "git",
"url": "https://github.com/ohze/rangy.git"
},
"main": "lib/bundles/index.umd.js",
"module": "lib/esm5/index.js",
"es2015": "lib/esm2015/index.js",
"typings": "lib/types/types.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "tsc -b ."
},
"dependencies": {
"@rangy/core": "^2.1.0",
"core-js": "^3.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/selectionsaverestore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* Build date: %%build:date%%
*/

import * as api from "rangy2";
import {Module, dom, features} from "rangy2";
import * as api from "@rangy/core";
import {Module, dom, features} from "@rangy/core";

const removeNode = dom.removeNode;

Expand Down
14 changes: 0 additions & 14 deletions packages/selectionsaverestore/src/types.d.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/selectionsaverestore/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "lib/types",
"outDir": "lib/esm2015",
"target": "es2018"
},
"references": [{"path": "../core"}]
}
Loading

0 comments on commit 6e1bb2d

Please sign in to comment.