-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module-federation): add module federation package (nrwl#12961)
- Loading branch information
Showing
16 changed files
with
241 additions
and
0 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
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,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": [] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "../../.eslintrc", | ||
"rules": {}, | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["./package.json"], | ||
"parser": "jsonc-eslint-parser", | ||
"rules": { | ||
"@nrwl/nx/nx-plugin-checks": "error" | ||
} | ||
} | ||
] | ||
} |
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,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}} |
Empty file.
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,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', | ||
}; |
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,4 @@ | ||
{ | ||
"generators": {}, | ||
"packageJsonUpdates": {} | ||
} |
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 @@ | ||
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(); | ||
}); | ||
}); | ||
}); |
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,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" | ||
} | ||
} |
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,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": [] | ||
} |
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,13 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
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,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"] | ||
} |
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,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" | ||
] | ||
} |
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