Skip to content

Commit 8aa6bab

Browse files
committed
chore(): tooling initiative
addresses ionic-team#2225
1 parent 6faae1b commit 8aa6bab

23 files changed

Lines changed: 158 additions & 464 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,26 @@ published as `ionic`.
5858
1. `npm install` to install the dev tools.
5959
1. `npm run bootstrap` (will install package dependencies and link packages
6060
together)
61-
1. For each package you plan to modify, `cd` into its `packages/*` directory
62-
and run `npm run watch`.
63-
* You should see `TS` and `JS` colored prefixes. We run the Typescript
64-
compiler as well as a JS file watcher for some string replacements.
65-
* You should **always** run `npm run watch` in the `packages/cli-utils` and
66-
`packages/ionic` directories.
61+
1. `npm run watch` will spin up TS & JS watch scripts for all packages.
6762
1. Typescript source files are in `packages/*/src`.
6863
1. Good luck! :muscle: Please open an issue if you have questions or something
6964
is unclear.
7065

7166
###### Running Dev CLI
7267

73-
1. Within each `packages/cli-*` (not `packages/ionic`) directory, run `npm
74-
link` (you may need `sudo`). This will let the CLI install local versions of
75-
plugins.
76-
1. Put `alias i=/path/to/ionic-cli/packages/ionic/bin/ionic` (making sure to
77-
change `/path/to` to your installation directory) in `~/.bashrc` (or
68+
1. Put `alias ionic-local=/path/to/ionic-cli/packages/ionic/bin/ionic` (making
69+
sure to change `/path/to` to your installation directory) in `~/.bashrc` (or
7870
equivalent) and `source ~/.bashrc`.
79-
1. You should now be able to run `i help` and see your locally installed
80-
version.
71+
1. You should now be able to run `ionic-local help` and see your locally
72+
installed version.
8173

8274
##### Code Structure
8375

8476
TODO: Be helpful about where to look for commands, utilities, etc.
8577

8678
##### Publishing Notes
8779

88-
Cancel **ALL** watch scripts before proceeding.
80+
Cancel any watch scripts before proceeding.
8981

9082
* **canary releases**: `npm run publish:canary`
9183
* **beta releases**: `npm run publish:beta`

appveyor.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

circle.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ dependencies:
1818
test:
1919
pre:
2020
- npm run lint
21-
override:
22-
- ./node_modules/.bin/lerna run test
2321

2422
deployment:
2523
pre:

lerna.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"lerna": "2.0.0-beta.38",
2+
"lerna": "2.0.0-rc.4",
33
"version": "independent",
44
"packages": [
5+
"scripts",
56
"packages/*"
67
],
78
"changelog": {
@@ -11,5 +12,6 @@
1112
"feat": "New Feature"
1213
},
1314
"cacheDir": ".changelog"
14-
}
15+
},
16+
"conventionalCommits": true
1517
}

package.json

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
{
22
"private": true,
33
"scripts": {
4-
"bootstrap": "npm run cli-utils:setup && npm run cli-plugin-ionic-angular:setup && lerna bootstrap",
5-
"cli-utils:setup": "cd packages/cli-utils && npm install && npm run build-ts",
6-
"cli-plugin-ionic-angular:setup": "cd packages/cli-plugin-ionic-angular && npm install @ionic/app-scripts",
4+
"bootstrap": "lerna bootstrap && npm run build && npm run link",
5+
"link": "lerna exec --scope \"@ionic/cli-*\" -- npm link",
76
"lint": "tslint -c tslint.json 'packages/*/src/**/*.ts' 'scripts/**/*.ts'",
8-
"build": "tsc",
9-
"watch": "tsc -w",
10-
"docs": "npm run build && node ./scripts/createMarkdownDocs.js",
11-
"watch:docs": "npm-watch docs",
7+
"test": "lerna run test",
8+
"build": "lerna run build",
9+
"watch": "lerna run watch --stream --no-sort --concurrency 8",
10+
"docs": "node ./scripts/docs.js",
1211
"publish:canary": "lerna publish --canary --exact --npm-tag canary",
1312
"publish:beta": "lerna publish --exact --npm-tag beta",
14-
"publish:rc": "lerna publish --exact --npm-tag beta",
1513
"publish:ci": "npm run publish:canary -- --yes",
1614
"publish": "lerna publish --exact",
1715
"prepush": "npm run lint"
1816
},
19-
"watch": {
20-
"docs": {
21-
"patterns": [ "packages", "scripts" ],
22-
"extensions": "ts",
23-
"quiet": false
24-
}
25-
},
2617
"devDependencies": {
2718
"@types/node": "^6.0.68",
2819
"awesome-typescript-loader": "^3.1.2",
@@ -32,13 +23,13 @@
3223
"cross-env": "^4.0.0",
3324
"eslint-config-ionic": "0.0.2",
3425
"husky": "^0.13.3",
35-
"jest": "^19.0.2",
36-
"jest-cli": "^19.0.2",
37-
"lerna": "2.0.0-beta.38",
38-
"npm-watch": "^0.1.9",
26+
"in-publish": "^2.0.0",
27+
"jest": "^20.0.0",
28+
"jest-cli": "^20.0.0",
29+
"lerna": "^2.0.0-rc.4",
3930
"replace": "^0.3.0",
40-
"ts-jest": "^19.0.7",
41-
"tslint": "^4.0.0-dev.0",
31+
"ts-jest": "^20.0.2",
32+
"tslint": "^5.2.0",
4233
"tslint-ionic-rules": "^0.0.8",
4334
"typescript": "^2.3.1"
4435
}

packages/cli-plugin-cordova/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
"types": "./dist/main.d.ts",
99
"scripts": {
1010
"clean": "rm -rf ./dist",
11-
"lint": "../../node_modules/.bin/tslint -c ../../tslint.json 'src/**/*.ts'",
11+
"lint": "tslint -c ../../tslint.json \"src/**/*.ts\"",
1212
"build": "npm run clean && npm run build-ts && npm run build-js",
13-
"build-ts": "../../node_modules/.bin/tsc",
14-
"build-js": "npm run -s script-prepublish && cp ./resources.json ./dist/resources.json",
15-
"watch": "npm run clean && ../../node_modules/.bin/concurrently -p '{name} ' -n 'TS,JS' -c 'cyan.bold,yellow.dim' 'npm run watch-ts' 'npm run watch-js'",
16-
"watch-ts": "../../node_modules/.bin/tsc -w",
17-
"watch-js": "../../node_modules/.bin/cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local 'npm run watch-js-chokidar'",
18-
"watch-js-chokidar": "../../node_modules/.bin/chokidar --silent 'dist/**/*.js' -c 'npm run build-js'",
19-
"script-prepublish": "node ../../scripts/prepublish.js cli-plugin-cordova",
20-
"test": "../../node_modules/.bin/jest",
21-
"prepublish": "npm run build",
13+
"build-ts": "tsc",
14+
"build-js": "npm run script-prepublish",
15+
"watch": "concurrently -p \"{name} \" -n \"TS,JS\" -c \"cyan.bold,yellow.dim\" \"npm run watch-ts\" \"npm run watch-js\"",
16+
"watch-ts": "tsc -w",
17+
"watch-js": "cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local \"npm run watch-js-chokidar\"",
18+
"watch-js-chokidar": "chokidar --silent \"dist/**/*.js\" -c \"npm run build-js\"",
19+
"script-prepublish": "cli-scripts-prepublish cli-plugin-cordova",
20+
"test": "jest",
21+
"prepublish": "in-publish && npm run build || not-in-publish",
2222
"postinstall": "node ./bin/postinstall"
2323
},
2424
"keywords": [
@@ -66,6 +66,7 @@
6666
"xml2js": "^0.4.17"
6767
},
6868
"devDependencies": {
69+
"@ionic/cli-scripts": "*",
6970
"@types/chalk": "^0.4.31",
7071
"@types/xml2js": "0.0.33",
7172
"chalk": "^1.1.3",

packages/cli-plugin-cordova/src/lib/utils/configXmlUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function parseConfigXmlToJson(projectDir: string): Promise<any> {
129129
throw new Error(`Cordova config.xml file was not found in ${projectDir}`);
130130
}
131131
throw e;
132-
};
132+
}
133133

134134
if (!configJson.widget) {
135135
throw new Error('\nYour config.xml file is invalid. You must have a <widget> element.');

packages/cli-plugin-ionic-angular/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"main": "./dist/index.js",
88
"scripts": {
99
"clean": "rm -rf ./dist",
10-
"lint": "../../node_modules/.bin/tslint -c ../../tslint.json 'src/**/*.ts'",
10+
"lint": "tslint -c ../../tslint.json \"src/**/*.ts\"",
1111
"build": "npm run clean && npm run build-ts && npm run build-js",
12-
"build-ts": "../../node_modules/.bin/tsc",
13-
"build-js": "npm run -s script-prepublish",
14-
"watch": "npm run clean && ../../node_modules/.bin/concurrently -p '{name} ' -n 'TS,JS' -c 'cyan.bold,yellow.dim' 'npm run watch-ts' 'npm run watch-js'",
15-
"watch-ts": "../../node_modules/.bin/tsc -w",
16-
"watch-js": "../../node_modules/.bin/cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local 'npm run watch-js-chokidar'",
17-
"watch-js-chokidar": "../../node_modules/.bin/chokidar --silent 'dist/**/*.js' -c 'npm run build-js'",
18-
"script-prepublish": "node ../../scripts/prepublish.js cli-plugin-ionic-angular",
19-
"test": "../../node_modules/.bin/jest",
20-
"prepublish": "npm run build"
12+
"build-ts": "tsc",
13+
"build-js": "npm run script-prepublish",
14+
"watch": "concurrently -p \"{name} \" -n \"TS,JS\" -c \"cyan.bold,yellow.dim\" \"npm run watch-ts\" \"npm run watch-js\"",
15+
"watch-ts": "tsc -w",
16+
"watch-js": "cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local \"npm run watch-js-chokidar\"",
17+
"watch-js-chokidar": "chokidar --silent \"dist/**/*.js\" -c \"npm run build-js\"",
18+
"script-prepublish": "cli-scripts-prepublish cli-plugin-ionic-angular",
19+
"test": "jest",
20+
"prepublish": "in-publish && npm run build || not-in-publish"
2121
},
2222
"repository": {
2323
"type": "git",
@@ -50,11 +50,13 @@
5050
"@angular/compiler": "^4.0.0",
5151
"@angular/compiler-cli": "^4.0.0",
5252
"@angular/core": "^4.0.0",
53+
"@ionic/app-scripts": "^1.3.7",
54+
"@ionic/cli-scripts": "*",
5355
"@types/chalk": "^0.4.31",
5456
"@types/clean-css": "^3.4.30",
5557
"rxjs": "^5.2.0"
5658
},
5759
"peerDependencies": {
58-
"@ionic/app-scripts": "^1.3.1"
60+
"@ionic/app-scripts": "^1.3.7"
5961
}
6062
}

packages/cli-plugin-ionic-angular/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function getIonicAngularVersion(env: IonicEnvironment): Promise<string | u
1919
} catch (e) {
2020
env.log.error(`Error with ${chalk.bold(prettyPath(ionicAngularPackageJsonFilePath))} file: ${e}`);
2121
}
22-
};
22+
}
2323

2424
async function getAppScriptsVersion(env: IonicEnvironment): Promise<string | undefined> {
2525
const appScriptsPackageJsonFilePath = path.resolve(env.project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json'); // TODO
@@ -30,7 +30,7 @@ async function getAppScriptsVersion(env: IonicEnvironment): Promise<string | und
3030
} catch (e) {
3131
env.log.error(`Error with ${chalk.bold(prettyPath(appScriptsPackageJsonFilePath))} file: ${e}`);
3232
}
33-
};
33+
}
3434

3535
export function registerHooks(hooks: IHookEngine) {
3636
hooks.register(name, 'command:docs', async ({ env }) => {

packages/cli-plugin-ionic1/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"main": "./dist/index.js",
88
"scripts": {
99
"clean": "rm -rf ./dist",
10-
"lint": "../../node_modules/.bin/tslint -c ../../tslint.json 'src/**/*.ts'",
10+
"lint": "tslint -c ../../tslint.json \"src/**/*.ts\"",
1111
"build": "npm run clean && npm run build-ts && npm run build-js",
12-
"build-ts": "../../node_modules/.bin/tsc",
13-
"build-js": "npm run -s script-prepublish",
14-
"watch": "npm run clean && ../../node_modules/.bin/concurrently -p '{name} ' -n 'TS,JS' -c 'cyan.bold,yellow.dim' 'npm run watch-ts' 'npm run watch-js'",
15-
"watch-ts": "../../node_modules/.bin/tsc -w",
16-
"watch-js": "../../node_modules/.bin/cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local 'npm run watch-js-chokidar'",
17-
"watch-js-chokidar": "../../node_modules/.bin/chokidar --silent 'dist/**/*.js' -c 'npm run build-js'",
18-
"script-prepublish": "node ../../scripts/prepublish.js cli-plugin-ionic1",
19-
"test": "../../node_modules/.bin/jest",
20-
"prepublish": "npm run build"
12+
"build-ts": "tsc",
13+
"build-js": "npm run script-prepublish",
14+
"watch": "concurrently -p \"{name} \" -n \"TS,JS\" -c \"cyan.bold,yellow.dim\" \"npm run watch-ts\" \"npm run watch-js\"",
15+
"watch-ts": "tsc -w",
16+
"watch-js": "cross-env IONIC_PREPUBLISH_PLUGIN_VERSION=${npm_package_version}-local \"npm run watch-js-chokidar\"",
17+
"watch-js-chokidar": "chokidar --silent \"dist/**/*.js\" -c \"npm run build-js\"",
18+
"script-prepublish": "cli-scripts-prepublish cli-plugin-ionic1",
19+
"test": "jest",
20+
"prepublish": "in-publish && npm run build || not-in-publish"
2121
},
2222
"repository": {
2323
"type": "git",
@@ -54,6 +54,7 @@
5454
"xml2js": "^0.4.17"
5555
},
5656
"devDependencies": {
57+
"@ionic/cli-scripts": "*",
5758
"@types/chalk": "^0.4.31",
5859
"@types/express": "^4.0.35",
5960
"@types/opn": "^3.0.28",

0 commit comments

Comments
 (0)