@ngrx/schematics
Advanced tools
Comparing version 13.0.0-rc.0 to 13.0.0
{ | ||
"name": "@ngrx/schematics", | ||
"version": "13.0.0-rc.0", | ||
"version": "13.0.0", | ||
"description": "NgRx Schematics for Angular", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -10,6 +10,4 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.visitTemplates = exports.visitNgModules = exports.visitDecorator = exports.visitComponents = exports.visitNgModuleExports = exports.visitNgModuleImports = exports.visitTSSourceFiles = exports.platformVersion = exports.addPackageToPackageJson = exports.parseName = exports.updatePackage = exports.stringUtils = exports.isLib = exports.getProject = exports.getProjectPath = exports.getPrefix = exports.omit = exports.addReducerToActionReducerMap = exports.addReducerImportToNgModule = exports.addReducerToStateInterface = exports.addReducerToState = exports.findPropertyInAstObject = exports.buildRelativePath = exports.findModuleFromOptions = exports.findModule = exports.findComponentFromOptions = exports.getWorkspacePath = exports.getWorkspace = exports.commitChanges = exports.createChangeRecorder = exports.createReplaceChange = exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = exports.containsProperty = exports.replaceImport = exports.addProviderToModule = exports.addProviderToComponent = exports.addImportToModule = exports.addExportToModule = exports.addDeclarationToModule = exports.addBootstrapToModule = exports.insertImport = exports.insertAfterLastOccurrence = exports.getContentOfKeyLiteral = exports.getDecoratorMetadata = exports.getSourceNodes = exports.findNodes = exports.isIvyEnabled = void 0; | ||
exports.visitTemplates = exports.visitNgModules = exports.visitDecorator = exports.visitComponents = exports.visitNgModuleExports = exports.visitNgModuleImports = exports.visitTSSourceFiles = exports.platformVersion = exports.addPackageToPackageJson = exports.parseName = exports.updatePackage = exports.stringUtils = exports.isLib = exports.getProject = exports.getProjectPath = exports.getPrefix = exports.omit = exports.addReducerToActionReducerMap = exports.addReducerImportToNgModule = exports.addReducerToStateInterface = exports.addReducerToState = exports.findPropertyInAstObject = exports.buildRelativePath = exports.findModuleFromOptions = exports.findModule = exports.findComponentFromOptions = exports.getWorkspacePath = exports.getWorkspace = exports.commitChanges = exports.createChangeRecorder = exports.createReplaceChange = exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = exports.containsProperty = exports.replaceImport = exports.addProviderToModule = exports.addProviderToComponent = exports.addImportToModule = exports.addExportToModule = exports.addDeclarationToModule = exports.addBootstrapToModule = exports.insertImport = exports.insertAfterLastOccurrence = exports.getContentOfKeyLiteral = exports.getDecoratorMetadata = exports.getSourceNodes = exports.findNodes = void 0; | ||
var strings_1 = require("./utility/strings"); | ||
var angular_utils_1 = require("./utility/angular-utils"); | ||
__createBinding(exports, angular_utils_1, "isIvyEnabled"); | ||
var ast_utils_1 = require("./utility/ast-utils"); | ||
@@ -16,0 +14,0 @@ __createBinding(exports, ast_utils_1, "findNodes"); |
@@ -18,2 +18,3 @@ "use strict"; | ||
var config = configBuffer.toString(); | ||
console.log(config); | ||
return JSON.parse(config); | ||
@@ -20,0 +21,0 @@ } |
"use strict"; | ||
exports.__esModule = true; | ||
exports.platformVersion = void 0; | ||
exports.platformVersion = '^13.0.0-beta.0'; | ||
exports.platformVersion = '^13.0.0'; | ||
//# sourceMappingURL=libs-version.js.map |
@@ -15,3 +15,3 @@ import { | ||
xdescribe('Action Schematic', () => { | ||
describe('Action Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -18,0 +18,0 @@ '@ngrx/schematics', |
@@ -14,3 +14,3 @@ import { | ||
xdescribe('component-store', () => { | ||
describe('component-store', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -17,0 +17,0 @@ '@ngrx/schematics', |
@@ -12,3 +12,3 @@ import { | ||
xdescribe('Container Schematic', () => { | ||
describe('Container Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -15,0 +15,0 @@ '@ngrx/schematics', |
@@ -14,3 +14,3 @@ import { | ||
xdescribe('Data Schematic', () => { | ||
describe('Data Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -17,0 +17,0 @@ '@ngrx/schematics', |
@@ -15,3 +15,3 @@ import { | ||
xdescribe('Effect Schematic', () => { | ||
describe('Effect Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -18,0 +18,0 @@ '@ngrx/schematics', |
@@ -32,4 +32,3 @@ "use strict"; | ||
return schematics_core_1.stringUtils.group(s, options.group ? 'reducers' : ''); | ||
}, isIvyEnabled: (0, schematics_core_1.isIvyEnabled)(host, 'tsconfig.json') && | ||
(0, schematics_core_1.isIvyEnabled)(host, projectConfig.root + "/tsconfig.app.json") }), options); | ||
} }), options); | ||
var commonTemplates = (0, schematics_1.apply)((0, schematics_1.url)('./common-files'), [ | ||
@@ -36,0 +35,0 @@ options.skipTests |
@@ -14,3 +14,3 @@ import { | ||
xdescribe('Entity Schematic', () => { | ||
describe('Entity Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -250,36 +250,2 @@ '@ngrx/schematics', | ||
describe('View engine', () => { | ||
beforeEach(() => { | ||
// remove the first line comment from the json file | ||
const json = appTree | ||
.readContent('./projects/bar/tsconfig.app.json') | ||
.split('\n') | ||
.slice(1) | ||
.join('\n'); | ||
const tsConfig = JSON.parse(json); | ||
tsConfig.angularCompilerOptions = tsConfig.angularCompilerOptions || {}; | ||
tsConfig.angularCompilerOptions.enableIvy = false; | ||
appTree.overwrite( | ||
'./projects/bar/tsconfig.app.json', | ||
JSON.stringify(tsConfig) | ||
); | ||
}); | ||
it('should create and export a reducer as a function', async () => { | ||
const tree = await schematicRunner | ||
.runSchematicAsync('reducer', defaultOptions, appTree) | ||
.toPromise(); | ||
const fileContent = tree.readContent( | ||
`${projectPath}/src/app/foo.reducer.ts` | ||
); | ||
expect(fileContent).toMatch( | ||
/export function reducer\(state: State | undefined, action: Action\) {/ | ||
); | ||
expect(fileContent).toMatch(/const fooReducer = createReducer\(/); | ||
expect(fileContent).toMatch(/export function reducer/); | ||
}); | ||
}); | ||
describe('Ivy', () => { | ||
@@ -286,0 +252,0 @@ it('should create and export a reducer', async () => { |
@@ -14,3 +14,3 @@ import { | ||
xdescribe('Feature Schematic', () => { | ||
describe('Feature Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -17,0 +17,0 @@ '@ngrx/schematics', |
@@ -9,3 +9,3 @@ import { | ||
xdescribe('ng-add Schematic', () => { | ||
describe('ng-add Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -12,0 +12,0 @@ '@ngrx/schematics', |
@@ -8,3 +8,3 @@ import { | ||
xdescribe('NgrxPush migration', () => { | ||
describe('NgrxPush migration', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -11,0 +11,0 @@ '@ngrx/schematics', |
@@ -29,4 +29,3 @@ "use strict"; | ||
return schematics_core_1.stringUtils.group(options.flat ? '' : s, options.group ? 'reducers' : ''); | ||
}, isIvyEnabled: (0, schematics_core_1.isIvyEnabled)(host, 'tsconfig.json') && | ||
(0, schematics_core_1.isIvyEnabled)(host, projectConfig.root + "/tsconfig.app.json") }), options); | ||
} }), options); | ||
var commonTemplate = (0, schematics_1.apply)((0, schematics_1.url)('./common-files'), [ | ||
@@ -33,0 +32,0 @@ options.skipTests |
@@ -15,3 +15,3 @@ import { | ||
xdescribe('Reducer Schematic', () => { | ||
describe('Reducer Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -91,89 +91,2 @@ '@ngrx/schematics', | ||
describe('View engine', () => { | ||
beforeEach(() => { | ||
// remove the first line comment from the json file | ||
const json = appTree | ||
.readContent('./projects/bar/tsconfig.app.json') | ||
.split('\n') | ||
.slice(1) | ||
.join('\n'); | ||
const tsConfig = JSON.parse(json); | ||
tsConfig.angularCompilerOptions = tsConfig.angularCompilerOptions || {}; | ||
tsConfig.angularCompilerOptions.enableIvy = false; | ||
appTree.overwrite( | ||
'./projects/bar/tsconfig.app.json', | ||
JSON.stringify(tsConfig) | ||
); | ||
}); | ||
it('should create an reducer function', async () => { | ||
const tree = await schematicRunner | ||
.runSchematicAsync('reducer', defaultOptions, appTree) | ||
.toPromise(); | ||
const fileContent = tree.readContent( | ||
`${projectPath}/src/app/foo.reducer.ts` | ||
); | ||
expect(fileContent).toMatch(/export function reducer/); | ||
}); | ||
it('should create an reducer function using createReducer', async () => { | ||
const tree = await schematicRunner | ||
.runSchematicAsync('reducer', defaultOptions, appTree) | ||
.toPromise(); | ||
const fileContent = tree.readContent( | ||
`${projectPath}/src/app/foo.reducer.ts` | ||
); | ||
expect(fileContent).toMatch( | ||
/export function reducer\(state: State | undefined, action: Action\) {/ | ||
); | ||
expect(fileContent).toMatch(/const fooReducer = createReducer\(/); | ||
}); | ||
it('should create an reducer function in a feature using createReducer', async () => { | ||
const tree = await schematicRunner | ||
.runSchematicAsync( | ||
'reducer', | ||
{ ...defaultOptions, feature: true }, | ||
appTree | ||
) | ||
.toPromise(); | ||
const fileContent = tree.readContent( | ||
`${projectPath}/src/app/foo.reducer.ts` | ||
); | ||
expect(fileContent).toMatch( | ||
/export function reducer\(state: State | undefined, action: Action\) {/ | ||
); | ||
expect(fileContent).toMatch(/const fooReducer = createReducer\(/); | ||
expect(fileContent).toMatch(/on\(FooActions.loadFoos, state => state\)/); | ||
}); | ||
it('should create an reducer function in an api feature using createReducer', async () => { | ||
const tree = await schematicRunner | ||
.runSchematicAsync( | ||
'reducer', | ||
{ ...defaultOptions, feature: true, api: true }, | ||
appTree | ||
) | ||
.toPromise(); | ||
const fileContent = tree.readContent( | ||
`${projectPath}/src/app/foo.reducer.ts` | ||
); | ||
expect(fileContent).toMatch( | ||
/export function reducer\(state: State | undefined, action: Action\) {/ | ||
); | ||
expect(fileContent).toMatch(/const fooReducer = createReducer\(/); | ||
expect(fileContent).toMatch( | ||
/on\(FooActions.loadFoosSuccess, \(state, action\) => state\)/ | ||
); | ||
expect(fileContent).toMatch( | ||
/on\(FooActions.loadFoosFailure, \(state, action\) => state\)/ | ||
); | ||
}); | ||
}); | ||
describe('Ivy', () => { | ||
@@ -180,0 +93,0 @@ it('should create and export a reducer', async () => { |
@@ -13,3 +13,3 @@ import { tags } from '@angular-devkit/core'; | ||
xdescribe('Selector Schematic', () => { | ||
describe('Selector Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -16,0 +16,0 @@ '@ngrx/schematics', |
@@ -14,3 +14,3 @@ import { | ||
xdescribe('Store Schematic', () => { | ||
describe('Store Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
@@ -17,0 +17,0 @@ '@ngrx/schematics', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
485193
149
6536