diff --git a/modules/effects/schematics-core/index.ts b/modules/effects/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/effects/schematics-core/index.ts +++ b/modules/effects/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/effects/schematics-core/utility/config.ts b/modules/effects/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/effects/schematics-core/utility/config.ts +++ b/modules/effects/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/effects/schematics-core/utility/update.ts b/modules/effects/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/effects/schematics-core/utility/update.ts +++ b/modules/effects/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/entity/schematics-core/index.ts b/modules/entity/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/entity/schematics-core/index.ts +++ b/modules/entity/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/entity/schematics-core/utility/config.ts b/modules/entity/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/entity/schematics-core/utility/config.ts +++ b/modules/entity/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/entity/schematics-core/utility/update.ts b/modules/entity/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/entity/schematics-core/utility/update.ts +++ b/modules/entity/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/router-store/schematics-core/index.ts b/modules/router-store/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/router-store/schematics-core/index.ts +++ b/modules/router-store/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/router-store/schematics-core/utility/config.ts b/modules/router-store/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/router-store/schematics-core/utility/config.ts +++ b/modules/router-store/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/router-store/schematics-core/utility/update.ts b/modules/router-store/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/router-store/schematics-core/utility/update.ts +++ b/modules/router-store/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/schematics-core/index.ts b/modules/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/schematics-core/index.ts +++ b/modules/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/schematics-core/testing/create-package.ts b/modules/schematics-core/testing/create-package.ts index 441c85180d..23a5d502ef 100644 --- a/modules/schematics-core/testing/create-package.ts +++ b/modules/schematics-core/testing/create-package.ts @@ -17,7 +17,7 @@ export function createPackageJson( packagePath, `{ "dependencies": { - "@ngrx/${pkg}": "${prefix}5.2.0" + "@ngrx/${pkg}": "${prefix}${version}" } }` ); diff --git a/modules/schematics-core/testing/get-file-content.ts b/modules/schematics-core/testing/get-file-content.ts deleted file mode 100644 index 44915d283e..0000000000 --- a/modules/schematics-core/testing/get-file-content.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Tree } from '@angular-devkit/schematics'; - -export function getFileContent(tree: Tree, path: string): string { - const fileEntry = tree.get(path); - - if (!fileEntry) { - throw new Error(`The file (${path}) does not exist.`); - } - - return fileEntry.content.toString(); -} diff --git a/modules/schematics-core/testing/index.ts b/modules/schematics-core/testing/index.ts index 894bca7d98..fd1a5cb100 100644 --- a/modules/schematics-core/testing/index.ts +++ b/modules/schematics-core/testing/index.ts @@ -1,4 +1,3 @@ export * from './create-app-module'; export * from './create-reducers'; export * from './create-workspace'; -export * from './get-file-content'; diff --git a/modules/schematics-core/utility/config.ts b/modules/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/schematics-core/utility/config.ts +++ b/modules/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/schematics-core/utility/update.ts b/modules/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/schematics-core/utility/update.ts +++ b/modules/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/schematics/schematics-core/index.ts b/modules/schematics/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/schematics/schematics-core/index.ts +++ b/modules/schematics/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/schematics/schematics-core/utility/config.ts b/modules/schematics/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/schematics/schematics-core/utility/config.ts +++ b/modules/schematics/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/schematics/schematics-core/utility/update.ts b/modules/schematics/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/schematics/schematics-core/utility/update.ts +++ b/modules/schematics/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/store-devtools/schematics-core/index.ts b/modules/store-devtools/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/store-devtools/schematics-core/index.ts +++ b/modules/store-devtools/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/store-devtools/schematics-core/utility/config.ts b/modules/store-devtools/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/store-devtools/schematics-core/utility/config.ts +++ b/modules/store-devtools/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/store-devtools/schematics-core/utility/update.ts b/modules/store-devtools/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/store-devtools/schematics-core/utility/update.ts +++ b/modules/store-devtools/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; }; diff --git a/modules/store/schematics-core/index.ts b/modules/store/schematics-core/index.ts index b148524ec4..861d07cc81 100644 --- a/modules/store/schematics-core/index.ts +++ b/modules/store/schematics-core/index.ts @@ -31,14 +31,7 @@ export { ReplaceChange, } from './utility/change'; -export { - AppConfig, - CliConfig, - getAppFromConfig, - getConfig, - getWorkspace, - getWorkspacePath, -} from './utility/config'; +export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; export { findModule, diff --git a/modules/store/schematics-core/utility/config.ts b/modules/store/schematics-core/utility/config.ts index 481bfb955f..c9d306e0a5 100644 --- a/modules/store/schematics-core/utility/config.ts +++ b/modules/store/schematics-core/utility/config.ts @@ -126,318 +126,6 @@ export interface AppConfig { }; } -export interface CliConfig { - $schema?: string; - /** - * The global configuration of the project. - */ - project?: { - /** - * The name of the project. - */ - name?: string; - /** - * Whether or not this project was ejected. - */ - ejected?: boolean; - }; - /** - * Properties of the different applications in this project. - */ - apps?: AppConfig[]; - /** - * Configuration for end-to-end tests. - */ - e2e?: { - protractor?: { - /** - * Path to the config file. - */ - config?: string; - }; - }; - /** - * Properties to be passed to TSLint. - */ - lint?: { - /** - * File glob(s) to lint. - */ - files?: string | string[]; - /** - * Location of the tsconfig.json project file. - * Will also use as files to lint if 'files' property not present. - */ - project: string; - /** - * Location of the tslint.json configuration. - */ - tslintConfig?: string; - /** - * File glob(s) to ignore. - */ - exclude?: string | string[]; - }[]; - /** - * Configuration for unit tests. - */ - test?: { - karma?: { - /** - * Path to the karma config file. - */ - config?: string; - }; - codeCoverage?: { - /** - * Globs to exclude from code coverage. - */ - exclude?: string[]; - }; - }; - /** - * Specify the default values for generating. - */ - defaults?: { - /** - * The file extension to be used for style files. - */ - styleExt?: string; - /** - * How often to check for file updates. - */ - poll?: number; - /** - * Use lint to fix files after generation - */ - lintFix?: boolean; - /** - * Options for generating a class. - */ - class?: { - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a component. - */ - component?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - /** - * Specifies if the style will be in the ts file. - */ - inlineStyle?: boolean; - /** - * Specifies if the template will be in the ts file. - */ - inlineTemplate?: boolean; - /** - * Specifies the view encapsulation strategy. - */ - viewEncapsulation?: 'Emulated' | 'Native' | 'None'; - /** - * Specifies the change detection strategy. - */ - changeDetection?: 'Default' | 'OnPush'; - }; - /** - * Options for generating a directive. - */ - directive?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a guard. - */ - guard?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating an interface. - */ - interface?: { - /** - * Prefix to apply to interface names. (i.e. I) - */ - prefix?: string; - }; - /** - * Options for generating a module. - */ - module?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a pipe. - */ - pipe?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Options for generating a service. - */ - service?: { - /** - * Flag to indicate if a dir is created. - */ - flat?: boolean; - /** - * Specifies if a spec file is generated. - */ - spec?: boolean; - }; - /** - * Properties to be passed to the build command. - */ - build?: { - /** - * Output sourcemaps. - */ - sourcemaps?: boolean; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The ssl key used by the server. - */ - progress?: boolean; - /** - * Enable and define the file watching poll time period (milliseconds). - */ - poll?: number; - /** - * Delete output path before build. - */ - deleteOutputPath?: boolean; - /** - * Do not use the real path when resolving modules. - */ - preserveSymlinks?: boolean; - /** - * Show circular dependency warnings on builds. - */ - showCircularDependencies?: boolean; - /** - * Use a separate bundle containing code used across multiple bundles. - */ - commonChunk?: boolean; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - }; - /** - * Properties to be passed to the serve command. - */ - serve?: { - /** - * The port the application will be served on. - */ - port?: number; - /** - * The host the application will be served on. - */ - host?: string; - /** - * Enables ssl for the application. - */ - ssl?: boolean; - /** - * The ssl key used by the server. - */ - sslKey?: string; - /** - * The ssl certificate used by the server. - */ - sslCert?: string; - /** - * Proxy configuration file. - */ - proxyConfig?: string; - }; - /** - * Properties about schematics. - */ - schematics?: { - /** - * The schematics collection to use. - */ - collection?: string; - /** - * The new app schematic. - */ - newApp?: string; - }; - }; - /** - * Specify which package manager tool to use. - */ - packageManager?: 'npm' | 'cnpm' | 'yarn' | 'default'; - /** - * Allow people to disable console warnings. - */ - warnings?: { - /** - * Show a warning when the user enabled the --hmr option. - */ - hmrWarning?: boolean; - /** - * Show a warning when the node version is incompatible. - */ - nodeDeprecation?: boolean; - /** - * Show a warning when the user installed angular-cli. - */ - packageDeprecation?: boolean; - /** - * Show a warning when the global version is newer than the local one. - */ - versionMismatch?: boolean; - /** - * Show a warning when the TypeScript version is incompatible - */ - typescriptMismatch?: boolean; - }; -} - export type WorkspaceSchema = experimental.workspace.WorkspaceSchema; export function getWorkspacePath(host: Tree): string { @@ -457,31 +145,3 @@ export function getWorkspace(host: Tree): WorkspaceSchema { return JSON.parse(config); } - -export const configPath = '/.angular-cli.json'; - -export function getConfig(host: Tree): CliConfig { - const configBuffer = host.read(configPath); - if (configBuffer === null) { - throw new SchematicsException('Could not find .angular-cli.json'); - } - - const config = JSON.parse(configBuffer.toString()); - - return config; -} - -export function getAppFromConfig( - config: CliConfig, - appIndexOrName: string -): AppConfig | null { - if (!config.apps) { - return null; - } - - if (parseInt(appIndexOrName) >= 0) { - return config.apps[parseInt(appIndexOrName)]; - } - - return config.apps.filter(app => app.name === appIndexOrName)[0]; -} diff --git a/modules/store/schematics-core/utility/update.ts b/modules/store/schematics-core/utility/update.ts index 2553995551..4123bc42e8 100644 --- a/modules/store/schematics-core/utility/update.ts +++ b/modules/store/schematics-core/utility/update.ts @@ -3,15 +3,13 @@ import { SchematicContext, Tree, SchematicsException, - chain, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; export function updatePackage(name: string): Rule { return (tree: Tree, context: SchematicContext) => { const pkgPath = '/package.json'; const buffer = tree.read(pkgPath); - if (buffer == null) { + if (buffer === null) { throw new SchematicsException('Could not read package.json'); } const content = buffer.toString(); @@ -30,13 +28,11 @@ export function updatePackage(name: string): Rule { const firstChar = pkg[category][packageName][0]; const suffix = match(firstChar, '^') || match(firstChar, '~'); - // TODO: remove beta pkg[category][packageName] = `${suffix}6.0.0`; } }); tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); - context.addTask(new NodePackageInstallTask()); return tree; };