@ionic/cli-plugin-ionic-angular
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
import { CLIEventEmitterBuildEventArgs } from '@ionic/cli-utils'; | ||
export declare function build(args: CLIEventEmitterBuildEventArgs): Promise<void>; | ||
import { CommandHookArgs } from '@ionic/cli-utils'; | ||
export declare function build(args: CommandHookArgs): Promise<void>; |
@@ -20,3 +20,3 @@ "use strict"; | ||
const context = AppScripts.generateContext(); | ||
console.log(` Running app-scripts build: ${chalk.bold(appScriptsArgs.join(' '))}`); | ||
console.log(`Running app-scripts build: ${chalk.bold(appScriptsArgs.join(' '))}\n`); | ||
return yield AppScripts.build(context); | ||
@@ -23,0 +23,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
import { CLIEventEmitterGenerateEventArgs } from '@ionic/cli-utils'; | ||
export declare function generate(args: CLIEventEmitterGenerateEventArgs): Promise<string[]>; | ||
import { CommandHookArgs } from '@ionic/cli-utils'; | ||
export declare function generate(args: CommandHookArgs): Promise<string[]>; |
@@ -11,2 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path = require("path"); | ||
const cli_utils_1 = require("@ionic/cli-utils"); | ||
@@ -18,6 +19,9 @@ const modules_1 = require("./lib/modules"); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!args.env.project.directory) { | ||
return []; | ||
} | ||
const appScriptsArgs = arguments_1.minimistOptionsToArray(args.options); | ||
process.argv = ['node', 'appscripts'].concat(appScriptsArgs); | ||
const ionicInfo = yield cli_utils_1.getIonicInfo(); | ||
if (ionicInfo.version.charAt(0) < 3) { | ||
const ionicInfo = yield cli_utils_1.readPackageJsonFile(path.resolve(args.env.project.directory, 'node_modules', 'ionic-angular', 'package.json')); | ||
if (Number(ionicInfo.version.charAt(0)) < 3) { | ||
throw new Error(`The generate command is only available for projects that use ionic-angular >= 3.0.0`); | ||
@@ -45,3 +49,3 @@ } | ||
const tabsData = yield tabsPromptQuestions(); | ||
yield AppScripts.processTabsRequest(context, name, tabsData); // TODO: match return type | ||
yield AppScripts.processTabsRequest(context, name, tabsData); | ||
} | ||
@@ -48,0 +52,0 @@ return []; |
@@ -1,2 +0,4 @@ | ||
import { ICLIEventEmitter } from '@ionic/cli-utils'; | ||
export declare function registerEvents(emitter: ICLIEventEmitter): void; | ||
import { IHookEngine } from '@ionic/cli-utils'; | ||
export declare const name = "__NAME__"; | ||
export declare const version = "__VERSION__"; | ||
export declare function registerHooks(hooks: IHookEngine): void; |
@@ -11,16 +11,44 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path = require("path"); | ||
const cli_utils_1 = require("@ionic/cli-utils"); | ||
const build_1 = require("./build"); | ||
const generate_1 = require("./generate"); | ||
const serve_1 = require("./serve"); | ||
function registerEvents(emitter) { | ||
emitter.on('generate', (args) => __awaiter(this, void 0, void 0, function* () { | ||
return generate_1.generate(args); | ||
exports.name = '@ionic/cli-plugin-ionic-angular'; | ||
exports.version = '0.0.7-alpha.9279cbab'; | ||
function registerHooks(hooks) { | ||
hooks.register(exports.name, 'command:docs', ({ env }) => __awaiter(this, void 0, void 0, function* () { | ||
const docsHomepage = 'https://ionicframework.com/docs'; | ||
if (!env.project.directory) { | ||
return docsHomepage; | ||
} | ||
const ionicAngularPackageJson = yield cli_utils_1.readPackageJsonFile(path.resolve(env.project.directory, 'node_modules', 'ionic-angular', 'package.json')); | ||
const ionicAngularVersion = ionicAngularPackageJson.version ? ionicAngularPackageJson.version + '/' : ''; | ||
const url = `${docsHomepage}/${ionicAngularVersion}api`; | ||
return url; | ||
})); | ||
emitter.on('serve', (args) => __awaiter(this, void 0, void 0, function* () { | ||
hooks.register(exports.name, 'command:generate', (args) => __awaiter(this, void 0, void 0, function* () { | ||
yield generate_1.generate(args); | ||
})); | ||
hooks.register(exports.name, 'command:info', ({ env }) => __awaiter(this, void 0, void 0, function* () { | ||
if (!env.project.directory) { | ||
return []; | ||
} | ||
const [ionicAngularPackageJson, appScriptsPackageJson] = yield Promise.all([ | ||
cli_utils_1.readPackageJsonFile(path.resolve(env.project.directory, 'node_modules', 'ionic-angular', 'package.json')), | ||
cli_utils_1.readPackageJsonFile(path.resolve(env.project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json')), | ||
]); | ||
return [ | ||
{ type: 'local-npm', name: 'Ionic Framework', version: `ionic-angular ${ionicAngularPackageJson.version}` }, | ||
{ type: 'local-npm', name: exports.name, version: exports.version }, | ||
{ type: 'local-npm', name: '@ionic/app-scripts', version: appScriptsPackageJson.version }, | ||
]; | ||
})); | ||
hooks.register(exports.name, 'command:serve', (args) => __awaiter(this, void 0, void 0, function* () { | ||
return serve_1.serve(args); | ||
})); | ||
emitter.on('build', (args) => __awaiter(this, void 0, void 0, function* () { | ||
return build_1.build(args); | ||
hooks.register(exports.name, 'command:build', (args) => __awaiter(this, void 0, void 0, function* () { | ||
yield build_1.build(args); | ||
})); | ||
} | ||
exports.registerEvents = registerEvents; | ||
exports.registerHooks = registerHooks; |
@@ -1,4 +0,4 @@ | ||
import { CLIEventEmitterServeEventArgs } from '@ionic/cli-utils'; | ||
export declare function serve(args: CLIEventEmitterServeEventArgs): Promise<{ | ||
import { CommandHookArgs } from '@ionic/cli-utils'; | ||
export declare function serve(args: CommandHookArgs): Promise<{ | ||
[key: string]: any; | ||
}>; |
@@ -12,8 +12,8 @@ "use strict"; | ||
const chalk = require("chalk"); | ||
const cli_utils_1 = require("@ionic/cli-utils"); | ||
const modules_1 = require("./lib/modules"); | ||
const network_1 = require("./utils/network"); | ||
const arguments_1 = require("./utils/arguments"); | ||
function serve(args) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const availableIPs = network_1.getAvailableIPAddress(); | ||
const availableIPs = cli_utils_1.getAvailableIPAddress(); | ||
if (availableIPs.length === 0 && args.options.externalIpRequired) { | ||
@@ -43,5 +43,3 @@ throw new Error(`It appears that you do not have any external network interfaces. ` + | ||
const context = AppScripts.generateContext(); | ||
// using app-scripts and livereload is requested | ||
// Also remove commandName from the rawArgs passed | ||
console.log(` Starting app-scripts server: ${chalk.bold(appScriptsArgs.join(' '))}`); | ||
console.log(`Starting app-scripts server: ${chalk.bold(appScriptsArgs.join(' '))}\n`); | ||
const settings = yield AppScripts.serve(context); | ||
@@ -48,0 +46,0 @@ if (!settings) { |
{ | ||
"name": "@ionic/cli-plugin-ionic-angular", | ||
"version": "0.0.6", | ||
"version": "0.0.7-alpha.9279cbab", | ||
"description": "Ionic CLI build plugin for Ionic Angular projects", | ||
@@ -9,8 +9,13 @@ "homepage": "https://ionic.io/", | ||
"scripts": { | ||
"clean": "rm -rf ./dist", | ||
"lint": "../../node_modules/.bin/tslint -c ../../tslint.json 'src/**/*.ts'", | ||
"build": "npm run clean && ../../node_modules/.bin/tsc", | ||
"clean": "rm -rf ./dist", | ||
"changelog": "conventional-changelog -i CHANGELOG.md -s -p angular", | ||
"build": "npm run clean && npm run build-ts && npm run build-js", | ||
"build-ts": "../../node_modules/.bin/tsc", | ||
"build-js": "npm run -s script-prepublish", | ||
"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'", | ||
"watch-ts": "../../node_modules/.bin/tsc -w", | ||
"watch-js": "../../node_modules/.bin/chokidar --silent 'dist/**/*.js' -c 'npm run build-js'", | ||
"script-prepublish": "node ../../scripts/prepublish.js cli-plugin-ionic-angular", | ||
"test": "../../node_modules/.bin/jest", | ||
"watch": "npm run clean && ../../node_modules/.bin/tsc --watch" | ||
"prepublish": "npm run build" | ||
}, | ||
@@ -41,3 +46,3 @@ "repository": { | ||
"dependencies": { | ||
"@ionic/cli-utils": "^0.0.11", | ||
"@ionic/cli-utils": "0.0.12-alpha.9279cbab", | ||
"chalk": "^1.1.3", | ||
@@ -44,0 +49,0 @@ "inquirer": "^3.0.6" |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
0
-100%0
-100%16479
-2.39%16
-11.11%288
-11.38%+ Added
+ Added
- Removed