@appshell/webpack-plugin 1.0.0-alpha.0 → 1.0.0-alpha.2
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 +25 -13
- package/dist/main.js +1 -1
- package/dist/types/config/src/context.d.ts +23 -0
- package/dist/types/config/src/context.d.ts.map +1 -0
- package/dist/types/config/src/credentials.d.ts +16 -0
- package/dist/types/config/src/credentials.d.ts.map +1 -0
- package/dist/types/config/src/index.d.ts +4 -0
- package/dist/types/config/src/index.d.ts.map +1 -1
- package/dist/types/config/src/publish.d.ts +5 -2
- package/dist/types/config/src/publish.d.ts.map +1 -1
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts +12 -0
- package/dist/types/webpack-plugin/src/AppshellPlugin.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -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 environment current as you work.
|
|
58
|
-
|
|
57
|
+
so a running `--watch` keeps an environment 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
|
|
63
|
+
// registry / environment are usually omitted — see below.
|
|
64
|
+
registry: 'https://registry.example.com', // optional override
|
|
64
65
|
environment: 'acme/my-dev', // optional: activate the published version here
|
|
65
|
-
publish: true,
|
|
66
66
|
});
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
By default the plugin defers to your **CLI context** — the registry, environment, 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
|
-
|
|
76
|
-
|
|
|
77
|
-
|
|
|
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.
|
|
76
|
+
|
|
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
|
+
| environment | `environment` | `APPSHELL_ENVIRONMENT` | `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_ENVIRONMENT`, 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.
|
|
78
88
|
|
|
79
89
|
The app 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.
|