@ionic/cli-plugin-ionic-angular
Advanced tools
Comparing version
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const chalk = require("chalk"); | ||
@@ -15,3 +8,3 @@ const cli_utils_1 = require("@ionic/cli-utils"); | ||
function build(args) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const appScriptsArgs = cli_utils_1.minimistOptionsToArray(args.options, { useEquals: false, ignoreFalse: true, allowCamelCase: true }); | ||
@@ -18,0 +11,0 @@ process.argv = ['node', 'appscripts'].concat(appScriptsArgs); |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const chalk = require("chalk"); | ||
@@ -17,3 +10,3 @@ const path = require("path"); | ||
function generate(args) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
if (!args.env.project.directory) { | ||
@@ -24,3 +17,3 @@ return []; | ||
process.argv = ['node', 'appscripts'].concat(appScriptsArgs); | ||
const ionicAngularPackageJsonFilePath = path.resolve(args.env.project.directory, 'node_modules', 'ionic-angular', 'package.json'); | ||
const ionicAngularPackageJsonFilePath = path.resolve(args.env.project.directory, 'node_modules', 'ionic-angular', 'package.json'); // TODO | ||
try { | ||
@@ -38,16 +31,17 @@ const ionicAngularPackageJson = yield cli_utils_1.readPackageJsonFile(ionicAngularPackageJsonFilePath); | ||
const [type, name] = args.inputs; | ||
const commandOptions = args.options; | ||
switch (type) { | ||
case 'page': | ||
yield AppScripts.processPageRequest(context, name); | ||
yield AppScripts.processPageRequest(context, name, commandOptions); | ||
break; | ||
case 'component': | ||
const componentData = yield promptQuestions(context); | ||
const componentData = yield generate_1.getModules(context, 'component'); | ||
yield AppScripts.processComponentRequest(context, name, componentData); | ||
break; | ||
case 'directive': | ||
const directiveData = yield promptQuestions(context); | ||
const directiveData = yield generate_1.getModules(context, 'directive'); | ||
yield AppScripts.processDirectiveRequest(context, name, directiveData); | ||
break; | ||
case 'pipe': | ||
const pipeData = yield promptQuestions(context); | ||
const pipeData = yield generate_1.getModules(context, 'pipe'); | ||
yield AppScripts.processPipeRequest(context, name, pipeData); | ||
@@ -61,3 +55,3 @@ break; | ||
const tabsData = yield generate_1.tabsPrompt(args.env); | ||
yield AppScripts.processTabsRequest(context, name, tabsData); | ||
yield AppScripts.processTabsRequest(context, name, tabsData, commandOptions); | ||
break; | ||
@@ -70,5 +64,5 @@ } | ||
function promptQuestions(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return yield generate_1.prompt(context); | ||
}); | ||
} |
import { IHookEngine } from '@ionic/cli-utils'; | ||
export declare const name = "__NAME__"; | ||
export declare const version = "__VERSION__"; | ||
export declare const preferGlobal: boolean; | ||
export declare function registerHooks(hooks: IHookEngine): void; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const chalk = require("chalk"); | ||
@@ -18,7 +11,6 @@ const path = require("path"); | ||
exports.name = '@ionic/cli-plugin-ionic-angular'; | ||
exports.version = '1.4.0-alpha.868bd4cc'; | ||
exports.preferGlobal = false; | ||
exports.version = '1.4.0-alpha.8c718a65'; | ||
function getIonicAngularVersion(env) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const ionicAngularPackageJsonFilePath = path.resolve(env.project.directory, 'node_modules', 'ionic-angular', 'package.json'); | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const ionicAngularPackageJsonFilePath = path.resolve(env.project.directory, 'node_modules', 'ionic-angular', 'package.json'); // TODO | ||
try { | ||
@@ -34,4 +26,4 @@ const ionicAngularPackageJson = yield cli_utils_1.readPackageJsonFile(ionicAngularPackageJsonFilePath); | ||
function getAppScriptsVersion(env) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const appScriptsPackageJsonFilePath = path.resolve(env.project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json'); | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const appScriptsPackageJsonFilePath = path.resolve(env.project.directory, 'node_modules', '@ionic', 'app-scripts', 'package.json'); // TODO | ||
try { | ||
@@ -47,3 +39,3 @@ const appScriptsPackageJson = yield cli_utils_1.readPackageJsonFile(appScriptsPackageJsonFilePath); | ||
function registerHooks(hooks) { | ||
hooks.register(exports.name, 'command:docs', ({ env }) => __awaiter(this, void 0, void 0, function* () { | ||
hooks.register(exports.name, 'command:docs', ({ env }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const docsHomepage = 'https://ionicframework.com/docs'; | ||
@@ -57,6 +49,6 @@ if (!env.project.directory) { | ||
})); | ||
hooks.register(exports.name, 'command:generate', (args) => __awaiter(this, void 0, void 0, function* () { | ||
hooks.register(exports.name, 'command:generate', (args) => tslib_1.__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* () { | ||
hooks.register(exports.name, 'command:info', ({ env }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
if (!env.project.directory) { | ||
@@ -68,10 +60,10 @@ return []; | ||
{ type: 'local-packages', name: 'Ionic Framework', version: ionicAngularVersion ? `ionic-angular ${ionicAngularVersion}` : 'not installed' }, | ||
{ type: 'local-packages', name: exports.name, version: exports.version }, | ||
{ type: 'cli-packages', name: exports.name, version: exports.version, path: path.dirname(path.dirname(__filename)) }, | ||
{ type: 'local-packages', name: '@ionic/app-scripts', version: appScriptsVersion ? appScriptsVersion : 'not installed' }, | ||
]; | ||
})); | ||
hooks.register(exports.name, 'command:serve', (args) => __awaiter(this, void 0, void 0, function* () { | ||
hooks.register(exports.name, 'command:serve', (args) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return serve_1.serve(args); | ||
})); | ||
hooks.register(exports.name, 'command:build', (args) => __awaiter(this, void 0, void 0, function* () { | ||
hooks.register(exports.name, 'command:build', (args) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
yield build_1.build(args); | ||
@@ -78,0 +70,0 @@ })); |
@@ -1,4 +0,2 @@ | ||
import { CommandHookArgs } from '@ionic/cli-utils'; | ||
export declare function serve(args: CommandHookArgs): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
import { CommandHookArgs, ServeCommandHookResponse } from '@ionic/cli-utils'; | ||
export declare function serve(args: CommandHookArgs): Promise<ServeCommandHookResponse>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const chalk = require("chalk"); | ||
@@ -15,3 +8,3 @@ const cli_utils_1 = require("@ionic/cli-utils"); | ||
function serve(args) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
let chosenIP = 'localhost'; | ||
@@ -47,2 +40,4 @@ if (args.options.externalIpRequired) { | ||
const context = AppScripts.generateContext(); | ||
// using app-scripts and livereload is requested | ||
// Also remove commandName from the rawArgs passed | ||
args.env.log.info(`Starting app-scripts server: ${chalk.bold(appScriptsArgs.join(' '))} - Ctrl+C to cancel`); | ||
@@ -60,5 +55,5 @@ const settings = yield AppScripts.serve(context); | ||
(localAddress !== externalAddress ? `External: ${chalk.bold(externalAddress)}` : '')); | ||
return Object.assign({ publicIp: chosenIP, protocol: 'http' }, settings); | ||
return Object.assign({ publicIp: chosenIP, protocol: 'http', localAddress: 'localhost', externalAddress: chosenIP, port: settings.httpPort }, settings); | ||
}); | ||
} | ||
exports.serve = serve; |
@@ -9,2 +9,3 @@ import { IonicEnvironment } from '@ionic/cli-utils'; | ||
export declare function prompt(context: AppScriptsType.BuildContext): Promise<string>; | ||
export declare function getModules(context: AppScriptsType.BuildContext, kind: string): Promise<string>; | ||
export declare function tabsPrompt(env: IonicEnvironment): Promise<string[]>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const path = require("path"); | ||
@@ -15,3 +8,3 @@ const cli_utils_1 = require("@ionic/cli-utils"); | ||
function getPages(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const AppScripts = modules_1.load('@ionic/app-scripts'); | ||
@@ -31,3 +24,3 @@ const pages = yield AppScripts.getNgModules(context, ['page', 'component']); | ||
function prompt(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return context.appNgModulePath; | ||
@@ -37,4 +30,17 @@ }); | ||
exports.prompt = prompt; | ||
function getModules(context, kind) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
switch (kind) { | ||
case 'component': | ||
return context.componentsNgModulePath ? context.componentsNgModulePath : context.appNgModulePath; | ||
case 'pipe': | ||
return context.pipesNgModulePath ? context.pipesNgModulePath : context.appNgModulePath; | ||
case 'directive': | ||
return context.directivesNgModulePath ? context.directivesNgModulePath : context.appNgModulePath; | ||
} | ||
}); | ||
} | ||
exports.getModules = getModules; | ||
function tabsPrompt(env) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const tabNames = []; | ||
@@ -41,0 +47,0 @@ const howMany = yield env.prompt({ |
{ | ||
"name": "@ionic/cli-plugin-ionic-angular", | ||
"version": "1.4.0-alpha.868bd4cc", | ||
"version": "1.4.0-alpha.8c718a65", | ||
"description": "Ionic CLI build plugin for Ionic Angular projects", | ||
@@ -10,3 +10,3 @@ "homepage": "https://ionic.io/", | ||
"clean": "rm -rf ./dist", | ||
"lint": "tslint -c ../../tslint.json \"src/**/*.ts\"", | ||
"lint": "tslint --config ../../tslint.js --project tsconfig.json --type-check", | ||
"build": "npm run clean && npm run build-ts && npm run build-js", | ||
@@ -46,4 +46,5 @@ "build-ts": "tsc", | ||
"dependencies": { | ||
"@ionic/cli-utils": "1.6.0-alpha.868bd4cc", | ||
"chalk": "^2.0.0" | ||
"@ionic/cli-utils": "1.6.0-alpha.8c718a65", | ||
"chalk": "^2.0.0", | ||
"tslib": "^1.7.1" | ||
}, | ||
@@ -54,4 +55,4 @@ "devDependencies": { | ||
"@angular/core": "^4.2.4", | ||
"@ionic/app-scripts": "^2.0.0", | ||
"@ionic/cli-scripts": "0.3.0-alpha.868bd4cc", | ||
"@ionic/app-scripts": "^2.1.0", | ||
"@ionic/cli-scripts": "0.3.0-alpha.8c718a65", | ||
"@types/chalk": "^0.4.31", | ||
@@ -58,0 +59,0 @@ "@types/clean-css": "^3.4.30", |
18315
-8.18%3
50%292
-7.01%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed