@appshell/webpack-plugin 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +311 -0
- package/dist/main.js +14 -0
- package/dist/main.js.LICENSE.txt +39 -0
- package/dist/types/config/src/axios.d.ts +3 -0
- package/dist/types/config/src/axios.d.ts.map +1 -0
- package/dist/types/config/src/configmap.d.ts +7 -0
- package/dist/types/config/src/configmap.d.ts.map +1 -0
- package/dist/types/config/src/deregister.d.ts +3 -0
- package/dist/types/config/src/deregister.d.ts.map +1 -0
- package/dist/types/config/src/generate.env.d.ts +3 -0
- package/dist/types/config/src/generate.env.d.ts.map +1 -0
- package/dist/types/config/src/generate.global-config.d.ts +10 -0
- package/dist/types/config/src/generate.global-config.d.ts.map +1 -0
- package/dist/types/config/src/generate.manifest.d.ts +8 -0
- package/dist/types/config/src/generate.manifest.d.ts.map +1 -0
- package/dist/types/config/src/index.d.ts +17 -0
- package/dist/types/config/src/index.d.ts.map +1 -0
- package/dist/types/config/src/mappers/appshell.config.d.ts +3 -0
- package/dist/types/config/src/mappers/appshell.config.d.ts.map +1 -0
- package/dist/types/config/src/outdated.d.ts +4 -0
- package/dist/types/config/src/outdated.d.ts.map +1 -0
- package/dist/types/config/src/publish.d.ts +26 -0
- package/dist/types/config/src/publish.d.ts.map +1 -0
- package/dist/types/config/src/register.d.ts +4 -0
- package/dist/types/config/src/register.d.ts.map +1 -0
- package/dist/types/config/src/sync.d.ts +21 -0
- package/dist/types/config/src/sync.d.ts.map +1 -0
- package/dist/types/config/src/types.d.ts +296 -0
- package/dist/types/config/src/types.d.ts.map +1 -0
- package/dist/types/config/src/utils/blur.d.ts +3 -0
- package/dist/types/config/src/utils/blur.d.ts.map +1 -0
- package/dist/types/config/src/utils/compare.d.ts +8 -0
- package/dist/types/config/src/utils/compare.d.ts.map +1 -0
- package/dist/types/config/src/utils/config.d.ts +6 -0
- package/dist/types/config/src/utils/config.d.ts.map +1 -0
- package/dist/types/config/src/utils/copy.d.ts +11 -0
- package/dist/types/config/src/utils/copy.d.ts.map +1 -0
- package/dist/types/config/src/utils/index.d.ts +10 -0
- package/dist/types/config/src/utils/index.d.ts.map +1 -0
- package/dist/types/config/src/utils/isValidUrl.d.ts +3 -0
- package/dist/types/config/src/utils/isValidUrl.d.ts.map +1 -0
- package/dist/types/config/src/utils/list.d.ts +10 -0
- package/dist/types/config/src/utils/list.d.ts.map +1 -0
- package/dist/types/config/src/utils/load.d.ts +14 -0
- package/dist/types/config/src/utils/load.d.ts.map +1 -0
- package/dist/types/config/src/utils/loadJson.d.ts +10 -0
- package/dist/types/config/src/utils/loadJson.d.ts.map +1 -0
- package/dist/types/config/src/utils/merge.d.ts +4 -0
- package/dist/types/config/src/utils/merge.d.ts.map +1 -0
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +4 -0
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +1 -0
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +4 -0
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +1 -0
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts +4 -0
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts.map +1 -0
- package/dist/types/config/src/validators/index.d.ts +4 -0
- package/dist/types/config/src/validators/index.d.ts.map +1 -0
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts +43 -0
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts.map +1 -0
- package/dist/types/webpack-plugin/src/index.d.ts +6 -0
- package/dist/types/webpack-plugin/src/index.d.ts.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../../../config/src/utils/load.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,cAAc,MAAM,KAAG,OAU3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,MAAM,EAAE,KAAG,OAAO,EAAqC,CAAC;AAEnG,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type LoadJsonOptions = {
|
|
2
|
+
insecure: boolean;
|
|
3
|
+
target: string | RegExp;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
apiKeyHeader?: string;
|
|
6
|
+
proxyUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: <T = Record<string, unknown>>(jsonPathOrUrl: string, options?: LoadJsonOptions) => Promise<T[]>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=loadJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadJson.d.ts","sourceRoot":"","sources":["../../../../../../config/src/utils/loadJson.ts"],"names":[],"mappings":"AAOA,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;yBAsDoB,CAAC,2CACN,MAAM,YACZ,eAAe,KAOvB,OAAO,CAAC,CAAC,EAAE,CAAC;AATf,wBAqBE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../../../config/src/utils/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;yBAU3B,OAAO,aAAa,eAAe,gBAAgB,OAAO,EAAE;AAA5E,wBAiBE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppshellGlobalConfigValidator.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/AppshellGlobalConfigValidator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,eAAe,EAAE,MAAM,UAAU,CAAC;wBAO5D,eAAe;AALpB,wBAKqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppshellManifestValidator.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/AppshellManifestValidator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,eAAe,EAAgB,MAAM,UAAU,CAAC;wBA0EtE,eAAe;AAtBpB,wBAsBqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppshellTemplateValidator.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/AppshellTemplateValidator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAC;wBAyCxD,eAAe;AAlBpB,wBAkBqB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as AppshellGlobalConfigValidator } from './AppshellGlobalConfigValidator';
|
|
2
|
+
export { default as AppshellManifestValidator } from './AppshellManifestValidator';
|
|
3
|
+
export { default as AppshellTemplateValidator } from './AppshellTemplateValidator';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AppshellConfig, AppshellTemplate, ModuleFederationPluginOptions } from '@appshell/config';
|
|
2
|
+
import { Compiler, WebpackOptionsNormalized, WebpackPluginInstance } from 'webpack';
|
|
3
|
+
type AppshellPluginOptions = {
|
|
4
|
+
config?: string;
|
|
5
|
+
registry?: string;
|
|
6
|
+
environment?: string;
|
|
7
|
+
publish?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type ModuleFederationPluginInstance = WebpackPluginInstance & {
|
|
10
|
+
_options?: ModuleFederationPluginOptions;
|
|
11
|
+
options?: ModuleFederationPluginOptions;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* AppshellPlugin produces app manifests that will subsequently be
|
|
15
|
+
* compiled into the global Appshell configuration.
|
|
16
|
+
*/
|
|
17
|
+
export default class AppshellPlugin {
|
|
18
|
+
defaults: {
|
|
19
|
+
config: string;
|
|
20
|
+
};
|
|
21
|
+
options: AppshellPluginOptions;
|
|
22
|
+
constructor(options?: AppshellPluginOptions);
|
|
23
|
+
static findModuleFederationPlugin(webpackConfig: WebpackOptionsNormalized): ModuleFederationPluginInstance | undefined;
|
|
24
|
+
static createTemplate(config: AppshellConfig, plugin: ModuleFederationPluginInstance): AppshellTemplate;
|
|
25
|
+
static validate(template: AppshellTemplate): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Publish identity is the npm identity of the package being built, not the module
|
|
28
|
+
* federation name — the registry requires a lowercase name and has no other source
|
|
29
|
+
* for a version. The scope is taken from the caller's token, so it is stripped here.
|
|
30
|
+
*/
|
|
31
|
+
static identify(context: string): {
|
|
32
|
+
name: string;
|
|
33
|
+
version: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Apply the plugin
|
|
37
|
+
* @param {Compiler} compiler the compiler instance
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
apply(compiler: Compiler): void;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=AppshellPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppshellPlugin.d.ts","sourceRoot":"","sources":["../../../../src/AppshellPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EACd,gB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name": "@appshell/webpack-plugin",
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
|
+
"description": "Webpack plugin used to generate a global Appshell configuration for micro-frontends built with Module Federation",
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"types": "dist/types/webpack-plugin/src/index.d.ts",
|
|
7
|
+
"repository": "https://github.com/appshell-org/appshell.git",
|
|
8
|
+
"author": "Robert Hamilton <rh@navaris.com>",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public",
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "webpack --mode production && npm run build:types",
|
|
15
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
16
|
+
"build:code": "cross-env NODE_ENV=production babel-typescript src -d dist --copy-files",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"prebuild": "npm run clean",
|
|
19
|
+
"start": "webpack --watch --mode development && npm run build:types",
|
|
20
|
+
"stats": "webpack --json > stats.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"module federation",
|
|
27
|
+
"micro-frontends",
|
|
28
|
+
"appshell",
|
|
29
|
+
"plugin"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT"
|
|
32
|
+
}
|