@appshell/config 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.
- package/README.md +28 -9
- package/dist/main.js +9 -9
- package/dist/types/axios.d.ts +0 -1
- package/dist/types/configmap.d.ts +0 -1
- package/dist/types/context.d.ts +3 -4
- package/dist/types/credentials.d.ts +0 -2
- package/dist/types/generate.manifest.d.ts +30 -2
- package/dist/types/index.d.ts +7 -10
- package/dist/types/loader.d.ts +18 -0
- package/dist/types/mappers/appshell.config.d.ts +9 -3
- package/dist/types/mappers/index.d.ts +0 -1
- package/dist/types/outdated.d.ts +0 -1
- package/dist/types/publish.d.ts +79 -5
- package/dist/types/sync.d.ts +0 -1
- package/dist/types/tls.d.ts +23 -0
- package/dist/types/types.d.ts +164 -30
- package/dist/types/utils/blur.d.ts +0 -1
- package/dist/types/utils/compare.d.ts +0 -1
- package/dist/types/utils/config.d.ts +0 -1
- package/dist/types/utils/copy.d.ts +0 -1
- package/dist/types/utils/dump.d.ts +10 -0
- package/dist/types/utils/index.d.ts +1 -4
- package/dist/types/utils/list.d.ts +0 -1
- package/dist/types/utils/load.d.ts +0 -1
- package/dist/types/validators/AppshellTemplateValidator.d.ts +0 -1
- package/dist/types/validators/index.d.ts +0 -3
- package/package.json +12 -4
- package/dist/types/axios.d.ts.map +0 -1
- package/dist/types/configmap.d.ts.map +0 -1
- package/dist/types/context.d.ts.map +0 -1
- package/dist/types/credentials.d.ts.map +0 -1
- package/dist/types/deregister.d.ts +0 -3
- package/dist/types/deregister.d.ts.map +0 -1
- package/dist/types/generate.env.d.ts +0 -3
- package/dist/types/generate.env.d.ts.map +0 -1
- package/dist/types/generate.global-config.d.ts +0 -10
- package/dist/types/generate.global-config.d.ts.map +0 -1
- package/dist/types/generate.manifest.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/mappers/appshell.config.d.ts.map +0 -1
- package/dist/types/mappers/index.d.ts.map +0 -1
- package/dist/types/outdated.d.ts.map +0 -1
- package/dist/types/publish.d.ts.map +0 -1
- package/dist/types/register.d.ts +0 -4
- package/dist/types/register.d.ts.map +0 -1
- package/dist/types/sync.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/utils/blur.d.ts.map +0 -1
- package/dist/types/utils/compare.d.ts.map +0 -1
- package/dist/types/utils/config.d.ts.map +0 -1
- package/dist/types/utils/copy.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/isValidUrl.d.ts +0 -3
- package/dist/types/utils/isValidUrl.d.ts.map +0 -1
- package/dist/types/utils/list.d.ts.map +0 -1
- package/dist/types/utils/load.d.ts.map +0 -1
- package/dist/types/utils/loadJson.d.ts +0 -10
- package/dist/types/utils/loadJson.d.ts.map +0 -1
- package/dist/types/utils/merge.d.ts +0 -4
- package/dist/types/utils/merge.d.ts.map +0 -1
- package/dist/types/validators/AppshellGlobalConfigValidator.d.ts +0 -4
- package/dist/types/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
- package/dist/types/validators/AppshellManifestValidator.d.ts +0 -4
- package/dist/types/validators/AppshellManifestValidator.d.ts.map +0 -1
- package/dist/types/validators/AppshellTemplateValidator.d.ts.map +0 -1
- package/dist/types/validators/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -39,21 +39,39 @@ pnpm add -D @appshell/config
|
|
|
39
39
|
|
|
40
40
|
## Functions
|
|
41
41
|
|
|
42
|
+
`@appshell/config` is the library the CLI is built on. Most of it is reachable through
|
|
43
|
+
`appshell` commands; reach for the package directly when you are scripting a build.
|
|
44
|
+
|
|
45
|
+
| Export | Purpose | CLI equivalent |
|
|
46
|
+
| ------ | ------- | -------------- |
|
|
47
|
+
| `generateManifest` | Template → manifest, expanding `${VAR}` | `appshell generate manifest` |
|
|
48
|
+
| `publish` | Publish a manifest as a package version | `appshell publish` |
|
|
49
|
+
| `activate` | Activate a version into an application | `appshell publish --application` |
|
|
50
|
+
| `outdated` | Compare shared dependencies against baselines | `appshell outdated` |
|
|
51
|
+
| `sync` | Install shared dependencies at the declared versions | — |
|
|
52
|
+
| `resolveContext` / `persistedContext` | Registry, application and token, resolved as the CLI resolves them | `appshell config list` |
|
|
53
|
+
| `resolveToken` / `saveCredential` / `clearCredential` / `credentialsPath` | Stored credentials, per registry | `appshell login` / `logout` |
|
|
54
|
+
| `configmap` | `${VAR}` placeholder expansion | — |
|
|
55
|
+
| `utils` | File loading, comparison and formatting helpers | — |
|
|
56
|
+
| `validators` | `AppshellTemplateValidator` | — |
|
|
57
|
+
|
|
58
|
+
|
|
42
59
|
### `generateManifest`
|
|
43
60
|
|
|
44
|
-
|
|
61
|
+
Processes one manifest template into an appshell manifest, expanding `${VAR}`
|
|
62
|
+
placeholders from the current environment.
|
|
45
63
|
|
|
46
64
|
```ts
|
|
47
65
|
import { generateManifest } from '@appshell/config';
|
|
48
66
|
|
|
49
|
-
const manifest = generateManifest<MyMetadata>(
|
|
67
|
+
const manifest = await generateManifest<MyMetadata>('dist/appshell.template.json');
|
|
50
68
|
```
|
|
51
69
|
|
|
52
|
-
**Where does the
|
|
70
|
+
**Where does the template come from?**
|
|
53
71
|
|
|
54
|
-
> Each micro-frontend configured
|
|
72
|
+
> Each micro-frontend configured with [@appshell/webpack-plugin](https://www.npmjs.com/package/@appshell/webpack-plugin) emits `appshell.template.json` at build time. This function turns that into the manifest a package version is published with.
|
|
55
73
|
|
|
56
|
-
Sample
|
|
74
|
+
Sample template:
|
|
57
75
|
|
|
58
76
|
```json
|
|
59
77
|
{
|
|
@@ -87,7 +105,7 @@ Sample content from CONFIGS_DIR:
|
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
},
|
|
90
|
-
"
|
|
108
|
+
"vars": {
|
|
91
109
|
"RUNTIME_ARG_1": "${RUNTIME_ARG_1}",
|
|
92
110
|
"RUNTIME_ARG_2": "${RUNTIME_ARG_2}"
|
|
93
111
|
}
|
|
@@ -98,7 +116,7 @@ Sample content from CONFIGS_DIR:
|
|
|
98
116
|
|
|
99
117
|
> Note the variable expansion syntax `${CRA_MFE_URL}`. When `generateManifest` is called the actual runtime environment values are injected and an appshell manifest is emitted.
|
|
100
118
|
|
|
101
|
-
> **Note** the `
|
|
119
|
+
> **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.
|
|
102
120
|
|
|
103
121
|
Sample appshell manifest produced by the `generateManifest` function:
|
|
104
122
|
|
|
@@ -181,7 +199,7 @@ Sample appshell manifest produced by the `generateManifest` function:
|
|
|
181
199
|
}
|
|
182
200
|
}
|
|
183
201
|
},
|
|
184
|
-
"
|
|
202
|
+
"vars": {
|
|
185
203
|
"CraModule": {
|
|
186
204
|
"RUNTIME_ARG_1": "Foo",
|
|
187
205
|
"RUNTIME_ARG_2": "Biz"
|
|
@@ -193,7 +211,8 @@ Sample appshell manifest produced by the `generateManifest` function:
|
|
|
193
211
|
}
|
|
194
212
|
```
|
|
195
213
|
|
|
196
|
-
This
|
|
214
|
+
This manifest is what `publish` sends to the registry as a package version. The registry composes
|
|
215
|
+
every activated package into the payload it serves to the shell.
|
|
197
216
|
|
|
198
217
|
**What if I want to generate the manifest by a startup script instead?**
|
|
199
218
|
|