Skip to content

Commit

Permalink
feat(data): add schematics and migrations (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored and brandonroberts committed Apr 23, 2019
1 parent 1bf5870 commit c79362d
Show file tree
Hide file tree
Showing 25 changed files with 2,520 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ng_package(
],
entry_point = "modules/data/index.js",
packages = [
"//modules/data/migrations:npm_package",
"//modules/data/schematics:npm_package",
"//modules/data/schematics-core:npm_package",
],
deps = [
":data",
Expand Down
31 changes: 31 additions & 0 deletions modules/data/migrations/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "npm_package", "ts_library")

ts_library(
name = "migrations",
srcs = glob(
[
"**/*.ts",
],
exclude = [
"**/testing/*.ts",
"**/*.spec.ts",
],
),
module_name = "@ngrx/data/migrations",
deps = [
"//modules/data/schematics-core",
"@npm//@angular-devkit/schematics",
],
)

npm_package(
name = "npm_package",
srcs = [
":migration.json",
],
deps = [
":migrations",
],
)
5 changes: 5 additions & 0 deletions modules/data/migrations/migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema":
"../../../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {}
}
4 changes: 4 additions & 0 deletions modules/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
"rxjs": "RXJS_VERSION"
},
"schematics": "MODULE_SCHEMATICS_COLLECTION",
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP",
"migrations": "NG_UPDATE_MIGRATIONS"
},
"sideEffects": false
}
29 changes: 29 additions & 0 deletions modules/data/schematics-core/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "npm_package", "ts_library")

ts_library(
name = "schematics-core",
srcs = glob(
[
"**/*.ts",
],
exclude = [
"**/testing/**/*.ts",
"**/*spec.ts",
],
),
module_name = "@ngrx/data/schematics-core",
deps = [
"@npm//@angular-devkit/schematics",
"@npm//typescript",
],
)

npm_package(
name = "npm_package",
srcs = [],
deps = [
":schematics-core",
],
)
73 changes: 73 additions & 0 deletions modules/data/schematics-core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import {
dasherize,
decamelize,
camelize,
classify,
underscore,
group,
capitalize,
featurePath,
} from './utility/strings';

export {
findNodes,
getSourceNodes,
getDecoratorMetadata,
getContentOfKeyLiteral,
insertAfterLastOccurrence,
insertImport,
addBootstrapToModule,
addDeclarationToModule,
addExportToModule,
addImportToModule,
addProviderToModule,
} from './utility/ast-utils';

export {
Host,
Change,
NoopChange,
InsertChange,
RemoveChange,
ReplaceChange,
createReplaceChange,
createChangeRecorder,
} from './utility/change';

export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config';

export {
findModule,
findModuleFromOptions,
buildRelativePath,
ModuleOptions,
} from './utility/find-module';

export {
addReducerToState,
addReducerToStateInterface,
addReducerImportToNgModule,
addReducerToActionReducerMap,
omit,
} from './utility/ngrx-utils';

export { getProjectPath, getProject, isLib } from './utility/project';

export const stringUtils = {
dasherize,
decamelize,
camelize,
classify,
underscore,
group,
capitalize,
featurePath,
};

export { updatePackage } from './utility/update';

export { parseName } from './utility/parse-name';

export { addPackageToPackageJson } from './utility/package';

export { platformVersion } from './utility/libs-version';
Loading

0 comments on commit c79362d

Please sign in to comment.