@extenshi/cli 0.23.0 → 0.24.0

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.
Files changed (64) hide show
  1. package/dist/amo-source.d.ts +88 -17
  2. package/dist/amo-source.d.ts.map +1 -1
  3. package/dist/amo-source.js +437 -116
  4. package/dist/amo-source.js.map +1 -1
  5. package/dist/cli.js +44 -13
  6. package/dist/cli.js.map +1 -1
  7. package/dist/compliance-review.d.ts +5 -1
  8. package/dist/compliance-review.d.ts.map +1 -1
  9. package/dist/compliance-review.js +10 -5
  10. package/dist/compliance-review.js.map +1 -1
  11. package/dist/cws-policies.d.ts.map +1 -1
  12. package/dist/cws-policies.js +4 -0
  13. package/dist/cws-policies.js.map +1 -1
  14. package/dist/listing-checks.d.ts +15 -9
  15. package/dist/listing-checks.d.ts.map +1 -1
  16. package/dist/listing-checks.js +54 -46
  17. package/dist/listing-checks.js.map +1 -1
  18. package/dist/listing.d.ts +48 -0
  19. package/dist/listing.d.ts.map +1 -1
  20. package/dist/listing.js +201 -23
  21. package/dist/listing.js.map +1 -1
  22. package/dist/pay-contract.d.ts +3 -3
  23. package/dist/pay-contract.d.ts.map +1 -1
  24. package/dist/pay-contract.js +2 -1
  25. package/dist/pay-contract.js.map +1 -1
  26. package/dist/pay-test-cycle.d.ts.map +1 -1
  27. package/dist/pay-test-cycle.js +6 -1
  28. package/dist/pay-test-cycle.js.map +1 -1
  29. package/dist/png.d.ts +40 -0
  30. package/dist/png.d.ts.map +1 -0
  31. package/dist/png.js +208 -0
  32. package/dist/png.js.map +1 -0
  33. package/dist/review-checks.d.ts +48 -13
  34. package/dist/review-checks.d.ts.map +1 -1
  35. package/dist/review-checks.js +364 -56
  36. package/dist/review-checks.js.map +1 -1
  37. package/dist/review-risk.d.ts +8 -3
  38. package/dist/review-risk.d.ts.map +1 -1
  39. package/dist/review-risk.js +14 -4
  40. package/dist/review-risk.js.map +1 -1
  41. package/dist/review-stores.d.ts +63 -0
  42. package/dist/review-stores.d.ts.map +1 -0
  43. package/dist/review-stores.js +92 -0
  44. package/dist/review-stores.js.map +1 -0
  45. package/dist/scan.d.ts +8 -11
  46. package/dist/scan.d.ts.map +1 -1
  47. package/dist/scan.js +8 -11
  48. package/dist/scan.js.map +1 -1
  49. package/dist/screenshots-scenes.d.ts +13 -0
  50. package/dist/screenshots-scenes.d.ts.map +1 -1
  51. package/dist/screenshots-scenes.js +20 -2
  52. package/dist/screenshots-scenes.js.map +1 -1
  53. package/dist/screenshots.d.ts +6 -4
  54. package/dist/screenshots.d.ts.map +1 -1
  55. package/dist/screenshots.js +31 -10
  56. package/dist/screenshots.js.map +1 -1
  57. package/dist/store-assets.d.ts.map +1 -1
  58. package/dist/store-assets.js +7 -3
  59. package/dist/store-assets.js.map +1 -1
  60. package/dist/telemetry.d.ts +7 -0
  61. package/dist/telemetry.d.ts.map +1 -1
  62. package/dist/telemetry.js +8 -0
  63. package/dist/telemetry.js.map +1 -1
  64. package/package.json +1 -1
@@ -1,34 +1,77 @@
1
1
  /**
2
- * `extenshi amo-source <project-dir> [--out <path>]` — produce the AMO
3
- * source-code archive + BUILD.md reviewer instructions.
2
+ * `extenshi amo-source <project-dir> [--out <path>] [--build <cmd>] [--verify <package>]`
3
+ * — produce the AMO source-code archive + BUILD.md reviewer instructions, and
4
+ * optionally prove a reviewer can rebuild the package from it.
4
5
  *
5
6
  * AMO requires reviewable source for any minified/bundled/transpiled code so a
6
7
  * reviewer can rebuild the extension and diff it against the submitted
7
8
  * package: https://extensionworkshop.com/documentation/publish/source-code-submission/
8
9
  *
9
- * This command does NOT run the build itself and does NOT talk to AMO's API
10
- * (that is `publisher/src/services/firefox.ts`, owned separately). It only:
11
- * 1. archives the project's tracked-looking source (excluding node_modules,
12
- * dist, .git, dotenv secrets, and any top-level directory the project's
13
- * own .gitignore names plainly — e.g. `dist-firefox/`, `dist-edge/`),
14
- * 2. writes BUILD.md with the exact commands a reviewer needs (Node/npm
15
- * versions, package manager + lockfile, the build script from
16
- * package.json), and
10
+ * This command does NOT talk to AMO's API (that is
11
+ * `publisher/src/services/firefox.ts`, owned separately). It:
12
+ * 1. archives the project's source — in a git repository `git archive HEAD`
13
+ * (.gitignore, nested ignore files, export-ignore and untracked build
14
+ * output all stay out); outside git, every file minus
15
+ * node_modules/dist-style directories and what the top-level .gitignore
16
+ * names. Dotenv files, symlinks and files over 25 MB never go in, and the
17
+ * result lists each one it left out;
18
+ * 2. writes BUILD.md with the commands a reviewer needs (Node/npm versions,
19
+ * package manager + lockfile, the build command);
17
20
  * 3. flags vendored minified files that carry no reproducible-build
18
- * provenance as BLOCKERS — the developer must vendor their source (e.g.
19
- * under vendor-src/) before submitting.
21
+ * provenance as BLOCKERS — unless their source is vendored under
22
+ * `vendor-src/<name>/` (optionally pinned by a `SOURCE_COMMIT` file), the
23
+ * layout these docs tell developers to use;
24
+ * 4. with `--verify <package>`, unpacks the archive into an empty directory,
25
+ * runs the install + build there, and compares the rebuilt package's
26
+ * SHA-256 with the one you are about to upload.
20
27
  *
21
- * If the project directory is a clean git working tree, the archive is
22
- * refused when there are uncommitted changes (matching the pattern this repo
23
- * already uses for its own extension projects) — the archive should match a
24
- * commit a reviewer can also check out. A directory that is not a git repo at
25
- * all is archived as-is; there is nothing to compare it against.
28
+ * If the project directory is a git working tree, the archive is refused when
29
+ * there are uncommitted changes — the archive should match a commit a reviewer
30
+ * can also check out. A directory that is not a git repo at all is archived
31
+ * as-is; there is nothing to compare it against.
26
32
  */
27
33
  import { type MinifiedFileFinding } from './amo-source-detect.js';
28
34
  export interface AmoSourceOptions {
29
35
  projectDir: string;
30
36
  /** Where to write the archive. Default: `amo-source.zip` in the current directory. */
31
37
  outputPath?: string;
38
+ /**
39
+ * The build step a reviewer runs after installing (BUILD.md, and `--verify`).
40
+ * Default: `npm run build` when package.json has a build script.
41
+ */
42
+ buildCommand?: string;
43
+ /**
44
+ * The package you will upload, relative to the project (e.g.
45
+ * `deploy-firefox.zip`). Rebuild it in a clean directory from the archive and
46
+ * compare SHA-256 digests.
47
+ */
48
+ verifyPackage?: string;
49
+ /** Discard the clean-room install/build output instead of streaming it to stderr. */
50
+ quiet?: boolean;
51
+ }
52
+ /** A minified file whose source is vendored under `vendor-src/`. */
53
+ export interface VendoredBundle extends MinifiedFileFinding {
54
+ /** `vendor-src/<name>` — the directory holding its source. */
55
+ sourceDir: string;
56
+ /** The upstream commit pinned in `<sourceDir>/SOURCE_COMMIT`, when there is one. */
57
+ sourceCommit?: string;
58
+ /** Which rule tied the file to its source: the build config names it, or the directory name does. */
59
+ matchedBy: 'build config' | 'name';
60
+ }
61
+ export interface VerifyResult {
62
+ /** Project-relative path of the package that was compared. */
63
+ packagePath: string;
64
+ /** SHA-256 of the package in the project — the one you upload. */
65
+ expected: string;
66
+ /** SHA-256 of the package rebuilt from the archive, or null when the build did not produce it. */
67
+ actual: string | null;
68
+ match: boolean;
69
+ /** What ran in the clean room, in order. */
70
+ commands: string[];
71
+ /** Kept for inspection when the rebuild did not match; removed otherwise. */
72
+ cleanRoom?: string;
73
+ /** Why the rebuild failed, when it did. */
74
+ error?: string;
32
75
  }
33
76
  export interface AmoSourceResult {
34
77
  zipPath: string;
@@ -36,6 +79,34 @@ export interface AmoSourceResult {
36
79
  fileCount: number;
37
80
  blockers: MinifiedFileFinding[];
38
81
  reproducible: MinifiedFileFinding[];
82
+ /** Minified files recognised as rebuilt from `vendor-src/` (subset of `reproducible`). */
83
+ vendored: VendoredBundle[];
84
+ /** Files the archive leaves out (dotenv, symlinks, over 25 MB), with the reason. */
85
+ skipped: SkippedFile[];
86
+ verification?: VerifyResult;
87
+ }
88
+ interface IgnoreRule {
89
+ re: RegExp;
90
+ negate: boolean;
91
+ dirOnly: boolean;
92
+ }
93
+ /**
94
+ * The top-level `.gitignore` of a project that is NOT a git repository, read
95
+ * the way git reads it: comments, `!` negation, trailing `/` for directories,
96
+ * a leading or inner `/` anchoring the pattern to the root, `*`, `?`, `**`,
97
+ * last match wins. Character classes (`[abc]`) and backslash escapes are not
98
+ * supported; such a pattern matches literally, so the file stays IN the archive
99
+ * (the safe direction). Inside a repository none of this runs — `git ls-files`
100
+ * already applies every ignore file git knows about.
101
+ */
102
+ export declare function compileGitignore(raw: string): IgnoreRule[];
103
+ /** `rel` is a project-relative posix path. */
104
+ export declare function isGitignored(rel: string, isDir: boolean, rules: readonly IgnoreRule[]): boolean;
105
+ /** A file left out of the archive, and why — reported, never dropped silently. */
106
+ export interface SkippedFile {
107
+ path: string;
108
+ reason: string;
39
109
  }
40
110
  export declare function runAmoSource(opts: AmoSourceOptions): Promise<AmoSourceResult>;
111
+ export {};
41
112
  //# sourceMappingURL=amo-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"amo-source.d.ts","sourceRoot":"","sources":["../src/amo-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAsDtF,MAAM,WAAW,gBAAgB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,mBAAmB,EAAE,CAAA;IAC/B,YAAY,EAAE,mBAAmB,EAAE,CAAA;CACnC;AAyJD,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAuCnF"}
1
+ {"version":3,"file":"amo-source.d.ts","sourceRoot":"","sources":["../src/amo-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAQH,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AA2BtF,MAAM,WAAW,gBAAgB;IAChC,UAA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