feat(module-federation): add module federation package (#12961)
This commit is contained in:
parent
ed33d17f8f
commit
377e3bd605
@ -27,6 +27,10 @@ module.exports = {
|
|||||||
{ name: 'js', description: 'anything TS->JS specific' },
|
{ name: 'js', description: 'anything TS->JS specific' },
|
||||||
{ name: 'linter', description: 'anything Linter specific' },
|
{ name: 'linter', description: 'anything Linter specific' },
|
||||||
{ name: 'misc', description: 'misc stuff' },
|
{ name: 'misc', description: 'misc stuff' },
|
||||||
|
{
|
||||||
|
name: 'module-federation',
|
||||||
|
description: 'anything related to the Module Federation package',
|
||||||
|
},
|
||||||
{ name: 'nest', description: 'anything Nest specific' },
|
{ name: 'nest', description: 'anything Nest specific' },
|
||||||
{ name: 'nextjs', description: 'anything Next specific' },
|
{ name: 'nextjs', description: 'anything Next specific' },
|
||||||
{ name: 'node', description: 'anything Node specific' },
|
{ name: 'node', description: 'anything Node specific' },
|
||||||
|
|||||||
11
docs/generated/packages/module-federation.json
Normal file
11
docs/generated/packages/module-federation.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||||
|
"name": "module-federation",
|
||||||
|
"packageName": "@nrwl/module-federation",
|
||||||
|
"description": "The Module Federation plugin for Nx contains a Webpack Plugin and helpers to enable Module Federation for your Angular and React apps in your Nx Workspace. ",
|
||||||
|
"root": "/packages/module-federation",
|
||||||
|
"source": "/packages/module-federation/src",
|
||||||
|
"documentation": [],
|
||||||
|
"generators": [],
|
||||||
|
"executors": []
|
||||||
|
}
|
||||||
@ -198,6 +198,13 @@
|
|||||||
"path": "generated/packages/make-angular-cli-faster.json",
|
"path": "generated/packages/make-angular-cli-faster.json",
|
||||||
"schemas": { "executors": [], "generators": [] }
|
"schemas": { "executors": [], "generators": [] }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "module-federation",
|
||||||
|
"packageName": "module-federation",
|
||||||
|
"description": "The Module Federation plugin for Nx contains a Webpack Plugin and helpers to enable Module Federation for your Angular and React apps in your Nx Workspace. ",
|
||||||
|
"path": "generated/packages/module-federation.json",
|
||||||
|
"schemas": { "executors": [], "generators": [] }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nest",
|
"name": "nest",
|
||||||
"packageName": "nest",
|
"packageName": "nest",
|
||||||
|
|||||||
14
packages/module-federation/.eslintrc.json
Normal file
14
packages/module-federation/.eslintrc.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../.eslintrc",
|
||||||
|
"rules": {},
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["./package.json"],
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"rules": {
|
||||||
|
"@nrwl/nx/nx-plugin-checks": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
13
packages/module-federation/README.md
Normal file
13
packages/module-federation/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
|
||||||
|
|
||||||
|
{{links}}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
# Nx: Smart, Fast and Extensible Build System
|
||||||
|
|
||||||
|
Nx is a next generation build system with first class monorepo support and powerful integrations.
|
||||||
|
|
||||||
|
This package is a [Module Federation plugin for Nx](https://nx.dev/module-federation/overview).
|
||||||
|
|
||||||
|
{{content}}
|
||||||
0
packages/module-federation/index.ts
Normal file
0
packages/module-federation/index.ts
Normal file
11
packages/module-federation/jest.config.ts
Normal file
11
packages/module-federation/jest.config.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
export default {
|
||||||
|
transform: {
|
||||||
|
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||||
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||||
|
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } },
|
||||||
|
displayName: 'module-federation',
|
||||||
|
testEnvironment: 'node',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
};
|
||||||
4
packages/module-federation/migrations.json
Normal file
4
packages/module-federation/migrations.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"generators": {},
|
||||||
|
"packageJsonUpdates": {}
|
||||||
|
}
|
||||||
19
packages/module-federation/migrations.spec.ts
Normal file
19
packages/module-federation/migrations.spec.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import path = require('path');
|
||||||
|
import json = require('./migrations.json');
|
||||||
|
|
||||||
|
type MigrationGenerator = {
|
||||||
|
cli: string;
|
||||||
|
version: string;
|
||||||
|
description: string;
|
||||||
|
factory: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('Module Federation migrations', () => {
|
||||||
|
it('should have valid paths', () => {
|
||||||
|
Object.values<MigrationGenerator>(json.generators).forEach((m) => {
|
||||||
|
expect(() =>
|
||||||
|
require.resolve(path.join(__dirname, `${m.factory}.ts`))
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
34
packages/module-federation/package.json
Normal file
34
packages/module-federation/package.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "@nrwl/module-federation",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"description": "The Module Federation plugin for Nx contains a Webpack Plugin and helpers to enable Module Federation for your Angular and React apps in your Nx Workspace. ",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nrwl/nx.git",
|
||||||
|
"directory": "packages/module-federation"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Monorepo",
|
||||||
|
"Web",
|
||||||
|
"Node",
|
||||||
|
"Webpack",
|
||||||
|
"Module Federation",
|
||||||
|
"CLI"
|
||||||
|
],
|
||||||
|
"main": "src/index.js",
|
||||||
|
"typings": "src/index.d.ts",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/nrwl/nx/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://nx.dev",
|
||||||
|
"ng-update": {
|
||||||
|
"requirements": {},
|
||||||
|
"migrations": "./migrations.json"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
78
packages/module-federation/project.json
Normal file
78
packages/module-federation/project.json
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "packages/module-federation/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"targets": {
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nrwl/linter:eslint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": [
|
||||||
|
"packages/module-federation/**/*.ts",
|
||||||
|
"packages/module-federation/package.json",
|
||||||
|
"packages/module-federation/migrations.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nrwl/jest:jest",
|
||||||
|
"outputs": ["{workspaceRoot}/coverage/module-federation"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "packages/module-federation/jest.config.ts",
|
||||||
|
"passWithNoTests": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build-base": {
|
||||||
|
"executor": "@nrwl/js:tsc",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "build/packages/module-federation",
|
||||||
|
"tsConfig": "packages/module-federation/tsconfig.lib.json",
|
||||||
|
"main": "packages/module-federation/index.ts",
|
||||||
|
"updateBuildableProjectDepsInPackageJson": false,
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"input": "packages/module-federation",
|
||||||
|
"glob": "**/files/**",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "packages/module-federation",
|
||||||
|
"glob": "**/files/**/.gitkeep",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "packages/module-federation",
|
||||||
|
"glob": "**/*.json",
|
||||||
|
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "packages/module-federation",
|
||||||
|
"glob": "**/*.js",
|
||||||
|
"ignore": ["**/jest.config.js"],
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "packages/module-federation",
|
||||||
|
"glob": "**/*.d.ts",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "",
|
||||||
|
"glob": "LICENSE",
|
||||||
|
"output": "/"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"outputs": ["{options.outputPath}"]
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"outputs": ["{workspaceRoot}/build/packages/module-federation"],
|
||||||
|
"options": {
|
||||||
|
"command": "node ./scripts/copy-readme.js module-federation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
}
|
||||||
13
packages/module-federation/tsconfig.json
Normal file
13
packages/module-federation/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
11
packages/module-federation/tsconfig.lib.json
Normal file
11
packages/module-federation/tsconfig.lib.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"declaration": true,
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
|
||||||
|
"include": ["**/*.ts"]
|
||||||
|
}
|
||||||
20
packages/module-federation/tsconfig.spec.json
Normal file
20
packages/module-federation/tsconfig.spec.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.spec.tsx",
|
||||||
|
"**/*.test.tsx",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.spec.jsx",
|
||||||
|
"**/*.test.jsx",
|
||||||
|
"**/*.d.ts",
|
||||||
|
"jest.config.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -36,6 +36,7 @@
|
|||||||
"@nrwl/js": ["packages/js/src"],
|
"@nrwl/js": ["packages/js/src"],
|
||||||
"@nrwl/js/*": ["packages/js/*"],
|
"@nrwl/js/*": ["packages/js/*"],
|
||||||
"@nrwl/linter": ["packages/linter"],
|
"@nrwl/linter": ["packages/linter"],
|
||||||
|
"@nrwl/module-federation": ["packages/module-federation"],
|
||||||
"@nrwl/nest": ["packages/nest"],
|
"@nrwl/nest": ["packages/nest"],
|
||||||
"@nrwl/next": ["packages/next"],
|
"@nrwl/next": ["packages/next"],
|
||||||
"@nrwl/node": ["packages/node"],
|
"@nrwl/node": ["packages/node"],
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
"js": "packages/js",
|
"js": "packages/js",
|
||||||
"linter": "packages/linter",
|
"linter": "packages/linter",
|
||||||
"make-angular-cli-faster": "packages/make-angular-cli-faster",
|
"make-angular-cli-faster": "packages/make-angular-cli-faster",
|
||||||
|
"module-federation": "packages/module-federation",
|
||||||
"nest": "packages/nest",
|
"nest": "packages/nest",
|
||||||
"next": "packages/next",
|
"next": "packages/next",
|
||||||
"node": "packages/node",
|
"node": "packages/node",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user