@appshell/webpack-plugin 1.0.0-alpha.9 → 1.0.0-alpha.90
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/README.md +21 -24
- package/dist/main.js +3 -3
- package/dist/types/config/src/axios.d.ts +0 -1
- package/dist/types/config/src/configmap.d.ts +0 -1
- package/dist/types/config/src/context.d.ts +3 -4
- package/dist/types/config/src/credentials.d.ts +35 -3
- package/dist/types/config/src/generate.manifest.d.ts +30 -2
- package/dist/types/config/src/index.d.ts +9 -10
- package/dist/types/config/src/loader.d.ts +18 -0
- package/dist/types/config/src/mappers/appshell.config.d.ts +9 -3
- package/dist/types/config/src/outdated.d.ts +0 -1
- package/dist/types/config/src/package-name.d.ts +20 -0
- package/dist/types/config/src/publish.d.ts +89 -7
- package/dist/types/config/src/sync.d.ts +0 -1
- package/dist/types/config/src/tls.d.ts +23 -0
- package/dist/types/config/src/types.d.ts +164 -30
- package/dist/types/config/src/utils/blur.d.ts +0 -1
- package/dist/types/config/src/utils/compare.d.ts +0 -1
- package/dist/types/config/src/utils/config.d.ts +0 -1
- package/dist/types/config/src/utils/copy.d.ts +0 -1
- package/dist/types/config/src/utils/dump.d.ts +10 -0
- package/dist/types/config/src/utils/index.d.ts +1 -4
- package/dist/types/config/src/utils/list.d.ts +0 -1
- package/dist/types/config/src/utils/load.d.ts +0 -1
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts +0 -1
- package/dist/types/config/src/validators/index.d.ts +0 -3
- package/dist/types/runtime/src/errors.d.ts +32 -0
- package/dist/types/runtime/src/identity.d.ts +47 -0
- package/dist/types/runtime/src/index.d.ts +6 -0
- package/dist/types/runtime/src/store.d.ts +25 -0
- package/dist/types/runtime/src/types.d.ts +9 -0
- package/dist/types/runtime/src/wire.d.ts +58 -0
- package/dist/types/tokens/src/contract.d.ts +51 -0
- package/dist/types/tokens/src/contrast.d.ts +37 -0
- package/dist/types/tokens/src/index.d.ts +4 -0
- package/dist/types/tokens/src/presets.d.ts +4 -0
- package/dist/types/tokens/src/theme.d.ts +54 -0
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts +46 -5
- package/dist/types/webpack-plugin/src/devHint.d.ts +45 -0
- package/dist/types/webpack-plugin/src/index.d.ts +3 -1
- package/dist/types/webpack-plugin/src/shared.d.ts +36 -0
- package/package.json +11 -4
- package/dist/types/config/src/axios.d.ts.map +0 -1
- package/dist/types/config/src/configmap.d.ts.map +0 -1
- package/dist/types/config/src/context.d.ts.map +0 -1
- package/dist/types/config/src/credentials.d.ts.map +0 -1
- package/dist/types/config/src/deregister.d.ts +0 -3
- package/dist/types/config/src/deregister.d.ts.map +0 -1
- package/dist/types/config/src/generate.env.d.ts +0 -3
- package/dist/types/config/src/generate.env.d.ts.map +0 -1
- package/dist/types/config/src/generate.global-config.d.ts +0 -10
- package/dist/types/config/src/generate.global-config.d.ts.map +0 -1
- package/dist/types/config/src/generate.manifest.d.ts.map +0 -1
- package/dist/types/config/src/index.d.ts.map +0 -1
- package/dist/types/config/src/mappers/appshell.config.d.ts.map +0 -1
- package/dist/types/config/src/outdated.d.ts.map +0 -1
- package/dist/types/config/src/publish.d.ts.map +0 -1
- package/dist/types/config/src/register.d.ts +0 -4
- package/dist/types/config/src/register.d.ts.map +0 -1
- package/dist/types/config/src/sync.d.ts.map +0 -1
- package/dist/types/config/src/types.d.ts.map +0 -1
- package/dist/types/config/src/utils/blur.d.ts.map +0 -1
- package/dist/types/config/src/utils/compare.d.ts.map +0 -1
- package/dist/types/config/src/utils/config.d.ts.map +0 -1
- package/dist/types/config/src/utils/copy.d.ts.map +0 -1
- package/dist/types/config/src/utils/index.d.ts.map +0 -1
- package/dist/types/config/src/utils/isValidUrl.d.ts +0 -3
- package/dist/types/config/src/utils/isValidUrl.d.ts.map +0 -1
- package/dist/types/config/src/utils/list.d.ts.map +0 -1
- package/dist/types/config/src/utils/load.d.ts.map +0 -1
- package/dist/types/config/src/utils/loadJson.d.ts +0 -10
- package/dist/types/config/src/utils/loadJson.d.ts.map +0 -1
- package/dist/types/config/src/utils/merge.d.ts +0 -4
- package/dist/types/config/src/utils/merge.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/index.d.ts.map +0 -1
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts.map +0 -1
- package/dist/types/webpack-plugin/src/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ or
|
|
|
35
35
|
pnpm add -D @appshell/webpack-plugin
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Then add the plugin to the `webpack` config of each remote
|
|
38
|
+
Then add the plugin to the `webpack` config of each remote package. For example:
|
|
39
39
|
|
|
40
40
|
**webpack.config.js**
|
|
41
41
|
|
|
@@ -54,19 +54,19 @@ module.exports = {
|
|
|
54
54
|
## Publishing on build
|
|
55
55
|
|
|
56
56
|
The plugin can publish the generated manifest to an Appshell registry after every successful build,
|
|
57
|
-
so a running `--watch` keeps an
|
|
57
|
+
so a running `--watch` keeps an application current as you work. **Development builds publish by
|
|
58
58
|
default** — you never toggle it per project — while production builds never publish on their own.
|
|
59
59
|
|
|
60
60
|
```js
|
|
61
61
|
new AppshellPlugin({
|
|
62
62
|
config: './path/to/appshell.config.yaml',
|
|
63
|
-
// registry /
|
|
63
|
+
// registry / application are usually omitted — see below.
|
|
64
64
|
registry: 'https://registry.example.com', // optional override
|
|
65
|
-
|
|
65
|
+
application: 'acme/my-dev', // optional: activate the published version here
|
|
66
66
|
});
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
By default the plugin defers to your **CLI context** — the registry,
|
|
69
|
+
By default the plugin defers to your **CLI context** — the registry, application, and token you set
|
|
70
70
|
with `appshell config set` and `appshell login` (stored in `~/.appshell`). That's the same context
|
|
71
71
|
the CLI uses, so one machine-level setting drives both; a project needs no per-repo configuration.
|
|
72
72
|
|
|
@@ -78,15 +78,15 @@ plugin warns that it is overriding it.
|
|
|
78
78
|
| ----------- | ------------- | --------------------------- | ------------------------------------------------------------------------------------- |
|
|
79
79
|
| publish | `publish` | `APPSHELL_PUBLISH_ON_BUILD` | Defaults to `true` in development mode; set `0`/`false` to opt out |
|
|
80
80
|
| registry | `registry` | `APPSHELL_REGISTRY` | From CLI context by default |
|
|
81
|
-
|
|
|
81
|
+
| application | `application` | `APPSHELL_APPLICATION` | `scope/name` (or joined with `APPSHELL_SCOPE_ID`); omit to publish without activating |
|
|
82
82
|
| force | `force` | — | Overwrite a changed version; defaults to `true` in dev mode |
|
|
83
83
|
| token | — | `APPSHELL_TOKEN` | Otherwise from `~/.appshell/credentials`; never a plugin option |
|
|
84
84
|
|
|
85
|
-
In CI there is no `~/.appshell`, so `APPSHELL_REGISTRY`, `
|
|
85
|
+
In CI there is no `~/.appshell`, so `APPSHELL_REGISTRY`, `APPSHELL_APPLICATION`, and `APPSHELL_TOKEN`
|
|
86
86
|
are the whole story. If publishing defaults on in development but no registry is resolvable, the build
|
|
87
87
|
still succeeds — publishing is skipped with a warning.
|
|
88
88
|
|
|
89
|
-
The
|
|
89
|
+
The package is published under its **npm** name and version, unscoped — the registry takes the scope
|
|
90
90
|
from your token. Publishing the same content twice is a no-op, so a watch loop that rebuilds without
|
|
91
91
|
a version bump is harmless. Publishing _different_ content under an existing version is normally
|
|
92
92
|
rejected; in development mode the plugin asks the registry to overwrite it, which a local (unauthenticated)
|
|
@@ -104,7 +104,7 @@ Sample appshell.config.yaml
|
|
|
104
104
|
```yaml
|
|
105
105
|
remotes:
|
|
106
106
|
TestModule/Foo: # Must match the scope/module defined in ModuleFederationPlugin
|
|
107
|
-
url: ${APPS_TEST_URL}/remoteEntry.js #
|
|
107
|
+
url: ${APPS_TEST_URL}/remoteEntry.js # Application variables will be expanded when the global runtime manifest is generated.
|
|
108
108
|
metadata: # Use metadata to provide additional information
|
|
109
109
|
route: ${FOO_ROUTE}
|
|
110
110
|
displayName: Foo App
|
|
@@ -130,7 +130,7 @@ remotes:
|
|
|
130
130
|
order: 30
|
|
131
131
|
icon: ViewList
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
vars:
|
|
134
134
|
RUNTIME_ARG_1: ${RUNTIME_ARG_1}
|
|
135
135
|
RUNTIME_ARG_2: ${RUNTIME_ARG_2}
|
|
136
136
|
RUNTIME_ARG_3: ${RUNTIME_ARG_3}
|
|
@@ -138,7 +138,7 @@ environment:
|
|
|
138
138
|
|
|
139
139
|
> **Note** the variable expansion syntax `${CRA_MFE_URL}`. When the `appshell manifest` is generated the actual runtime environment values are injected.
|
|
140
140
|
|
|
141
|
-
> **Note** the `
|
|
141
|
+
> **Note** the `vars` section defines runtime configuration values a package reads with `getVars()` from [`@appshell/runtime/vars`](../runtime/README.md) once it is loaded. The package must share `@appshell/runtime` as a singleton to receive them. See the examples for a use case.
|
|
142
142
|
|
|
143
143
|
**What happens at build time?**
|
|
144
144
|
|
|
@@ -270,7 +270,7 @@ Sample `appshell manifest`:
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
|
-
"
|
|
273
|
+
"vars": {
|
|
274
274
|
"CraModule": {
|
|
275
275
|
"RUNTIME_ARG_1": "Foo",
|
|
276
276
|
"RUNTIME_ARG_2": "Biz"
|
|
@@ -304,19 +304,16 @@ module.exports = {
|
|
|
304
304
|
|
|
305
305
|
### `Options`
|
|
306
306
|
|
|
307
|
-
|
|
307
|
+
| Option | Type | Default | Purpose |
|
|
308
|
+
| ------ | ---- | ------- | ------- |
|
|
309
|
+
| `config` | `string` | `appshell.config.yaml` | Location of the config file |
|
|
310
|
+
| `registry` | `string` | CLI context | Registry to publish to |
|
|
311
|
+
| `application` | `string` | CLI context | Application to activate the published version in |
|
|
312
|
+
| `publish` | `boolean` | `true` in development | Publish after every successful build |
|
|
313
|
+
| `force` | `boolean` | `true` in development | Ask the registry to overwrite an existing version whose content differs |
|
|
308
314
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
Type:
|
|
312
|
-
|
|
313
|
-
```ts
|
|
314
|
-
type config = string;
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
Default: `appshell.config.yaml`
|
|
318
|
-
|
|
319
|
-
Location of the `appshell.config.yaml` file.
|
|
315
|
+
`registry` and `application` are usually omitted — see
|
|
316
|
+
[Publishing on build](#publishing-on-build) for the resolution order.
|
|
320
317
|
|
|
321
318
|
## License
|
|
322
319
|
|