@s2script/sdk 0.28.0 → 0.29.1
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 +31 -1
- package/commands.d.ts +1 -1
- package/dist/cli.js +3892 -787
- package/package.json +3 -1
- package/phrases.d.ts +1 -1
- package/plugins.d.ts +31 -2
- package/unsafe.d.ts +3 -3
package/README.md
CHANGED
|
@@ -113,7 +113,8 @@ field: `s2s build` builds every plugin in a workspace regardless of `private`, b
|
|
|
113
113
|
prints a per-plugin plan that skips a `private: true` package by name instead of shipping it. That's
|
|
114
114
|
what lets a workspace hold a large first-party or in-house plugin suite that must never reach the
|
|
115
115
|
public registry — build it, drop the `.s2sp`s into your own server, never `s2s deploy` it. (`s2s
|
|
116
|
-
deploy <dir>` on a single private plugin outside a workspace refuses the same way.)
|
|
116
|
+
deploy <dir>` on a single private plugin outside a workspace refuses the same way.) To publish a
|
|
117
|
+
package that only your org can see, use npm's other mechanism, `access`, instead (see Publishing).
|
|
117
118
|
|
|
118
119
|
### Bundles
|
|
119
120
|
|
|
@@ -166,6 +167,35 @@ The README and `repository` travel with the deploy, not inside the `.s2sp`: the
|
|
|
166
167
|
them. A deploy without them leaves what the page already shows, so a README or link set on the
|
|
167
168
|
site stays until a deploy replaces it.
|
|
168
169
|
|
|
170
|
+
**Source.** Like `npm publish`, every deploy also uploads the package's source as an npm-shaped
|
|
171
|
+
tarball (every file under `package/`), downloadable from the package page. Files are chosen with
|
|
172
|
+
npm's own rules: package.json `files` if present, otherwise everything minus `.npmignore` (or
|
|
173
|
+
`.gitignore` where there is no `.npmignore`); package.json, README and LICENSE are always in;
|
|
174
|
+
`node_modules`, `.git`, `.npmrc` and lockfiles never are. One deliberate difference: `.env` files
|
|
175
|
+
are never packed. `s2s pack --dry-run` lists exactly what a deploy would send, and `s2s pack`
|
|
176
|
+
writes the tarball (`<scope>-<name>-<version>.tgz`). The source of a public package is public, so
|
|
177
|
+
check that list before the first deploy.
|
|
178
|
+
|
|
179
|
+
**Restricted packages.** As on npm, a scoped package can be published **restricted**: only the
|
|
180
|
+
members of its org can see or install it, and everyone else gets a 404. Use
|
|
181
|
+
`s2s deploy --access restricted`, or `"publishConfig": { "access": "restricted" }` in package.json
|
|
182
|
+
(the flag wins). Access is fixed when the package is first published. A deploy that names none
|
|
183
|
+
keeps the current one. Before uploading, the CLI checks that the registry can keep the package
|
|
184
|
+
restricted, and refuses otherwise, so it never goes out public by accident. `s2s install` and
|
|
185
|
+
`s2s add` send your login, so members install restricted packages as usual. A server that only
|
|
186
|
+
installs should use a read-only token (s2script.com → Deploy tokens) as `S2SCRIPT_TOKEN`.
|
|
187
|
+
|
|
188
|
+
## Servers
|
|
189
|
+
|
|
190
|
+
A game server lists its registry plugins as npm-style `dependencies` in
|
|
191
|
+
`addons/s2script/plugins.json`, with a `plugins-lock.json` beside it. These are npm's shapes under
|
|
192
|
+
their own names, so npm never treats the folder as a Node project. From the game directory,
|
|
193
|
+
`s2s install <name>[@range]` adds a plugin (creating `plugins.json` the first time, like npm). Plain
|
|
194
|
+
`s2s install` installs exactly the lock, and `s2s update` moves each plugin to the newest version
|
|
195
|
+
its range allows. `s2s server init` writes both files from plugins already installed. The runtime
|
|
196
|
+
runs the same update at every startup before loading plugins (`"autoUpdate": false` turns it off).
|
|
197
|
+
See [INSTALL.md](https://github.com/s2script/s2script/blob/main/docs/INSTALL.md).
|
|
198
|
+
|
|
169
199
|
## Docs
|
|
170
200
|
|
|
171
201
|
**[s2script.com/docs](https://s2script.com/docs)** — getting started, guides, and the full API
|
package/commands.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export interface CommandInvocation {
|
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* // `!help` answers in chat; `sm_help` typed at a console answers in that console.
|
|
60
|
-
* command("sm_help", (cmd) => { cmd.reply("[
|
|
60
|
+
* command("sm_help", (cmd) => { cmd.reply("[S2S] Commands: …"); return HookResult.Handled; });
|
|
61
61
|
*/
|
|
62
62
|
reply(message: string): void;
|
|
63
63
|
/**
|