@appshell/webpack-plugin 1.0.0-alpha.0 → 1.0.0-alpha.100
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 +41 -32
- package/dist/main.js +5 -5
- 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 +26 -0
- package/dist/types/config/src/credentials.d.ts +48 -0
- package/dist/types/config/src/generate.manifest.d.ts +30 -2
- package/dist/types/config/src/index.d.ts +12 -9
- 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 +93 -8
- package/dist/types/config/src/sync.d.ts +0 -1
- package/dist/types/config/src/tls.d.ts +11 -0
- package/dist/types/config/src/types.d.ts +184 -31
- 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 +15 -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 +2 -5
- 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 +56 -3
- 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 +12 -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/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,31 +54,43 @@ 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
|
|
58
|
-
|
|
57
|
+
so a running `--watch` keeps an application current as you work. **Development builds publish by
|
|
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
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
// registry / application are usually omitted — see below.
|
|
64
|
+
registry: 'https://registry.example.com', // optional override
|
|
65
|
+
application: 'acme/my-dev', // optional: activate the published version here
|
|
66
66
|
});
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
By default the plugin defers to your **CLI context** — the registry, application, and token you set
|
|
70
|
+
with `appshell config set` and `appshell login` (stored in `~/.appshell`). That's the same context
|
|
71
|
+
the CLI uses, so one machine-level setting drives both; a project needs no per-repo configuration.
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
| `registry` | `APPSHELL_REGISTRY_URL` | Required when publishing |
|
|
76
|
-
| `environment` | `APPSHELL_ENVIRONMENT` | `scope/name`; omit to publish without activating |
|
|
77
|
-
| — | `APPSHELL_TOKEN` | Bearer token. Never a plugin option |
|
|
73
|
+
Resolution precedence, per field: explicit plugin option → `APPSHELL_*` env var → `~/.appshell`
|
|
74
|
+
context → default. When an option or env var points somewhere other than your persisted context, the
|
|
75
|
+
plugin warns that it is overriding it.
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
| Field | Option | Env var | Notes |
|
|
78
|
+
| ----------- | ------------- | --------------------------- | ------------------------------------------------------------------------------------- |
|
|
79
|
+
| publish | `publish` | `APPSHELL_PUBLISH_ON_BUILD` | Defaults to `true` in development mode; set `0`/`false` to opt out |
|
|
80
|
+
| registry | `registry` | `APPSHELL_REGISTRY` | From CLI context by default |
|
|
81
|
+
| application | `application` | `APPSHELL_APPLICATION` | `scope/name` (or joined with `APPSHELL_SCOPE_ID`); omit to publish without activating |
|
|
82
|
+
| force | `force` | — | Overwrite a changed version; defaults to `true` in dev mode |
|
|
83
|
+
| token | — | `APPSHELL_TOKEN` | Otherwise from `~/.appshell/credentials`; never a plugin option |
|
|
84
|
+
|
|
85
|
+
In CI there is no `~/.appshell`, so `APPSHELL_REGISTRY`, `APPSHELL_APPLICATION`, and `APPSHELL_TOKEN`
|
|
86
|
+
are the whole story. If publishing defaults on in development but no registry is resolvable, the build
|
|
87
|
+
still succeeds — publishing is skipped with a warning.
|
|
88
|
+
|
|
89
|
+
The package is published under its **npm** name and version, unscoped — the registry takes the scope
|
|
80
90
|
from your token. Publishing the same content twice is a no-op, so a watch loop that rebuilds without
|
|
81
|
-
a version bump is harmless
|
|
91
|
+
a version bump is harmless. Publishing _different_ content under an existing version is normally
|
|
92
|
+
rejected; in development mode the plugin asks the registry to overwrite it, which a local (unauthenticated)
|
|
93
|
+
registry honors by default and a real registry refuses unless configured with `ALLOW_FORCE_PUBLISH`.
|
|
82
94
|
|
|
83
95
|
A failed publish is reported as a compilation error rather than thrown, so `--watch` reports it and
|
|
84
96
|
keeps running.
|
|
@@ -92,7 +104,7 @@ Sample appshell.config.yaml
|
|
|
92
104
|
```yaml
|
|
93
105
|
remotes:
|
|
94
106
|
TestModule/Foo: # Must match the scope/module defined in ModuleFederationPlugin
|
|
95
|
-
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.
|
|
96
108
|
metadata: # Use metadata to provide additional information
|
|
97
109
|
route: ${FOO_ROUTE}
|
|
98
110
|
displayName: Foo App
|
|
@@ -118,7 +130,7 @@ remotes:
|
|
|
118
130
|
order: 30
|
|
119
131
|
icon: ViewList
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
vars:
|
|
122
134
|
RUNTIME_ARG_1: ${RUNTIME_ARG_1}
|
|
123
135
|
RUNTIME_ARG_2: ${RUNTIME_ARG_2}
|
|
124
136
|
RUNTIME_ARG_3: ${RUNTIME_ARG_3}
|
|
@@ -126,7 +138,7 @@ environment:
|
|
|
126
138
|
|
|
127
139
|
> **Note** the variable expansion syntax `${CRA_MFE_URL}`. When the `appshell manifest` is generated the actual runtime environment values are injected.
|
|
128
140
|
|
|
129
|
-
> **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.
|
|
130
142
|
|
|
131
143
|
**What happens at build time?**
|
|
132
144
|
|
|
@@ -258,7 +270,7 @@ Sample `appshell manifest`:
|
|
|
258
270
|
}
|
|
259
271
|
}
|
|
260
272
|
},
|
|
261
|
-
"
|
|
273
|
+
"vars": {
|
|
262
274
|
"CraModule": {
|
|
263
275
|
"RUNTIME_ARG_1": "Foo",
|
|
264
276
|
"RUNTIME_ARG_2": "Biz"
|
|
@@ -292,19 +304,16 @@ module.exports = {
|
|
|
292
304
|
|
|
293
305
|
### `Options`
|
|
294
306
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
type config = string;
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
Default: `appshell.config.yaml`
|
|
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 |
|
|
306
314
|
|
|
307
|
-
|
|
315
|
+
`registry` and `application` are usually omitted — see
|
|
316
|
+
[Publishing on build](#publishing-on-build) for the resolution order.
|
|
308
317
|
|
|
309
318
|
## License
|
|
310
319
|
|