-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47eda1e
commit 291d35f
Showing
15 changed files
with
13,297 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.activeBackground": "#bfc3d8", | ||
"activityBar.activeBorder": "#ab747d", | ||
"activityBar.background": "#bfc3d8", | ||
"activityBar.foreground": "#15202b", | ||
"activityBar.inactiveForeground": "#15202b99", | ||
"activityBarBadge.background": "#ab747d", | ||
"activityBarBadge.foreground": "#15202b", | ||
"statusBar.background": "#9fa6c5", | ||
"statusBar.foreground": "#15202b", | ||
"statusBarItem.hoverBackground": "#7f89b2", | ||
"titleBar.activeBackground": "#9fa6c5", | ||
"titleBar.activeForeground": "#15202b", | ||
"titleBar.inactiveBackground": "#9fa6c599", | ||
"titleBar.inactiveForeground": "#15202b99" | ||
}, | ||
"peacock.color": "#9fa6c5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,26 @@ | ||
import { | ||
checkFilesExist, | ||
ensureNxProject, | ||
readJson, | ||
runNxCommandAsync, | ||
uniq, | ||
} from '@nrwl/nx-plugin/testing'; | ||
|
||
import * as fs from 'fs'; | ||
import { angularJson } from './test-files'; | ||
|
||
describe('mf e2e', () => { | ||
it('should create mf', async (done) => { | ||
const plugin = uniq('mf'); | ||
ensureNxProject('@angular-architects/mf', 'dist/packages/mf'); | ||
await runNxCommandAsync(`generate @angular-architects/mf:mf ${plugin}`); | ||
ensureNxProject('@angular-architects/module-federation', 'dist/packages/mf'); | ||
|
||
fs.unlinkSync('tmp/nx-e2e/proj/workspace.json'); | ||
fs.writeFileSync('tmp/nx-e2e/proj/angular.json', angularJson); | ||
fs.mkdirSync('tmp/nx-e2e/proj/apps/shell'); | ||
|
||
const result = await runNxCommandAsync(`build ${plugin}`); | ||
expect(result.stdout).toContain('Builder ran'); | ||
await runNxCommandAsync(`generate @angular-architects/module-federation:init shell 5000`); | ||
|
||
done(); | ||
}); | ||
expect(fs.existsSync('tmp/nx-e2e/proj/apps/shell/webpack.config.js')).toBeTruthy(); | ||
expect(fs.existsSync('tmp/nx-e2e/proj/apps/shell/webpack.prod.config.js')).toBeTruthy(); | ||
|
||
describe('--directory', () => { | ||
it('should create src in the specified directory', async (done) => { | ||
const plugin = uniq('mf'); | ||
ensureNxProject('@angular-architects/mf', 'dist/packages/mf'); | ||
await runNxCommandAsync( | ||
`generate @angular-architects/mf:mf ${plugin} --directory subdir` | ||
); | ||
expect(() => | ||
checkFilesExist(`libs/subdir/${plugin}/src/index.ts`) | ||
).not.toThrow(); | ||
done(); | ||
}); | ||
}); | ||
done(); | ||
}, 90000); | ||
|
||
describe('--tags', () => { | ||
it('should add tags to nx.json', async (done) => { | ||
const plugin = uniq('mf'); | ||
ensureNxProject('@angular-architects/mf', 'dist/packages/mf'); | ||
await runNxCommandAsync( | ||
`generate @angular-architects/mf:mf ${plugin} --tags e2etag,e2ePackage` | ||
); | ||
const nxJson = readJson('nx.json'); | ||
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']); | ||
done(); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,241 @@ | ||
export const angularJson = ` | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"mfe1": { | ||
"projectType": "application", | ||
"schematics": {}, | ||
"root": "apps/mfe1", | ||
"sourceRoot": "apps/mfe1/src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "", | ||
"options": { | ||
"outputPath": "dist/mfe1", | ||
"index": "apps/mfe1/src/index.html", | ||
"main": "apps/mfe1/src/main.ts", | ||
"polyfills": "apps/mfe1/src/polyfills.ts", | ||
"tsConfig": "apps/mfe1/tsconfig.app.json", | ||
"aot": true, | ||
"assets": [ | ||
"apps/mfe1/src/favicon.ico", | ||
"apps/mfe1/src/assets" | ||
], | ||
"styles": [], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "apps/mfe1/src/environments/environment.ts", | ||
"with": "apps/mfe1/src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true, | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "2mb", | ||
"maximumError": "5mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "6kb", | ||
"maximumError": "10kb" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"builder": "", | ||
"options": { | ||
"browserTarget": "mfe1:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "mfe1:build:production" | ||
} | ||
} | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "mfe1:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "", | ||
"options": { | ||
"main": "apps/mfe1/src/test.ts", | ||
"polyfills": "apps/mfe1/src/polyfills.ts", | ||
"tsConfig": "apps/mfe1/tsconfig.spec.json", | ||
"karmaConfig": "apps/mfe1/karma.conf.js", | ||
"assets": [ | ||
"apps/mfe1/src/favicon.ico", | ||
"apps/mfe1/src/assets" | ||
], | ||
"styles": [ | ||
"apps/mfe1/src/styles.css" | ||
], | ||
"scripts": [] | ||
} | ||
}, | ||
"lint": { | ||
"builder": "@angular-devkit/build-angular:tslint", | ||
"options": { | ||
"tsConfig": [ | ||
"apps/mfe1/tsconfig.app.json", | ||
"apps/mfe1/tsconfig.spec.json", | ||
"apps/mfe1/e2e/tsconfig.json" | ||
], | ||
"exclude": [ | ||
"**/node_modules/**" | ||
] | ||
} | ||
}, | ||
"e2e": { | ||
"builder": "@angular-devkit/build-angular:protractor", | ||
"options": { | ||
"protractorConfig": "apps/mfe1/e2e/protractor.conf.js", | ||
"devServerTarget": "mfe1:serve" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"devServerTarget": "mfe1:serve:production" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"shell": { | ||
"projectType": "application", | ||
"schematics": {}, | ||
"root": "apps/shell", | ||
"sourceRoot": "apps/shell/src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "", | ||
"options": { | ||
"outputPath": "dist/shell", | ||
"index": "apps/shell/src/index.html", | ||
"main": "apps/shell/src/main.ts", | ||
"polyfills": "apps/shell/src/polyfills.ts", | ||
"tsConfig": "apps/shell/tsconfig.app.json", | ||
"aot": true, | ||
"assets": [ | ||
"apps/shell/src/favicon.ico", | ||
"apps/shell/src/assets" | ||
], | ||
"styles": [], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "apps/shell/src/environments/environment.ts", | ||
"with": "apps/shell/src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true, | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "2mb", | ||
"maximumError": "5mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "6kb", | ||
"maximumError": "10kb" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"builder": "", | ||
"options": { | ||
"browserTarget": "shell:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "shell:build:production" | ||
} | ||
} | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "shell:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "", | ||
"options": { | ||
"main": "apps/shell/src/test.ts", | ||
"polyfills": "apps/shell/src/polyfills.ts", | ||
"tsConfig": "apps/shell/tsconfig.spec.json", | ||
"karmaConfig": "apps/shell/karma.conf.js", | ||
"assets": [ | ||
"apps/shell/src/favicon.ico", | ||
"apps/shell/src/assets" | ||
], | ||
"styles": [], | ||
"scripts": [] | ||
} | ||
}, | ||
"lint": { | ||
"builder": "@angular-devkit/build-angular:tslint", | ||
"options": { | ||
"tsConfig": [ | ||
"apps/shell/tsconfig.app.json", | ||
"apps/shell/tsconfig.spec.json", | ||
"apps/shell/e2e/tsconfig.json" | ||
], | ||
"exclude": [ | ||
"**/node_modules/**" | ||
] | ||
} | ||
}, | ||
"e2e": { | ||
"builder": "@angular-devkit/build-angular:protractor", | ||
"options": { | ||
"protractorConfig": "apps/shell/e2e/protractor.conf.js", | ||
"devServerTarget": "shell:serve" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"devServerTarget": "shell:serve:production" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defaultProject": "mfe1", | ||
"cli": { | ||
"packageManager": "yarn" | ||
} | ||
} | ||
` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.