| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ const ts = require('typescript'); | |||
| 9 | 9 | Error.stackTraceLimit = Infinity; | |
| 10 | 10 | ||
| 11 | 11 | global.angularCliIsLocal = true; | |
| 12 | - global.angularCliPackages = require('./packages'); | ||
| 12 | + global.angularCliPackages = require('./packages').packages; | ||
| 13 | 13 | ||
| 14 | 14 | const compilerOptions = JSON.parse(fs.readFileSync(path.join(__dirname, '../tsconfig.json'))); | |
| 15 | 15 | ||
@@ -48,7 +48,7 @@ require.extensions['.ts'] = function (m, filename) { | |||
| 48 | 48 | ||
| 49 | 49 | // If we're running locally, meaning npm linked. This is basically "developer mode". | |
| 50 | 50 | if (!__dirname.match(new RegExp(`\\${path.sep}node_modules\\${path.sep}`))) { | |
| 51 | - const packages = require('./packages'); | ||
| 51 | + const packages = require('./packages').packages; | ||
| 52 | 52 | ||
| 53 | 53 | // We mock the module loader so that we can fake our packages when running locally. | |
| 54 | 54 | const Module = require('module'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,9 @@ const glob = require('glob'); | |||
| 5 | 5 | const path = require('path'); | |
| 6 | 6 | ||
| 7 | 7 | const packageRoot = path.join(__dirname, '../packages'); | |
| 8 | + const toolsRoot = path.join(__dirname, '../tools'); | ||
| 9 | + const distRoot = path.join(__dirname, '../dist'); | ||
| 10 | + | ||
| 8 | 11 | ||
| 9 | 12 | // All the supported packages. Go through the packages directory and create a map of | |
| 10 | 13 | // name => fullPath. | |
@@ -20,7 +23,7 @@ const packages = | |||
| 20 | 23 | let name = pkgJson['name']; | |
| 21 | 24 | ||
| 22 | 25 | packages[name] = { | |
| 23 | - dist: path.join(__dirname, '../dist', pkg.name), | ||
| 26 | + dist: path.join(distRoot, pkg.name), | ||
| 24 | 27 | packageJson: path.join(pkg.root, 'package.json'), | |
| 25 | 28 | root: pkg.root, | |
| 26 | 29 | relative: path.relative(path.dirname(__dirname), pkg.root), | |
@@ -29,12 +32,38 @@ const packages = | |||
| 29 | 32 | return packages; | |
| 30 | 33 | }, {}); | |
| 31 | 34 | ||
| 35 | + const tools = glob.sync(path.join(toolsRoot, '**/package.json')) | ||
| 36 | + .map(toolPath => path.relative(toolsRoot, path.dirname(toolPath))) | ||
| 37 | + .map(toolName => { | ||
| 38 | + const root = path.join(toolsRoot, toolName); | ||
| 39 | + const pkgJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')); | ||
| 40 | + const name = pkgJson['name']; | ||
| 41 | + const dist = path.join(distRoot, toolName); | ||
| 42 | + | ||
| 43 | + return { | ||
| 44 | + name, | ||
| 45 | + main: path.join(dist, pkgJson['main']), | ||
| 46 | + mainTs: path.join(toolsRoot, toolName, pkgJson['main'].replace(/\.js$/, '.ts')), | ||
| 47 | + root, | ||
| 48 | + packageJson: path.join(toolsRoot, toolName, 'package.json'), | ||
| 49 | + dist | ||
| 50 | + }; | ||
| 51 | + }) | ||
| 52 | + .reduce((tools, tool) => { | ||
| 53 | + tools[tool.name] = tool; | ||
| 54 | + return tools; | ||
| 55 | + }, {}); | ||
| 56 | + | ||
| 32 | 57 | ||
| 33 | - module.exports = packages; | ||
| 58 | + module.exports = { packages, tools }; | ||
| 34 | 59 | ||
| 35 | 60 | ||
| 36 | 61 | // If we run this from the command line, just output the list of modules neatly formatted. | |
| 37 | 62 | if (require.main === module) { | |
| 38 | - // eslint-disable-next-line no-console | ||
| 63 | + /* eslint-disable no-console */ | ||
| 64 | + console.log('Packages:'); | ||
| 39 | 65 | console.log(JSON.stringify(packages, null, 2)); | |
| 66 | + console.log(''); | ||
| 67 | + console.log('Tools:'); | ||
| 68 | + console.log(JSON.stringify(tools, null, 2)); | ||
| 40 | 69 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,9 +9,7 @@ | |||
| 9 | 9 | }, | |
| 10 | 10 | "keywords": [], | |
| 11 | 11 | "scripts": { | |
| 12 | - "build": "node ./scripts/publish/build.js", | ||
| 13 | - "build:patch": "node ./scripts/patch.js", | ||
| 14 | - "build:packages": "for PKG in packages/*; do echo Building $PKG...; tsc -p $PKG; done", | ||
| 12 | + "build": "node scripts/run-tool.js publish build", | ||
| 15 | 13 | "test": "npm-run-all -c test:packages test:cli test:deps test:licenses test:messages", | |
| 16 | 14 | "e2e": "npm run test:e2e", | |
| 17 | 15 | "e2e:nightly": "node tests/run_e2e.js --nightly", | |
@@ -24,7 +22,8 @@ | |||
| 24 | 22 | "test:packages": "node scripts/run-packages-spec.js", | |
| 25 | 23 | "eslint": "eslint .", | |
| 26 | 24 | "tslint": "tslint \"**/*.ts\" -c tslint.json -e \"**/config/schema.d.ts\" -e \"**/tests/**\" -e \"**/blueprints/*/files/**/*.ts\" -e \"node_modules/**\" -e \"tmp/**\" -e \"dist/**\"", | |
| 27 | - "lint": "npm-run-all -c eslint tslint" | ||
| 25 | + "lint": "npm-run-all -c eslint tslint", | ||
| 26 | + "tool": "node scripts/run-tool.js" | ||
| 28 | 27 | }, | |
| 29 | 28 | "repository": { | |
| 30 | 29 | "type": "git", | |
@@ -119,6 +118,7 @@ | |||
| 119 | 118 | "@types/glob": "^5.0.29", | |
| 120 | 119 | "@types/jasmine": "~2.2.0", | |
| 121 | 120 | "@types/lodash": "4.14.50", | |
| 121 | + "@types/minimist": "^1.2.0", | ||
| 122 | 122 | "@types/mock-fs": "^3.6.30", | |
| 123 | 123 | "@types/node": "^6.0.36", | |
| 124 | 124 | "@types/request": "0.0.39", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,7 @@ export interface SchemaClass<JsonType> extends Object { | |||
| 78 | 78 | // Direct access to the schema. | |
| 79 | 79 | $$schema(): RootSchemaTreeNode; | |
| 80 | 80 | ||
| 81 | - $$serialize(mimetype?: string): string; | ||
| 81 | + $$serialize(mimetype?: string, ...args: any[]): string; | ||
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | const chalk = require('chalk'); | |
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const glob = require('glob'); | |
| 8 | - const packages = require('../../lib/packages'); | ||
| 8 | + const packages = require('../../lib/packages').packages; | ||
| 9 | 9 | const path = require('path'); | |
| 10 | 10 | ||
| 11 | 11 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments