@appshell/webpack-plugin 1.0.0-alpha.8 → 1.0.0-alpha.81

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.
Files changed (81) hide show
  1. package/README.md +21 -24
  2. package/dist/main.js +5 -5
  3. package/dist/types/config/src/axios.d.ts +0 -1
  4. package/dist/types/config/src/configmap.d.ts +0 -1
  5. package/dist/types/config/src/context.d.ts +3 -4
  6. package/dist/types/config/src/credentials.d.ts +0 -2
  7. package/dist/types/config/src/generate.manifest.d.ts +30 -2
  8. package/dist/types/config/src/index.d.ts +7 -10
  9. package/dist/types/config/src/loader.d.ts +18 -0
  10. package/dist/types/config/src/mappers/appshell.config.d.ts +9 -3
  11. package/dist/types/config/src/outdated.d.ts +0 -1
  12. package/dist/types/config/src/publish.d.ts +79 -5
  13. package/dist/types/config/src/sync.d.ts +0 -1
  14. package/dist/types/config/src/tls.d.ts +23 -0
  15. package/dist/types/config/src/types.d.ts +164 -30
  16. package/dist/types/config/src/utils/blur.d.ts +0 -1
  17. package/dist/types/config/src/utils/compare.d.ts +0 -1
  18. package/dist/types/config/src/utils/config.d.ts +0 -1
  19. package/dist/types/config/src/utils/copy.d.ts +0 -1
  20. package/dist/types/config/src/utils/dump.d.ts +10 -0
  21. package/dist/types/config/src/utils/index.d.ts +1 -4
  22. package/dist/types/config/src/utils/list.d.ts +0 -1
  23. package/dist/types/config/src/utils/load.d.ts +0 -1
  24. package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts +0 -1
  25. package/dist/types/config/src/validators/index.d.ts +0 -3
  26. package/dist/types/runtime/src/errors.d.ts +32 -0
  27. package/dist/types/runtime/src/identity.d.ts +47 -0
  28. package/dist/types/runtime/src/index.d.ts +6 -0
  29. package/dist/types/runtime/src/store.d.ts +25 -0
  30. package/dist/types/runtime/src/types.d.ts +9 -0
  31. package/dist/types/runtime/src/wire.d.ts +58 -0
  32. package/dist/types/tokens/src/contract.d.ts +51 -0
  33. package/dist/types/tokens/src/contrast.d.ts +37 -0
  34. package/dist/types/tokens/src/index.d.ts +4 -0
  35. package/dist/types/tokens/src/presets.d.ts +4 -0
  36. package/dist/types/tokens/src/theme.d.ts +54 -0
  37. package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts +44 -4
  38. package/dist/types/webpack-plugin/src/devHint.d.ts +45 -0
  39. package/dist/types/webpack-plugin/src/index.d.ts +3 -1
  40. package/dist/types/webpack-plugin/src/shared.d.ts +36 -0
  41. package/package.json +11 -4
  42. package/dist/types/config/src/axios.d.ts.map +0 -1
  43. package/dist/types/config/src/configmap.d.ts.map +0 -1
  44. package/dist/types/config/src/context.d.ts.map +0 -1
  45. package/dist/types/config/src/credentials.d.ts.map +0 -1
  46. package/dist/types/config/src/deregister.d.ts +0 -3
  47. package/dist/types/config/src/deregister.d.ts.map +0 -1
  48. package/dist/types/config/src/generate.env.d.ts +0 -3
  49. package/dist/types/config/src/generate.env.d.ts.map +0 -1
  50. package/dist/types/config/src/generate.global-config.d.ts +0 -10
  51. package/dist/types/config/src/generate.global-config.d.ts.map +0 -1
  52. package/dist/types/config/src/generate.manifest.d.ts.map +0 -1
  53. package/dist/types/config/src/index.d.ts.map +0 -1
  54. package/dist/types/config/src/mappers/appshell.config.d.ts.map +0 -1
  55. package/dist/types/config/src/outdated.d.ts.map +0 -1
  56. package/dist/types/config/src/publish.d.ts.map +0 -1
  57. package/dist/types/config/src/register.d.ts +0 -4
  58. package/dist/types/config/src/register.d.ts.map +0 -1
  59. package/dist/types/config/src/sync.d.ts.map +0 -1
  60. package/dist/types/config/src/types.d.ts.map +0 -1
  61. package/dist/types/config/src/utils/blur.d.ts.map +0 -1
  62. package/dist/types/config/src/utils/compare.d.ts.map +0 -1
  63. package/dist/types/config/src/utils/config.d.ts.map +0 -1
  64. package/dist/types/config/src/utils/copy.d.ts.map +0 -1
  65. package/dist/types/config/src/utils/index.d.ts.map +0 -1
  66. package/dist/types/config/src/utils/isValidUrl.d.ts +0 -3
  67. package/dist/types/config/src/utils/isValidUrl.d.ts.map +0 -1
  68. package/dist/types/config/src/utils/list.d.ts.map +0 -1
  69. package/dist/types/config/src/utils/load.d.ts.map +0 -1
  70. package/dist/types/config/src/utils/loadJson.d.ts +0 -10
  71. package/dist/types/config/src/utils/loadJson.d.ts.map +0 -1
  72. package/dist/types/config/src/utils/merge.d.ts +0 -4
  73. package/dist/types/config/src/utils/merge.d.ts.map +0 -1
  74. package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +0 -4
  75. package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
  76. package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +0 -4
  77. package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +0 -1
  78. package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts.map +0 -1
  79. package/dist/types/config/src/validators/index.d.ts.map +0 -1
  80. package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts.map +0 -1
  81. 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 app module. For example:
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 environment current as you work. **Development builds publish by
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 / environment are usually omitted — see below.
63
+ // registry / application are usually omitted — see below.
64
64
  registry: 'https://registry.example.com', // optional override
65
- environment: 'acme/my-dev', // optional: activate the published version here
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, environment, and token you set
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
- | environment | `environment` | `APPSHELL_ENVIRONMENT` | `scope/name` (or joined with `APPSHELL_SCOPE_ID`); omit to publish without activating |
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`, `APPSHELL_ENVIRONMENT`, and `APPSHELL_TOKEN`
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 app is published under its **npm** name and version, unscoped — the registry takes the scope
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 # Environment variables will be expanded when the global runtime manifest is generated.
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
- environment:
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 `environment` section defines runtime environment variables that are injected into the global namesapce `window.__appshell_env__[module_name]` when an Appshell component is loaded. See the examples for a use case.
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
- "environment": {
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
- - [`config`](#config)
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
- #### `config`
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