Skip to content

Commit

Permalink
chore: update to nx 13 (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli authored Oct 22, 2021
1 parent 5a5d0de commit 2cb1815
Show file tree
Hide file tree
Showing 26 changed files with 1,651 additions and 1,966 deletions.
31 changes: 31 additions & 0 deletions apps/vscode-ui-feature-task-execution-form-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"root": "apps/vscode-ui-feature-task-execution-form-e2e",
"sourceRoot": "apps/vscode-ui-feature-task-execution-form-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/vscode-ui-feature-task-execution-form-e2e/cypress.json",
"tsConfig": "apps/vscode-ui-feature-task-execution-form-e2e/tsconfig.e2e.json",
"devServerTarget": "vscode-ui-feature-task-execution-form:storybook"
},
"configurations": {
"production": {
"devServerTarget": "vscode-ui-feature-task-execution-form:serve:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/vscode-ui-feature-task-execution-form-e2e/src/**/*.ts",
"apps/vscode-ui-feature-task-execution-form-e2e/src/**/*.html"
]
}
}
},
"tags": [],
"implicitDependencies": ["vscode-ui-feature-task-execution-form"]
}
84 changes: 84 additions & 0 deletions apps/vscode-ui/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"projectType": "application",
"generators": {
"@nrwl/workspace:component": {
"style": "scss"
}
},
"root": "apps/vscode-ui",
"sourceRoot": "apps/vscode-ui/src",
"targets": {
"build": {
"executor": "ngx-build-plus:browser",
"options": {
"extraWebpackConfig": "apps/vscode-ui/webpack.dev.js",
"outputPath": "dist/apps/vscode/assets/public",
"index": "apps/vscode-ui/src/index.html",
"main": "apps/vscode-ui/src/main.ts",
"tsConfig": "apps/vscode-ui/tsconfig.app.json",
"assets": [
"apps/vscode-ui/src/favicon.ico",
"apps/vscode-ui/src/assets"
],
"styles": ["apps/vscode-ui/src/styles.scss"],
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"stylePreprocessorOptions": {
"includePaths": ["libs/vscode-ui/styles/src/lib"]
},
"allowedCommonJsDependencies": ["zone.js"]
},
"configurations": {
"production": {
"sourceMap": false,
"aot": true,
"optimization": true,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "apps/vscode-ui/src/environments/environment.ts",
"with": "apps/vscode-ui/src/environments/environment.prod.ts"
}
]
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "vscode-ui:build"
},
"configurations": {
"production": {
"browserTarget": "vscode-ui:build:production"
}
}
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "vscode-ui:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/vscode-ui/src/**/*.ts",
"apps/vscode-ui/src/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/vscode-ui/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/apps/vscode-ui"]
}
},
"tags": []
}
58 changes: 58 additions & 0 deletions apps/vscode/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"root": "apps/vscode",
"sourceRoot": "apps/vscode/src",
"projectType": "application",
"prefix": "vscode",
"generators": {},
"targets": {
"build": {
"executor": "@nrwl/node:build",
"options": {
"externalDependencies": ["vscode", "tslint"],
"webpackConfig": "apps/vscode/webpack.config.js",
"outputPath": "dist/apps/vscode",
"main": "apps/vscode/src/main.ts",
"tsConfig": "apps/vscode/tsconfig.app.json",
"assets": [
"apps/vscode/src/package.json",
"apps/vscode/src/tree-view-icon.svg",
"apps/vscode/src/assets",
"apps/vscode/src/getting-started",
{
"glob": "README.md",
"input": "./",
"output": "/"
},
{
"glob": "CHANGELOG.md",
"input": "./",
"output": "/"
}
],
"buildLibsFromSource": true
},
"configurations": {
"production": {
"sourceMap": false,
"optimization": true,
"extractLicenses": true,
"fileReplacements": [
{
"replace": "apps/vscode/src/environments/environment.ts",
"with": "apps/vscode/src/environments/environment.prod.ts"
}
],
"webpackConfig": "apps/vscode/webpack.prod.config.js"
}
},
"outputs": ["{options.outputPath}"]
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/vscode/**/*.ts"]
}
}
},
"tags": []
}
25 changes: 25 additions & 0 deletions libs/schema/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": "libs/schema",
"sourceRoot": "libs/schema/src",
"projectType": "library",
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["libs/schema/**/*.ts"]
}
},
"build": {
"executor": "@nrwl/node:package",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/schema",
"tsConfig": "libs/schema/tsconfig.lib.json",
"packageJson": "libs/schema/package.json",
"main": "libs/schema/src/index.ts",
"assets": ["libs/schema/*.md"]
}
}
},
"tags": []
}
27 changes: 27 additions & 0 deletions libs/server/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"root": "libs/server",
"sourceRoot": "libs/server/src",
"projectType": "library",
"targets": {
"test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/server/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/libs/server"]
},
"build": {
"executor": "@nrwl/node:package",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/server",
"tsConfig": "libs/server/tsconfig.lib.json",
"packageJson": "libs/server/package.json",
"main": "libs/server/src/index.ts",
"assets": ["libs/server/*.md"]
}
}
},
"tags": []
}
1 change: 0 additions & 1 deletion libs/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export {
readAndCacheJsonFile,
cacheJson,
clearJsonCache,
toLegacyWorkspaceFormat,
toWorkspaceFormat,
listOfUnnestedNpmPackages,
} from './lib/utils/utils';
Expand Down
5 changes: 3 additions & 2 deletions libs/server/src/lib/utils/read-generator-collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
listOfUnnestedNpmPackages,
normalizeSchema,
readAndCacheJsonFile,
toLegacyWorkspaceFormat,
toWorkspaceFormat,
} from './utils';

Expand Down Expand Up @@ -55,9 +54,11 @@ async function checkAndReadWorkspaceCollection(
}

function readWorkspaceJsonDefaults(workspaceJsonPath: string): any {
// TODO(Cammisuli): Change this to use getNxConfig to support nx 13
const defaults =
toWorkspaceFormat(readAndCacheJsonFile(workspaceJsonPath).json)
(toWorkspaceFormat(readAndCacheJsonFile(workspaceJsonPath).json) as any)
.generators || {};

const collectionDefaults = Object.keys(defaults).reduce(
(collectionDefaultsMap: any, key) => {
if (key.includes(':')) {
Expand Down
21 changes: 0 additions & 21 deletions libs/server/src/lib/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,27 +314,6 @@ function renameProperty(obj: any, from: string, to: string) {
delete obj[from];
}

export function toLegacyWorkspaceFormat(w: WorkspaceJsonConfiguration) {
Object.values(w.projects || {}).forEach((project: any) => {
if (project.targets) {
renameProperty(project, 'targets', 'architect');
}
if (project.generators) {
renameProperty(project, 'generators', 'schematics');
}
Object.values(project.architect || {}).forEach((target: any) => {
if (target.executor) {
renameProperty(target, 'executor', 'builder');
}
});
});

if (w.generators) {
renameProperty(w, 'generators', 'schematics');
}
return w;
}

export function toWorkspaceFormat(w: any): WorkspaceJsonConfiguration {
Object.values(w.projects || {}).forEach((project: any) => {
if (project.architect) {
Expand Down
26 changes: 26 additions & 0 deletions libs/vscode-ui/argument-list/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"projectType": "library",
"root": "libs/vscode-ui/argument-list",
"sourceRoot": "libs/vscode-ui/argument-list/src",
"prefix": "nx-console",
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/vscode-ui/argument-list/src/**/*.ts",
"libs/vscode-ui/argument-list/src/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/vscode-ui/argument-list"],
"options": {
"jestConfig": "libs/vscode-ui/argument-list/jest.config.js",
"passWithNoTests": true
}
}
},
"tags": []
}
25 changes: 25 additions & 0 deletions libs/vscode-ui/components/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"projectType": "library",
"root": "libs/vscode-ui/components",
"sourceRoot": "libs/vscode-ui/components/src",
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/vscode-ui/components/src/**/*.ts",
"libs/vscode-ui/components/src/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/vscode-ui/components/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/libs/vscode-ui/components"]
}
},
"tags": []
}
57 changes: 57 additions & 0 deletions libs/vscode-ui/feature-task-execution-form/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"projectType": "library",
"root": "libs/vscode-ui/feature-task-execution-form",
"sourceRoot": "libs/vscode-ui/feature-task-execution-form/src",
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/vscode-ui/feature-task-execution-form/src/**/*.ts",
"libs/vscode-ui/feature-task-execution-form/src/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/vscode-ui/feature-task-execution-form/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/libs/vscode-ui/feature-task-execution-form"]
},
"storybook": {
"executor": "@nrwl/storybook:storybook",
"options": {
"uiFramework": "@storybook/angular",
"port": 4400,
"config": {
"configFolder": "libs/vscode-ui/feature-task-execution-form/.storybook"
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"build-storybook": {
"executor": "@nrwl/storybook:build",
"options": {
"uiFramework": "@storybook/angular",
"outputPath": "dist/storybook/vscode-ui-feature-task-execution-form",
"config": {
"configFolder": "libs/vscode-ui/feature-task-execution-form/.storybook"
}
},
"configurations": {
"ci": {
"quiet": true
}
},
"outputs": ["{options.outputPath}"]
}
},
"generators": {},
"tags": []
}
Loading

0 comments on commit 2cb1815

Please sign in to comment.