pressship 0.1.2 → 0.1.3

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.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: wordpress-plugin-publish
3
+ description: Use this skill when publishing, submitting, reuploading, packaging, checking, or releasing WordPress.org plugins with Pressship. It covers safe Pressship workflows for local plugin directories, pending WordPress.org submissions, approved plugin releases, Plugin Check review, package exclusions, WordPress Playground demos, and authentication.
4
+ ---
5
+
6
+ # WordPress Plugin Publish
7
+
8
+ Use Pressship for WordPress.org plugin submission and release work. Prefer `npx pressship` unless the user explicitly wants the local checkout version.
9
+
10
+ ## Safety Rules
11
+
12
+ - Never publish, submit, reupload, or release without first running a dry run, unless the user explicitly says to skip it.
13
+ - Do not push git commits or tags unless the user explicitly asks.
14
+ - Report Plugin Check findings clearly. Do not hide them just because Pressship can continue.
15
+ - Use repeatable excludes for large or source-only files. Prefer `.pressshipignore` when the project already has one.
16
+ - If Pressship prompts interactively, answer only with user-approved or obvious plugin metadata.
17
+ - If authentication fails, run `npx pressship login` and let the user complete WordPress.org login.
18
+
19
+ ## Orientation
20
+
21
+ From the plugin directory:
22
+
23
+ ```bash
24
+ npx pressship whoami
25
+ npx pressship status .
26
+ npx pressship info .
27
+ ```
28
+
29
+ Use `status` to determine whether `publish` will target a pending submission reupload or an approved SVN release.
30
+
31
+ ## Local Playground Test
32
+
33
+ Start a local WordPress Playground with the plugin mounted:
34
+
35
+ ```bash
36
+ npx pressship demo .
37
+ ```
38
+
39
+ Useful options:
40
+
41
+ ```bash
42
+ npx pressship demo . --port 9401
43
+ npx pressship demo . --wp 6.8 --php 8.3
44
+ npx pressship demo . --reset
45
+ npx pressship demo . --skip-browser
46
+ ```
47
+
48
+ ## Package Check
49
+
50
+ Create and validate a WordPress-installable zip without uploading:
51
+
52
+ ```bash
53
+ npx pressship pack .
54
+ ```
55
+
56
+ For projects with bulky assets or source-only files, pass explicit ignores:
57
+
58
+ ```bash
59
+ npx pressship pack . --ignore "assets/**" --ignore "src/**" --ignore "node_modules/**"
60
+ ```
61
+
62
+ Inspect package file count and included paths. Make sure the ZIP contains runtime PHP, built assets, `readme.txt`, and any required examples or static assets.
63
+
64
+ ## Submit Or Reupload Pending Review
65
+
66
+ Use this for new plugins or WordPress.org submissions still awaiting review.
67
+
68
+ Dry run first:
69
+
70
+ ```bash
71
+ npx pressship publish . --dry-run -y
72
+ ```
73
+
74
+ Then upload:
75
+
76
+ ```bash
77
+ npx pressship publish . -y
78
+ ```
79
+
80
+ When the project contains large non-distribution directories, repeat the same ignore flags in both commands:
81
+
82
+ ```bash
83
+ npx pressship publish . --dry-run -y \
84
+ --ignore "assets/**" \
85
+ --ignore "src/**" \
86
+ --ignore "scripts/**" \
87
+ --ignore "package.json" \
88
+ --ignore "package-lock.json" \
89
+ --ignore ".github/**" \
90
+ --ignore "node_modules/**" \
91
+ --ignore "dist/**"
92
+
93
+ npx pressship publish . -y \
94
+ --ignore "assets/**" \
95
+ --ignore "src/**" \
96
+ --ignore "scripts/**" \
97
+ --ignore "package.json" \
98
+ --ignore "package-lock.json" \
99
+ --ignore ".github/**" \
100
+ --ignore "node_modules/**" \
101
+ --ignore "dist/**"
102
+ ```
103
+
104
+ After upload, confirm:
105
+
106
+ ```bash
107
+ npx pressship status .
108
+ ```
109
+
110
+ ## Release Approved Plugin
111
+
112
+ Use this only when the plugin is already approved and the user wants a WordPress.org release.
113
+
114
+ Dry run first:
115
+
116
+ ```bash
117
+ npx pressship publish . --release --dry-run -y
118
+ ```
119
+
120
+ Then release:
121
+
122
+ ```bash
123
+ npx pressship publish . --release -y
124
+ ```
125
+
126
+ If Pressship cannot infer the slug or username:
127
+
128
+ ```bash
129
+ npx pressship release . --slug my-plugin --username WpOrgUser --dry-run
130
+ npx pressship release . --slug my-plugin --username WpOrgUser -y
131
+ ```
132
+
133
+ ## Version Bumps
134
+
135
+ Only run version bumps when the user asks:
136
+
137
+ ```bash
138
+ npx pressship version patch .
139
+ npx pressship version minor .
140
+ npx pressship version major .
141
+ ```
142
+
143
+ After a version bump, review changed plugin headers, `readme.txt` stable tag, and changelog.
144
+
145
+ ## Final Report
146
+
147
+ Always include:
148
+
149
+ - Whether a dry run was run.
150
+ - Package size and notable included/excluded files.
151
+ - Plugin Check result summary.
152
+ - Upload/release status and slug.
153
+ - Whether git was left untouched or changed.
package/README.md CHANGED
@@ -13,10 +13,10 @@
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
- <strong>WordPress.org plugin publishing, but closer to <code>npm publish</code>.</strong>
16
+ <strong>A modernized publishing workflow for WordPress.org plugins.</strong>
17
17
  </p>
18
18
 
19
- It is designed to make WordPress plugin publishing feel closer to npm package publishing:
19
+ It is designed to modernize WordPress plugin publishing while keeping WordPress.org review and SVN release behavior explicit:
20
20
 
21
21
  ```bash
22
22
  npx pressship login
@@ -24,6 +24,18 @@ npx pressship publish ./my-plugin --dry-run
24
24
  npx pressship publish ./my-plugin
25
25
  ```
26
26
 
27
+ If you use agent skills, install Pressship's publishing workflow skill:
28
+
29
+ ```bash
30
+ npx skills add f/pressship --skill wordpress-plugin-publish -a codex
31
+ ```
32
+
33
+ For other agents, replace `codex` with the target agent name, such as `claude-code`. To inspect available skills first, run:
34
+
35
+ ```bash
36
+ npx skills add f/pressship --list
37
+ ```
38
+
27
39
  ## Why Pressship?
28
40
 
29
41
  Publishing a WordPress plugin to WordPress.org involves a lot of small steps: creating the right zip, validating `readme.txt`, running Plugin Check, logging into WordPress.org, uploading through the developer page, and later publishing releases through SVN.
@@ -38,12 +50,17 @@ Pressship automates that workflow while still using WordPress.org's existing rev
38
50
  - `readme.txt` parsing and local validation.
39
51
  - WordPress.org readme validator automation.
40
52
  - WordPress-installable zip generation.
41
- - npm-style `publish` and `pack` commands.
53
+ - Modernized `publish` and `pack` commands.
42
54
  - Managed WordPress.org Plugin Check setup and execution.
43
55
  - Current WordPress.org submission state inspection.
56
+ - Local and hosted plugin info lookup.
57
+ - Local WordPress Playground demos for plugin paths or hosted slugs.
58
+ - Playground runtime selection from plugin WordPress/PHP requirements.
59
+ - Quieter Playground demos with deprecation noise suppressed.
44
60
  - Pending-plugin reupload support via the WordPress.org developer page.
45
61
  - SVN release workflow for approved plugins.
46
62
  - Repeatable ignore globs and `.pressshipignore` support.
63
+ - Documentation site for GitHub Pages.
47
64
  - Colorful CLI output with progress indicators.
48
65
 
49
66
  ## Quick Start
@@ -58,6 +75,14 @@ npx pressship whoami
58
75
  # Inspect current submitted plugin state.
59
76
  npx pressship status ./my-plugin
60
77
 
78
+ # Inspect local plugin metadata or hosted WordPress.org plugin info.
79
+ npx pressship info ./my-plugin
80
+ npx pressship info 16deza-table-cell-extras
81
+
82
+ # Open a local WordPress Playground demo.
83
+ npx pressship demo ./my-plugin
84
+ npx pressship demo 16deza-table-cell-extras
85
+
61
86
  # Validate and package without uploading or committing.
62
87
  npx pressship publish ./my-plugin --dry-run
63
88
 
@@ -88,6 +113,8 @@ Pressship installs Playwright Chromium automatically when browser automation fir
88
113
  pressship login
89
114
  pressship whoami [--json]
90
115
  pressship logout
116
+ pressship info [slug-or-path] [--json]
117
+ pressship demo [slug-or-path] [options]
91
118
  pressship status [plugin-path-or-slug] [--json]
92
119
  pressship version <patch|minor|major> [plugin-path]
93
120
  pressship pack [plugin-path] [options]
@@ -114,6 +141,46 @@ pressship whoami --json
114
141
  pressship logout
115
142
  ```
116
143
 
144
+ ## Info Flow
145
+
146
+ ```bash
147
+ pressship info
148
+ pressship info ./my-plugin
149
+ pressship info 16deza-table-cell-extras
150
+ pressship info https://wordpress.org/plugins/16deza-table-cell-extras/
151
+ pressship info 16deza-table-cell-extras --json
152
+ ```
153
+
154
+ `info` shows detailed metadata for a local plugin path or hosted WordPress.org plugin. With no argument, it inspects the current directory.
155
+
156
+ For local plugins it reports headers and readme metadata, including version, main file, readme path, text domain, requirements, stable tag, tags, contributors, and description.
157
+
158
+ For hosted plugins it uses the public WordPress.org plugin info API and reports version, author, requirements, active installs, last updated date, rating, support status, tags, description, and download URL.
159
+
160
+ ## Demo Flow
161
+
162
+ ```bash
163
+ pressship demo
164
+ pressship demo ./my-plugin
165
+ pressship demo 16deza-table-cell-extras
166
+ pressship demo https://wordpress.org/plugins/16deza-table-cell-extras/
167
+ ```
168
+
169
+ `demo` starts a local WordPress Playground server with the plugin loaded and activated. For local paths, Pressship mounts the plugin directory into Playground so local code changes are available. For hosted slugs or WordPress.org plugin URLs, Pressship creates a Blueprint that installs and activates the plugin from the WordPress.org directory.
170
+
171
+ Pressship uses the plugin's required WordPress and PHP versions when they are declared; pass `--wp` or `--php` to override them. It also adds a small Playground compatibility mu-plugin before activation so plugins that expect WordPress admin plugin helpers can boot cleanly. PHP deprecation notices are suppressed in demo pages, while real warnings, errors, and fatal errors remain visible.
172
+
173
+ Useful options:
174
+
175
+ ```bash
176
+ pressship demo ./my-plugin --port 9401
177
+ pressship demo ./my-plugin --wp 6.8 --php 8.3
178
+ pressship demo ./my-plugin --reset
179
+ pressship demo ./my-plugin --skip-browser
180
+ ```
181
+
182
+ Under the hood, `demo` uses the official `@wp-playground/cli` package. The Playground server keeps running until you stop it with `Ctrl+C`.
183
+
117
184
  ## Status Flow
118
185
 
119
186
  ```bash
@@ -161,7 +228,7 @@ pressship version minor ./my-plugin
161
228
  pressship version major ./my-plugin
162
229
  ```
163
230
 
164
- `version` bumps local plugin metadata, similar to `npm version`.
231
+ `version` bumps local plugin metadata from the command line.
165
232
 
166
233
  It updates:
167
234
 
@@ -187,7 +254,7 @@ pressship version major ./my-plugin
187
254
  pressship publish ./my-plugin
188
255
  ```
189
256
 
190
- `publish` is the npm-style happy path. It discovers the plugin and then chooses the best WordPress.org publishing flow:
257
+ `publish` is the modernized happy path. It discovers the plugin and then chooses the best WordPress.org publishing flow:
191
258
 
192
259
  - Use `submit` when a matching WordPress.org review submission is pending or reuploadable.
193
260
  - Use `release` when the plugin has an approved WordPress.org SVN repository and no pending review submission is found.
@@ -214,7 +281,7 @@ Use `--submit` for the review-upload flow and `--release` for the approved-plugi
214
281
  pressship pack ./my-plugin
215
282
  ```
216
283
 
217
- `pack` validates the plugin, runs Plugin Check, and creates the WordPress-installable `{slug}.zip` without uploading or committing. By default, it writes the zip to the current directory, similar to `npm pack`.
284
+ `pack` validates the plugin, runs Plugin Check, and creates the WordPress-installable `{slug}.zip` without uploading or committing. By default, it writes the zip to the current directory.
218
285
 
219
286
  Useful options:
220
287
 
@@ -375,6 +442,7 @@ This includes:
375
442
  - Debug screenshots for failed browser automation.
376
443
  - Managed Plugin Check cache.
377
444
  - Managed WordPress core and SQLite setup.
445
+ - Generated Playground demo blueprints.
378
446
 
379
447
  You can override the config directory:
380
448
 
@@ -397,7 +465,7 @@ npx playwright install chromium
397
465
  For local development:
398
466
 
399
467
  ```bash
400
- npm run browsers:install
468
+ Run the `browsers:install` package script.
401
469
  ```
402
470
 
403
471
  ### Not Logged In
@@ -436,32 +504,60 @@ pressship submit ./my-plugin --wp-path /path/to/wordpress
436
504
 
437
505
  The WordPress.org submission and reupload flows are browser automation over the logged-in developer page, not a documented public API. If WordPress.org changes the form, Pressship fails loudly and saves a debug screenshot under the config directory.
438
506
 
507
+ ## Documentation Site
508
+
509
+ The documentation site lives in `website/`.
510
+
511
+ Run it locally:
512
+
513
+ ```bash
514
+ Run the `docs:dev` package script.
515
+ ```
516
+
517
+ Build the static site:
518
+
519
+ ```bash
520
+ Run the `docs:build` package script.
521
+ ```
522
+
523
+ Preview the production build:
524
+
525
+ ```bash
526
+ Run the `docs:serve` package script.
527
+ ```
528
+
529
+ GitHub Pages deployment is configured in `.github/workflows/docs.yml`. In the repository settings, set Pages to use GitHub Actions as the source.
530
+
439
531
  ## Development
440
532
 
441
533
  ```bash
442
- npm install
443
- npm run dev -- --help
444
- npm run typecheck
445
- npm test
446
- npm run build
534
+ Install dependencies with your preferred Node package manager, then run:
535
+
536
+ - `dev -- --help`
537
+ - `typecheck`
538
+ - `test`
539
+ - `build`
540
+ - `docs:build`
447
541
  ```
448
542
 
449
543
  Run local commands without publishing:
450
544
 
451
545
  ```bash
452
- npm run dev -- login
453
- npm run dev -- whoami
454
- npm run dev -- status
455
- npm run dev -- pack ./my-plugin
456
- npm run dev -- publish ./my-plugin --dry-run
457
- npm run dev -- submit ./my-plugin --dry-run
458
- npm run dev -- release ./my-plugin --dry-run
546
+ Run these through the `dev` package script:
547
+
548
+ - `login`
549
+ - `whoami`
550
+ - `status`
551
+ - `pack ./my-plugin`
552
+ - `publish ./my-plugin --dry-run`
553
+ - `submit ./my-plugin --dry-run`
554
+ - `release ./my-plugin --dry-run`
459
555
  ```
460
556
 
461
557
  Package smoke test:
462
558
 
463
559
  ```bash
464
- npm pack --dry-run
560
+ Use your package manager's dry-run pack command.
465
561
  ```
466
562
 
467
563
  ## Security Notes
Binary file
package/dist/cli.js CHANGED
@@ -8,6 +8,8 @@ import { publish } from "./wordpress-org/publish.js";
8
8
  import { submit } from "./wordpress-org/submit.js";
9
9
  import { status } from "./wordpress-org/state.js";
10
10
  import { release } from "./svn/release.js";
11
+ import { demo } from "./plugin/demo.js";
12
+ import { info } from "./plugin/info.js";
11
13
  import { version } from "./plugin/version.js";
12
14
  const program = new Command();
13
15
  program
@@ -27,6 +29,22 @@ program
27
29
  .description("Print the WordPress.org username for the saved login session.")
28
30
  .option("--json", "Print account details as JSON")
29
31
  .action((options) => run(() => whoami(options))());
32
+ program
33
+ .command("demo")
34
+ .description("Start a local WordPress Playground demo for a plugin path or WordPress.org slug.")
35
+ .argument("[slug-or-path]", "Local plugin path, WordPress.org plugin slug, or plugin URL")
36
+ .option("--port <port>", "Port for the local Playground server")
37
+ .option("--wp <version>", "WordPress version to use")
38
+ .option("--php <version>", "PHP version to use")
39
+ .option("--reset", "Reset the persisted Playground site before starting")
40
+ .option("--skip-browser", "Start the local server without opening a browser")
41
+ .action((target, options) => run(() => demo(target, options))());
42
+ program
43
+ .command("info")
44
+ .description("Show detailed info for a local plugin path or WordPress.org plugin slug.")
45
+ .argument("[slug-or-path]", "Local plugin path, WordPress.org plugin slug, or plugin URL")
46
+ .option("--json", "Print plugin info as JSON")
47
+ .action((target, options) => run(() => info(target, options))());
30
48
  program
31
49
  .command("publish")
32
50
  .description("Submit for review or release an approved plugin, similar to npm publish.")
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAsB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAoB,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAuB,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAsB,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAsB,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAuB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,iEAAiE,CAAC;KAC9E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,wDAAwD,CAAC;KACrE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAEtB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,iDAAiD,CAAC;KAC9D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,C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,EAAE,CAAC,CAAC;AAElH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvC,SAAS,GAAG,CAAC,MAA2B;IACtC,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,CAAC;YACH,MAAM,MAAM,EAAE,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,QAAkB;IACtD,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import type { PluginProject } from "../types.js";
3
+ declare const demoOptionsSchema: z.ZodObject<{
4
+ port: z.ZodOptional<z.ZodString>;
5
+ wp: z.ZodOptional<z.ZodString>;
6
+ php: z.ZodOptional<z.ZodString>;
7
+ reset: z.ZodDefault<z.ZodBoolean>;
8
+ skipBrowser: z.ZodDefault<z.ZodBoolean>;
9
+ }, z.core.$strip>;
10
+ export type DemoOptions = z.input<typeof demoOptionsSchema>;
11
+ export type PlaygroundBlueprint = {
12
+ landingPage: string;
13
+ steps: Array<Record<string, unknown>>;
14
+ };
15
+ export type DemoLaunchPlan = {
16
+ source: "local" | "wordpress.org";
17
+ name: string;
18
+ slug: string;
19
+ command: string;
20
+ args: string[];
21
+ cwd: string;
22
+ blueprintPath: string;
23
+ siteDir: string;
24
+ wpVersion?: string;
25
+ phpVersion?: string;
26
+ url?: string;
27
+ };
28
+ export declare function demo(target: string | undefined, rawOptions?: DemoOptions): Promise<void>;
29
+ export declare function createDemoLaunchPlan(target: string | undefined, options: z.infer<typeof demoOptionsSchema>): Promise<DemoLaunchPlan>;
30
+ export declare function createLocalDemoBlueprint(project: PluginProject): PlaygroundBlueprint;
31
+ export declare function createHostedDemoBlueprint(slug: string): PlaygroundBlueprint;
32
+ export declare function createPlaygroundCompatibilitySteps(): Array<Record<string, unknown>>;
33
+ export declare function createPlaygroundStartArgs(input: {
34
+ path: string;
35
+ blueprintPath: string;
36
+ mount?: string;
37
+ options: z.infer<typeof demoOptionsSchema>;
38
+ }): string[];
39
+ export declare function resolveDemoPlaygroundOptions(options: z.infer<typeof demoOptionsSchema>, requiredVersions: {
40
+ wp?: unknown;
41
+ php?: unknown;
42
+ }): z.infer<typeof demoOptionsSchema>;
43
+ export declare function getPlaygroundSiteDir(projectPath: string): string;
44
+ export {};
@@ -0,0 +1,207 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, rm, writeFile } from "node:fs/promises";
3
+ import { homedir } from "node:os";
4
+ import path from "node:path";
5
+ import { execa } from "execa";
6
+ import { z } from "zod";
7
+ import { discoverPluginProject } from "./discover.js";
8
+ import { fetchHostedPluginInfo, slugFromHostedTarget } from "./info.js";
9
+ import { ui } from "../ui.js";
10
+ import { ensureCacheDir, pathExists } from "../utils/paths.js";
11
+ const playgroundCliPackage = "@wp-playground/cli@latest";
12
+ const compatibilityMuPluginPath = "/wordpress/wp-content/mu-plugins/pressship-playground-compat.php";
13
+ const compatibilityMuPlugin = `<?php
14
+ error_reporting(error_reporting() & ~E_DEPRECATED & ~E_USER_DEPRECATED);
15
+ set_error_handler(static function (int $severity): bool {
16
+ return $severity === E_DEPRECATED || $severity === E_USER_DEPRECATED;
17
+ });
18
+
19
+ if (! function_exists('is_plugin_active')) {
20
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
21
+ }
22
+ `;
23
+ const demoOptionsSchema = z.object({
24
+ port: z.string().optional(),
25
+ wp: z.string().optional(),
26
+ php: z.string().optional(),
27
+ reset: z.boolean().default(false),
28
+ skipBrowser: z.boolean().default(false)
29
+ });
30
+ export async function demo(target, rawOptions = {}) {
31
+ const options = demoOptionsSchema.parse(rawOptions);
32
+ ui.intro("Start plugin demo");
33
+ const plan = await ui.task("Preparing Playground demo", () => createDemoLaunchPlan(target, options), (value) => `Prepared ${value.name}`);
34
+ ui.section("Playground");
35
+ ui.keyValue("Plugin", plan.name);
36
+ ui.keyValue("Source", plan.source);
37
+ ui.keyValue("Slug", plan.slug);
38
+ ui.keyValue("WordPress", plan.wpVersion ?? "default");
39
+ ui.keyValue("PHP", plan.phpVersion ?? "default");
40
+ ui.keyValue("Site", ui.path(plan.siteDir));
41
+ if (plan.url) {
42
+ ui.keyValue("URL", ui.path(plan.url));
43
+ }
44
+ ui.keyValue("Blueprint", ui.path(plan.blueprintPath));
45
+ if (options.reset) {
46
+ await ui.task("Resetting persisted Playground site", () => resetPlaygroundSite(plan.siteDir), () => "Reset complete");
47
+ }
48
+ ui.info("Starting WordPress Playground. Press Ctrl+C to stop the local server.");
49
+ await execa(plan.command, plan.args, {
50
+ cwd: plan.cwd,
51
+ stdio: "inherit"
52
+ });
53
+ }
54
+ export async function createDemoLaunchPlan(target, options) {
55
+ const resolvedTarget = target ?? process.cwd();
56
+ if (isLocalPluginTarget(resolvedTarget)) {
57
+ const project = await discoverPluginProject(resolvedTarget);
58
+ const blueprintPath = await writeDemoBlueprint(project.slug, createLocalDemoBlueprint(project));
59
+ const playgroundOptions = resolveDemoPlaygroundOptions(options, {
60
+ wp: project.headers.requiresAtLeast ?? project.readme?.requiresAtLeast,
61
+ php: project.headers.requiresPhp ?? project.readme?.requiresPhp
62
+ });
63
+ const url = options.port ? `http://127.0.0.1:${options.port}` : undefined;
64
+ return {
65
+ source: "local",
66
+ name: project.headers.pluginName,
67
+ slug: project.slug,
68
+ command: "npx",
69
+ args: createPlaygroundStartArgs({
70
+ path: project.rootDir,
71
+ blueprintPath,
72
+ mount: `${project.rootDir}:/wordpress/wp-content/plugins/${project.slug}`,
73
+ options: playgroundOptions
74
+ }),
75
+ cwd: project.rootDir,
76
+ blueprintPath,
77
+ siteDir: getPlaygroundSiteDir(project.rootDir),
78
+ wpVersion: playgroundOptions.wp,
79
+ phpVersion: playgroundOptions.php,
80
+ url
81
+ };
82
+ }
83
+ const slug = slugFromHostedTarget(resolvedTarget);
84
+ const plugin = await fetchHostedPluginInfo(slug);
85
+ const blueprintPath = await writeDemoBlueprint(slug, createHostedDemoBlueprint(slug));
86
+ const demoDir = path.dirname(blueprintPath);
87
+ const playgroundOptions = resolveDemoPlaygroundOptions(options, {
88
+ wp: plugin.requires,
89
+ php: plugin.requiresPhp
90
+ });
91
+ const url = options.port ? `http://127.0.0.1:${options.port}` : undefined;
92
+ return {
93
+ source: "wordpress.org",
94
+ name: plugin.name,
95
+ slug,
96
+ command: "npx",
97
+ args: createPlaygroundStartArgs({
98
+ path: demoDir,
99
+ blueprintPath,
100
+ options: playgroundOptions
101
+ }),
102
+ cwd: demoDir,
103
+ blueprintPath,
104
+ siteDir: getPlaygroundSiteDir(demoDir),
105
+ wpVersion: playgroundOptions.wp,
106
+ phpVersion: playgroundOptions.php,
107
+ url
108
+ };
109
+ }
110
+ export function createLocalDemoBlueprint(project) {
111
+ const relativeMainFile = path.relative(project.rootDir, project.mainFile).split(path.sep).join("/");
112
+ return {
113
+ landingPage: "/wp-admin/plugins.php",
114
+ steps: [
115
+ ...createPlaygroundCompatibilitySteps(),
116
+ {
117
+ step: "activatePlugin",
118
+ pluginName: project.headers.pluginName,
119
+ pluginPath: `/wordpress/wp-content/plugins/${project.slug}/${relativeMainFile}`
120
+ }
121
+ ]
122
+ };
123
+ }
124
+ export function createHostedDemoBlueprint(slug) {
125
+ return {
126
+ landingPage: "/wp-admin/plugins.php",
127
+ steps: [
128
+ ...createPlaygroundCompatibilitySteps(),
129
+ {
130
+ step: "installPlugin",
131
+ pluginData: {
132
+ resource: "wordpress.org/plugins",
133
+ slug
134
+ },
135
+ options: {
136
+ activate: true
137
+ }
138
+ }
139
+ ]
140
+ };
141
+ }
142
+ export function createPlaygroundCompatibilitySteps() {
143
+ return [
144
+ {
145
+ step: "mkdir",
146
+ path: "/wordpress/wp-content/mu-plugins"
147
+ },
148
+ {
149
+ step: "writeFile",
150
+ path: compatibilityMuPluginPath,
151
+ data: compatibilityMuPlugin
152
+ }
153
+ ];
154
+ }
155
+ export function createPlaygroundStartArgs(input) {
156
+ return [
157
+ "--yes",
158
+ playgroundCliPackage,
159
+ "start",
160
+ `--path=${input.path}`,
161
+ `--blueprint=${input.blueprintPath}`,
162
+ "--define-bool",
163
+ "WP_DEBUG",
164
+ "false",
165
+ "--define-bool",
166
+ "WP_DEBUG_DISPLAY",
167
+ "false",
168
+ ...(input.mount ? ["--no-auto-mount", `--mount=${input.mount}`] : []),
169
+ ...(input.options.port ? [`--port=${input.options.port}`] : []),
170
+ ...(input.options.wp ? [`--wp=${input.options.wp}`] : []),
171
+ ...(input.options.php ? [`--php=${input.options.php}`] : []),
172
+ ...(input.options.skipBrowser ? ["--skip-browser"] : [])
173
+ ];
174
+ }
175
+ export function resolveDemoPlaygroundOptions(options, requiredVersions) {
176
+ return {
177
+ ...options,
178
+ wp: options.wp ?? normalizePlaygroundVersion(requiredVersions.wp),
179
+ php: options.php ?? normalizePlaygroundVersion(requiredVersions.php)
180
+ };
181
+ }
182
+ export function getPlaygroundSiteDir(projectPath) {
183
+ const siteId = createHash("sha256").update(projectPath).digest("hex");
184
+ return path.join(homedir(), ".wordpress-playground", "sites", siteId);
185
+ }
186
+ async function resetPlaygroundSite(siteDir) {
187
+ await rm(siteDir, { recursive: true, force: true });
188
+ }
189
+ async function writeDemoBlueprint(slug, blueprint) {
190
+ const cacheDir = await ensureCacheDir();
191
+ const demoDir = path.join(cacheDir, "demo", slug);
192
+ const blueprintPath = path.join(demoDir, "blueprint.json");
193
+ await mkdir(demoDir, { recursive: true, mode: 0o700 });
194
+ await writeFile(blueprintPath, `${JSON.stringify(blueprint, null, 2)}\n`);
195
+ return blueprintPath;
196
+ }
197
+ function isLocalPluginTarget(target) {
198
+ return target === "." || target.startsWith("..") || target.startsWith(`.${path.sep}`) || path.isAbsolute(target) || pathExists(target);
199
+ }
200
+ function normalizePlaygroundVersion(version) {
201
+ if (typeof version !== "string") {
202
+ return undefined;
203
+ }
204
+ const trimmed = version.trim();
205
+ return trimmed && trimmed !== "0" ? trimmed : undefined;
206
+ }
207
+ //# sourceMappingURL=demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo.js","sourceRoot":"","sources":["../../src/plugin/demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AACzD,MAAM,yBAAyB,GAAG,kEAAkE,CAAC;AACrG,MAAM,qBAAqB,GAAG;;;;;;;;;CAS7B,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,KA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,UAAU,CAAC,MAAM,CAAC,CAAC;AACzI,CAAC;AAED,SAAS,0BAA0B,CAAC,OAAgB;IAClD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { z } from "zod";
2
+ import type { PluginProject, ReadmeMetadata } from "../types.js";
3
+ declare const infoOptionsSchema: z.ZodObject<{
4
+ json: z.ZodDefault<z.ZodBoolean>;
5
+ }, z.core.$strip>;
6
+ export type InfoOptions = z.input<typeof infoOptionsSchema>;
7
+ export type LocalPluginInfo = {
8
+ source: "local";
9
+ rootDir: string;
10
+ mainFile: string;
11
+ readmePath?: string;
12
+ name: string;
13
+ slug: string;
14
+ version?: string;
15
+ description?: string;
16
+ author?: string;
17
+ pluginUri?: string;
18
+ authorUri?: string;
19
+ textDomain?: string;
20
+ domainPath?: string;
21
+ requiresAtLeast?: string;
22
+ requiresPhp?: string;
23
+ license?: string;
24
+ licenseUri?: string;
25
+ readme?: ReadmeMetadata;
26
+ };
27
+ export type HostedPluginInfo = {
28
+ source: "wordpress.org";
29
+ name: string;
30
+ slug: string;
31
+ version?: string;
32
+ author?: string;
33
+ authorProfile?: string;
34
+ homepage?: string;
35
+ pluginUrl: string;
36
+ downloadUrl?: string;
37
+ requires?: string;
38
+ tested?: string;
39
+ requiresPhp?: string;
40
+ activeInstalls?: number;
41
+ lastUpdated?: string;
42
+ added?: string;
43
+ rating?: number;
44
+ ratingPercent?: number;
45
+ ratingCount?: number;
46
+ supportThreads?: number;
47
+ supportThreadsResolved?: number;
48
+ tags: string[];
49
+ description?: string;
50
+ changelog?: string;
51
+ };
52
+ export type PluginInfo = LocalPluginInfo | HostedPluginInfo;
53
+ type PluginInfoApiResponse = {
54
+ error?: string;
55
+ name?: string;
56
+ slug?: string;
57
+ version?: string;
58
+ author?: string;
59
+ author_profile?: string;
60
+ requires?: string | boolean | null;
61
+ tested?: string;
62
+ requires_php?: string | boolean | null;
63
+ rating?: number;
64
+ num_ratings?: number;
65
+ support_threads?: number;
66
+ support_threads_resolved?: number;
67
+ active_installs?: number;
68
+ last_updated?: string;
69
+ added?: string;
70
+ homepage?: string;
71
+ sections?: {
72
+ description?: string;
73
+ changelog?: string;
74
+ };
75
+ download_link?: string;
76
+ tags?: Record<string, string> | string[];
77
+ };
78
+ export declare function info(target: string | undefined, rawOptions?: InfoOptions): Promise<void>;
79
+ export declare function getPluginInfo(target: string | undefined): Promise<PluginInfo>;
80
+ export declare function localPluginInfo(project: PluginProject): LocalPluginInfo;
81
+ export declare function fetchHostedPluginInfo(slug: string): Promise<HostedPluginInfo>;
82
+ export declare function hostedPluginInfoFromApi(body: PluginInfoApiResponse, fallbackSlug: string): HostedPluginInfo;
83
+ export declare function slugFromHostedTarget(target: string): string;
84
+ export {};
@@ -0,0 +1,209 @@
1
+ import path from "node:path";
2
+ import { z } from "zod";
3
+ import { discoverPluginProject } from "./discover.js";
4
+ import { ui } from "../ui.js";
5
+ import { pathExists } from "../utils/paths.js";
6
+ const infoOptionsSchema = z.object({
7
+ json: z.boolean().default(false)
8
+ });
9
+ export async function info(target, rawOptions = {}) {
10
+ const options = infoOptionsSchema.parse(rawOptions);
11
+ const result = options.json
12
+ ? await getPluginInfo(target)
13
+ : await ui.task("Reading plugin info", () => getPluginInfo(target), (value) => `Found ${value.name}`);
14
+ if (options.json) {
15
+ console.log(JSON.stringify(result, null, 2));
16
+ return;
17
+ }
18
+ printPluginInfo(result);
19
+ }
20
+ export async function getPluginInfo(target) {
21
+ const resolvedTarget = target ?? process.cwd();
22
+ if (isLocalPluginTarget(resolvedTarget)) {
23
+ return localPluginInfo(await discoverPluginProject(resolvedTarget));
24
+ }
25
+ return fetchHostedPluginInfo(slugFromHostedTarget(resolvedTarget));
26
+ }
27
+ export function localPluginInfo(project) {
28
+ return {
29
+ source: "local",
30
+ rootDir: project.rootDir,
31
+ mainFile: project.mainFile,
32
+ readmePath: project.readmePath,
33
+ name: project.headers.pluginName,
34
+ slug: project.slug,
35
+ version: project.version,
36
+ description: project.headers.description,
37
+ author: project.headers.author,
38
+ pluginUri: project.headers.pluginUri,
39
+ authorUri: project.headers.authorUri,
40
+ textDomain: project.headers.textDomain,
41
+ domainPath: project.headers.domainPath,
42
+ requiresAtLeast: project.headers.requiresAtLeast ?? project.readme?.requiresAtLeast,
43
+ requiresPhp: project.headers.requiresPhp ?? project.readme?.requiresPhp,
44
+ license: project.headers.license ?? project.readme?.license,
45
+ licenseUri: project.headers.licenseUri ?? project.readme?.licenseUri,
46
+ readme: project.readme
47
+ };
48
+ }
49
+ export async function fetchHostedPluginInfo(slug) {
50
+ const url = new URL("https://api.wordpress.org/plugins/info/1.2/");
51
+ url.searchParams.set("action", "plugin_information");
52
+ url.searchParams.set("request[slug]", slug);
53
+ const response = await fetch(url);
54
+ const body = (await response.json());
55
+ if (!response.ok || body.error) {
56
+ throw new Error(body.error ? `WordPress.org plugin not found: ${slug}` : `Could not fetch plugin info for ${slug}.`);
57
+ }
58
+ return hostedPluginInfoFromApi(body, slug);
59
+ }
60
+ export function hostedPluginInfoFromApi(body, fallbackSlug) {
61
+ const slug = body.slug ?? fallbackSlug;
62
+ return {
63
+ source: "wordpress.org",
64
+ name: body.name ?? slug,
65
+ slug,
66
+ version: body.version,
67
+ author: cleanText(body.author),
68
+ authorProfile: body.author_profile,
69
+ homepage: body.homepage,
70
+ pluginUrl: `https://wordpress.org/plugins/${slug}/`,
71
+ downloadUrl: body.download_link,
72
+ requires: normalizeApiVersion(body.requires),
73
+ tested: body.tested,
74
+ requiresPhp: normalizeApiVersion(body.requires_php),
75
+ activeInstalls: body.active_installs,
76
+ lastUpdated: body.last_updated,
77
+ added: body.added,
78
+ rating: body.rating === undefined ? undefined : body.rating / 20,
79
+ ratingPercent: body.rating,
80
+ ratingCount: body.num_ratings,
81
+ supportThreads: body.support_threads,
82
+ supportThreadsResolved: body.support_threads_resolved,
83
+ tags: normalizeTags(body.tags),
84
+ description: cleanText(body.sections?.description),
85
+ changelog: cleanText(body.sections?.changelog)
86
+ };
87
+ }
88
+ export function slugFromHostedTarget(target) {
89
+ try {
90
+ const url = new URL(target);
91
+ const parts = url.pathname.split("/").filter(Boolean);
92
+ const pluginIndex = parts.indexOf("plugins");
93
+ const slug = pluginIndex >= 0 ? parts[pluginIndex + 1] : parts.at(-1);
94
+ if (slug) {
95
+ return slug;
96
+ }
97
+ }
98
+ catch {
99
+ // Not a URL; treat it as a slug below.
100
+ }
101
+ return target.replace(/^\/+|\/+$/g, "");
102
+ }
103
+ function isLocalPluginTarget(target) {
104
+ return target === "." || target.startsWith("..") || target.startsWith(`.${path.sep}`) || path.isAbsolute(target) || pathExists(target);
105
+ }
106
+ function printPluginInfo(result) {
107
+ ui.section(result.name);
108
+ ui.keyValue("Source", result.source);
109
+ ui.keyValue("Slug", result.slug);
110
+ ui.keyValue("Version", result.version ?? "unknown");
111
+ if (result.source === "local") {
112
+ ui.keyValue("Path", ui.path(result.rootDir));
113
+ ui.keyValue("Main file", ui.path(path.relative(result.rootDir, result.mainFile)));
114
+ ui.keyValue("Readme", result.readmePath ? ui.path(path.relative(result.rootDir, result.readmePath)) : "missing");
115
+ ui.keyValue("Author", result.author ?? "unknown");
116
+ ui.keyValue("Text domain", result.textDomain ?? "unknown");
117
+ ui.keyValue("Requires WP", result.requiresAtLeast ?? "unknown");
118
+ ui.keyValue("Requires PHP", result.requiresPhp ?? "unknown");
119
+ ui.keyValue("Stable tag", result.readme?.stableTag ?? "unknown");
120
+ ui.keyValue("Tested up to", result.readme?.testedUpTo ?? "unknown");
121
+ ui.keyValue("License", result.license ?? "unknown");
122
+ printList("Tags", result.readme?.tags);
123
+ printList("Contributors", result.readme?.contributors);
124
+ printLongText("Description", result.description);
125
+ return;
126
+ }
127
+ ui.keyValue("Author", result.author ?? "unknown");
128
+ ui.keyValue("Active", formatActiveInstalls(result.activeInstalls));
129
+ ui.keyValue("Requires WP", result.requires ? `${result.requires}+` : "unknown");
130
+ ui.keyValue("Tested up to", result.tested ?? "unknown");
131
+ ui.keyValue("Requires PHP", result.requiresPhp ? `${result.requiresPhp}+` : "unknown");
132
+ ui.keyValue("Last updated", result.lastUpdated ?? "unknown");
133
+ ui.keyValue("Added", result.added ?? "unknown");
134
+ ui.keyValue("Rating", formatRating(result));
135
+ ui.keyValue("Support", formatSupport(result));
136
+ ui.keyValue("URL", ui.path(result.pluginUrl));
137
+ if (result.downloadUrl) {
138
+ ui.keyValue("Download", ui.path(result.downloadUrl));
139
+ }
140
+ printList("Tags", result.tags);
141
+ printLongText("Description", result.description);
142
+ }
143
+ function printList(label, values) {
144
+ if (!values || values.length === 0) {
145
+ ui.keyValue(label, "none");
146
+ return;
147
+ }
148
+ ui.keyValue(label, values.join(", "));
149
+ }
150
+ function printLongText(label, value) {
151
+ if (!value) {
152
+ return;
153
+ }
154
+ ui.section(label);
155
+ console.log(value);
156
+ }
157
+ function normalizeTags(tags) {
158
+ if (Array.isArray(tags)) {
159
+ return tags;
160
+ }
161
+ if (!tags) {
162
+ return [];
163
+ }
164
+ return Object.values(tags);
165
+ }
166
+ function cleanText(value) {
167
+ if (!value) {
168
+ return undefined;
169
+ }
170
+ const text = value
171
+ .replace(/<[^>]+>/g, " ")
172
+ .replace(/&nbsp;/g, " ")
173
+ .replace(/&amp;/g, "&")
174
+ .replace(/&quot;/g, '"')
175
+ .replace(/&#039;|&apos;/g, "'")
176
+ .replace(/&lt;/g, "<")
177
+ .replace(/&gt;/g, ">")
178
+ .replace(/&#(\d+);/g, (_match, code) => String.fromCodePoint(Number(code)))
179
+ .replace(/&#x([0-9a-f]+);/gi, (_match, code) => String.fromCodePoint(Number.parseInt(code, 16)))
180
+ .replace(/\s+/g, " ")
181
+ .trim();
182
+ return text || undefined;
183
+ }
184
+ function normalizeApiVersion(value) {
185
+ if (typeof value !== "string") {
186
+ return undefined;
187
+ }
188
+ const trimmed = value.trim();
189
+ return trimmed && trimmed !== "0" ? trimmed : undefined;
190
+ }
191
+ function formatActiveInstalls(value) {
192
+ if (value === undefined) {
193
+ return "unknown";
194
+ }
195
+ return `${new Intl.NumberFormat("en-US").format(value)}+`;
196
+ }
197
+ function formatRating(result) {
198
+ if (result.rating === undefined || result.ratingCount === undefined) {
199
+ return "unknown";
200
+ }
201
+ return `${result.rating.toFixed(1)}/5 (${result.ratingCount})`;
202
+ }
203
+ function formatSupport(result) {
204
+ if (result.supportThreads === undefined || result.supportThreadsResolved === undefined) {
205
+ return "unknown";
206
+ }
207
+ return `${result.supportThreadsResolved}/${result.supportThreads} resolved`;
208
+ }
209
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/plugin/info.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACjC,CAAC,CAAC;AA+EH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAA0B,EAAE,aAA0B,EAAE;IACjF,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI;QACzB,CAAC,CAAC,MAAM,aAAa,CAAC,MAAM,CAAC;QAC7B,CAA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AO,MAAM,CAAC,WAAW,GAAG,CAAC;AACjE,CAAC;AAED,SAAS,aAAa,CAAC,MAAwB;IAC7C,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,IAAI,MAAM,CAAC,sBAAsB,KAAK,SAAS,EAAE,CAAC;QACvF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,sBAAsB,IAAI,MAAM,CAAC,cAAc,WAAW,CAAC;AAC9E,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "pressship",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Submit and release WordPress.org plugins from the command line.",
5
5
  "bin": {
6
6
  "pressship": "dist/cli.js"
7
7
  },
8
8
  "files": [
9
+ ".claude",
9
10
  "assets",
10
11
  "dist",
11
12
  "README.md",
@@ -17,6 +18,9 @@
17
18
  "build": "tsc -p tsconfig.json",
18
19
  "browsers:install": "playwright install chromium",
19
20
  "dev": "tsx src/cli.ts",
21
+ "docs:build": "npm run build --prefix website",
22
+ "docs:dev": "npm run start --prefix website",
23
+ "docs:serve": "npm run serve --prefix website",
20
24
  "test": "vitest run",
21
25
  "typecheck": "tsc -p tsconfig.json --noEmit"
22
26
  },