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

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 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. It is **off by default** — nothing
58
- is sent anywhere unless you opt in.
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: 'https://registry.example.com',
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
- Every option falls back to an environment variable, which is usually how you enable this — the same
70
- webpack config then publishes in a dev loop or in CI without being edited:
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
- | Option | Variable | Notes |
73
- | ------------- | --------------------------- | ------------------------------------------------ |
74
- | `publish` | `APPSHELL_PUBLISH_ON_BUILD` | Any non-empty value opts in |
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.
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; publishing _different_ content under an existing version is rejected.
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.