ssqch 0.7.1 → 0.9.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 (155) hide show
  1. package/README.md +8 -4
  2. package/bin/ssqch.js +14 -48
  3. package/bundled/README.md +1314 -0
  4. package/bundled/completions/bash +840 -0
  5. package/bundled/completions/elvish +286 -0
  6. package/bundled/completions/fish +182 -0
  7. package/bundled/completions/powershell +318 -0
  8. package/bundled/completions/zsh +510 -0
  9. package/bundled/ssqch.d.ts +540 -0
  10. package/bundled/starter/engines/index.edge +11 -0
  11. package/bundled/starter/engines/index.ejs +11 -0
  12. package/bundled/starter/engines/index.hbs +11 -0
  13. package/bundled/starter/engines/index.liquid +11 -0
  14. package/bundled/starter/engines/layout.edge +35 -0
  15. package/bundled/starter/engines/layout.ejs +35 -0
  16. package/bundled/starter/engines/layout.hbs +35 -0
  17. package/bundled/starter/engines/layout.liquid +35 -0
  18. package/bundled/starter/gitignore +3 -0
  19. package/bundled/starter/jsconfig.json +11 -0
  20. package/bundled/starter/src/404.md +8 -0
  21. package/bundled/starter/src/_blueprints/posts.md +5 -0
  22. package/bundled/starter/src/_data/site.json +4 -0
  23. package/bundled/starter/src/_includes/layout.jinja +35 -0
  24. package/bundled/starter/src/index.jinja +11 -0
  25. package/bundled/starter/src/posts/i-know-what-i-saw.md +11 -0
  26. package/bundled/starter/src/posts/posts.json +4 -0
  27. package/bundled/starter/src/posts/raiders-of-the-lost-path.md +27 -0
  28. package/bundled/starter/src/posts/the-cache-of-the-wild.md +26 -0
  29. package/bundled/starter/src/posts/the-stump-has-moved.md +15 -0
  30. package/bundled/starter/src/posts/upon-further-review-a-stump.md +18 -0
  31. package/bundled/starter/ssqch.config.js +29 -0
  32. package/bundled/starter-docs/engines/edge/base.edge +41 -0
  33. package/bundled/starter-docs/engines/edge/containers/details.edge +5 -0
  34. package/bundled/starter-docs/engines/edge/containers/tab.edge +4 -0
  35. package/bundled/starter-docs/engines/edge/containers/tabs.edge +5 -0
  36. package/bundled/starter-docs/engines/edge/doc.edge +59 -0
  37. package/bundled/starter-docs/engines/edge/hooks/heading.edge +2 -0
  38. package/bundled/starter-docs/engines/ejs/base.ejs +41 -0
  39. package/bundled/starter-docs/engines/ejs/containers/details.ejs +5 -0
  40. package/bundled/starter-docs/engines/ejs/containers/tab.ejs +4 -0
  41. package/bundled/starter-docs/engines/ejs/containers/tabs.ejs +5 -0
  42. package/bundled/starter-docs/engines/ejs/doc.ejs +59 -0
  43. package/bundled/starter-docs/engines/ejs/hooks/heading.ejs +2 -0
  44. package/bundled/starter-docs/engines/hbs/base.hbs +41 -0
  45. package/bundled/starter-docs/engines/hbs/containers/details.hbs +5 -0
  46. package/bundled/starter-docs/engines/hbs/containers/tab.hbs +4 -0
  47. package/bundled/starter-docs/engines/hbs/containers/tabs.hbs +5 -0
  48. package/bundled/starter-docs/engines/hbs/doc.hbs +58 -0
  49. package/bundled/starter-docs/engines/hbs/hooks/heading.hbs +2 -0
  50. package/bundled/starter-docs/engines/liquid/base.liquid +41 -0
  51. package/bundled/starter-docs/engines/liquid/containers/details.liquid +5 -0
  52. package/bundled/starter-docs/engines/liquid/containers/tab.liquid +4 -0
  53. package/bundled/starter-docs/engines/liquid/containers/tabs.liquid +5 -0
  54. package/bundled/starter-docs/engines/liquid/doc.liquid +60 -0
  55. package/bundled/starter-docs/engines/liquid/hooks/heading.liquid +2 -0
  56. package/bundled/starter-docs/gitignore +4 -0
  57. package/bundled/starter-docs/src/404.md +12 -0
  58. package/bundled/starter-docs/src/_blueprints/docs.md +5 -0
  59. package/bundled/starter-docs/src/_data/nav.yml +10 -0
  60. package/bundled/starter-docs/src/_data/site.json +5 -0
  61. package/bundled/starter-docs/src/_includes/base.jinja +41 -0
  62. package/bundled/starter-docs/src/_includes/containers/details.jinja +5 -0
  63. package/bundled/starter-docs/src/_includes/containers/tab.jinja +4 -0
  64. package/bundled/starter-docs/src/_includes/containers/tabs.jinja +5 -0
  65. package/bundled/starter-docs/src/_includes/doc.jinja +59 -0
  66. package/bundled/starter-docs/src/_includes/hooks/heading.jinja +2 -0
  67. package/bundled/starter-docs/src/assets/docs.css +257 -0
  68. package/bundled/starter-docs/src/assets/docs.js +67 -0
  69. package/bundled/starter-docs/src/docs/docs.json +1 -0
  70. package/bundled/starter-docs/src/docs/guides/deploying.md +77 -0
  71. package/bundled/starter-docs/src/docs/guides/writing.md +65 -0
  72. package/bundled/starter-docs/src/docs/index.md +29 -0
  73. package/bundled/starter-docs/src/docs/install.md +42 -0
  74. package/bundled/starter-docs/src/index.md +13 -0
  75. package/bundled/starter-docs/ssqch.config.js +40 -0
  76. package/bundled/trailheads/from-component-frameworks.md +116 -0
  77. package/bundled/trailheads/from-docusaurus.md +55 -0
  78. package/bundled/trailheads/from-eleventy.md +140 -0
  79. package/bundled/trailheads/from-hexo.md +92 -0
  80. package/bundled/trailheads/from-jekyll.md +79 -0
  81. package/bundled/trailheads/from-mkdocs.md +45 -0
  82. package/bundled/trailheads/from-zola.md +71 -0
  83. package/lib/assets.js +235 -3
  84. package/lib/chunk-3A647I3N.js +384 -0
  85. package/lib/chunk-3GYLOC6Y.js +1017 -0
  86. package/lib/chunk-3K3ANWZ2.js +118 -0
  87. package/lib/chunk-3NYSSA2C.js +22 -0
  88. package/lib/chunk-47P4YREZ.js +1287 -0
  89. package/lib/chunk-4Q6WMTER.js +32 -0
  90. package/lib/chunk-76NTVE34.js +338 -0
  91. package/lib/chunk-7PWCYHTJ.js +1350 -0
  92. package/lib/chunk-7RDRZHJD.js +217 -0
  93. package/lib/chunk-7SD7K567.js +57 -0
  94. package/lib/chunk-7XLK2GEG.js +54 -0
  95. package/lib/chunk-AD3HAW3W.js +10 -0
  96. package/lib/chunk-BEGC7YP6.js +502 -0
  97. package/lib/chunk-CMUWRPSQ.js +113 -0
  98. package/lib/chunk-CZ4XQC56.js +999 -0
  99. package/lib/chunk-D2XE2GTY.js +71 -0
  100. package/lib/chunk-DDV6JEC2.js +46 -0
  101. package/lib/chunk-DELWRJAO.js +37409 -0
  102. package/lib/chunk-DELWRJAO.js.LEGAL.txt +27 -0
  103. package/lib/chunk-F65YUXZ7.js +334 -0
  104. package/lib/chunk-FVZ5JBRI.js +115 -0
  105. package/lib/chunk-GRWMGC7D.js +4435 -0
  106. package/lib/chunk-GRWMGC7D.js.LEGAL.txt +41 -0
  107. package/lib/chunk-GUKSZ2XM.js +207 -0
  108. package/lib/chunk-HPXAZ2HU.js +251 -0
  109. package/lib/chunk-HXCLCXRT.js +20 -0
  110. package/lib/chunk-I3PS26CI.js +48 -0
  111. package/lib/chunk-IAFM5ITE.js +11 -0
  112. package/lib/chunk-II5DEH3Q.js +209 -0
  113. package/lib/chunk-IJWHOFRP.js +44 -0
  114. package/lib/chunk-LPHNACE4.js +29 -0
  115. package/lib/chunk-MI6EJWA2.js +175 -0
  116. package/lib/chunk-NCWFYT74.js +1541 -0
  117. package/lib/chunk-NKXEPHRZ.js +136 -0
  118. package/lib/chunk-NNUKIGOO.js +160 -0
  119. package/lib/chunk-R7K3D5W5.js +3957 -0
  120. package/lib/chunk-RNJFPFXE.js +29 -0
  121. package/lib/chunk-SF4I6Z7S.js +25 -0
  122. package/lib/chunk-SURPOAW7.js +44 -0
  123. package/lib/chunk-SXMJ52IK.js +572 -0
  124. package/lib/chunk-TICWN55Z.js +20 -0
  125. package/lib/chunk-TVU3OPPK.js +146 -0
  126. package/lib/chunk-UU43WIZG.js +29 -0
  127. package/lib/chunk-VJWQSYEG.js +119 -0
  128. package/lib/chunk-XMXBHXZR.js +75 -0
  129. package/lib/chunk-YTHQBMDJ.js +211 -0
  130. package/lib/cli.js +547 -0
  131. package/lib/elements.js +180 -3
  132. package/lib/image.js +27 -3
  133. package/lib/links.js +464 -3
  134. package/lib/minify.js +69 -3
  135. package/lib/redirects.js +152 -3
  136. package/lib/rss.js +139 -3
  137. package/lib/sass.js +256 -3
  138. package/lib/sitemap.js +113 -3
  139. package/lib/ssqch.js +28 -0
  140. package/package.json +83 -80
  141. package/src/serve/live.js +174 -0
  142. package/src/serve/not-found.html +31 -0
  143. package/types/globals.d.ts +3 -2
  144. package/types/image.d.ts +7 -3
  145. package/types/index.d.ts +28 -9
  146. package/types/links.d.ts +1 -1
  147. package/types/minify.d.ts +1 -1
  148. package/types/rss.d.ts +1 -1
  149. package/types/sass.d.ts +1 -1
  150. package/types/sitemap.d.ts +2 -0
  151. package/wasm/markdown.wasm +0 -0
  152. package/wasm/minify.wasm +0 -0
  153. package/wasm/sass.wasm +0 -0
  154. package/lib/index.js +0 -3
  155. package/platforms.json +0 -6
@@ -0,0 +1,41 @@
1
+ Bundled license information:
2
+
3
+ smol-toml/dist/error.js:
4
+ smol-toml/dist/primitive.js:
5
+ smol-toml/dist/date.js:
6
+ smol-toml/dist/extract.js:
7
+ smol-toml/dist/util.js:
8
+ smol-toml/dist/struct.js:
9
+ smol-toml/dist/parse.js:
10
+ smol-toml/dist/stringify.js:
11
+ smol-toml/dist/index.js:
12
+ /*!
13
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ *
16
+ * Redistribution and use in source and binary forms, with or without
17
+ * modification, are permitted provided that the following conditions are met:
18
+ *
19
+ * 1. Redistributions of source code must retain the above copyright notice, this
20
+ * list of conditions and the following disclaimer.
21
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22
+ * this list of conditions and the following disclaimer in the
23
+ * documentation and/or other materials provided with the distribution.
24
+ * 3. Neither the name of the copyright holder nor the names of its contributors
25
+ * may be used to endorse or promote products derived from this software without
26
+ * specific prior written permission.
27
+ *
28
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ */
39
+
40
+ js-yaml/dist/js-yaml.mjs:
41
+ /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
@@ -0,0 +1,207 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ warn,
5
+ warning
6
+ } from "./chunk-GRWMGC7D.js";
7
+ import {
8
+ compareText,
9
+ realPath
10
+ } from "./chunk-VJWQSYEG.js";
11
+
12
+ // src/serve/live.ts
13
+ import crypto from "node:crypto";
14
+ import fs from "node:fs";
15
+ import path from "node:path";
16
+ import { setTimeout as sleep } from "node:timers/promises";
17
+ var sameStamp = (a, b) => a === void 0 || b === void 0 ? a === b : a[0] === b[0] && a[1] === b[1];
18
+ function isAsset(file) {
19
+ const ext = path.extname(file);
20
+ return ext === ".css" || ext === ".js" || ext === ".mjs";
21
+ }
22
+ function fingerprint(file) {
23
+ try {
24
+ return crypto.createHash("sha1").update(fs.readFileSync(file)).digest("base64");
25
+ } catch {
26
+ return void 0;
27
+ }
28
+ }
29
+ function stamp(file, stat) {
30
+ return [stat.size, isAsset(file) ? fingerprint(file) ?? 0 : stat.mtimeMs];
31
+ }
32
+ function walk(dir, each) {
33
+ const visit = (folder, prefix) => {
34
+ let entries;
35
+ try {
36
+ entries = fs.readdirSync(folder, { withFileTypes: true });
37
+ } catch {
38
+ return;
39
+ }
40
+ for (const entry of entries) {
41
+ const file = path.join(folder, entry.name);
42
+ if (entry.isDirectory()) visit(file, `${prefix}${entry.name}/`);
43
+ else if (entry.isFile()) {
44
+ const stat = fs.statSync(file, { throwIfNoEntry: false });
45
+ if (stat) each(`${prefix}${entry.name}`, file, stat);
46
+ }
47
+ }
48
+ };
49
+ visit(dir, "");
50
+ }
51
+ function assetStamps(output) {
52
+ const found = /* @__PURE__ */ new Map();
53
+ walk(realPath(output), (_, file, stat) => {
54
+ if (isAsset(file)) found.set(file, [stat.size, stat.mtimeMs]);
55
+ });
56
+ return found;
57
+ }
58
+ function sameStamps(a, b) {
59
+ if (a.size !== b.size) return false;
60
+ for (const [file, at] of a) {
61
+ const other = b.get(file);
62
+ if (!other || other[0] !== at[0] || other[1] !== at[1]) return false;
63
+ }
64
+ return true;
65
+ }
66
+ async function settled(files) {
67
+ const look = (file) => {
68
+ const stat = fs.statSync(file, { throwIfNoEntry: false });
69
+ return stat ? stamp(file, stat) : void 0;
70
+ };
71
+ const start = performance.now();
72
+ const last = files.map(look);
73
+ const done = files.map(() => false);
74
+ while (done.includes(false)) {
75
+ await sleep(40);
76
+ const late = performance.now() - start > 1e3;
77
+ files.forEach((file, i) => {
78
+ if (done[i]) return;
79
+ const now = look(file);
80
+ done[i] = late || now === void 0 || sameStamp(now, last[i]) && now[0] > 0;
81
+ last[i] = now;
82
+ });
83
+ }
84
+ return last;
85
+ }
86
+ function missingMessage(url, tools, output) {
87
+ if (tools.length === 0) return `${url} is linked but nothing wrote it to ${output}. If a tool makes it, run its watcher with \`serve.run\` (see "CSS and JavaScript" in the README)`;
88
+ if (tools.length === 1) return `${url} is linked but isn't in ${output}: serve.run's ${tools[0]} hasn't written it (its output is in the terminal)`;
89
+ return `${url} is linked but isn't in ${output}: none of serve.run's ${tools.slice(0, -1).join(", ")} or ${tools[tools.length - 1]} has written it (their output is in the terminal)`;
90
+ }
91
+ var PAGES = /* @__PURE__ */ new Set(["html", "htm", "xml", "txt", "json", "map", "webmanifest"]);
92
+ var Live = class {
93
+ /** Goes up with everything a browser should hear about. */
94
+ id;
95
+ /** The last build's error, until a build works. */
96
+ error = null;
97
+ /** Each file in the output as it was last seen (`stamp`), by its path from the output folder. */
98
+ seen = /* @__PURE__ */ new Map();
99
+ /** The `id` at which each file last changed (or went away). */
100
+ changedAt = /* @__PURE__ */ new Map();
101
+ /** Stylesheets and scripts a page linked that weren't in the output, by their path from the output folder, with the URL a page used. */
102
+ missingFiles = /* @__PURE__ */ new Map();
103
+ /** The `serve.run` tools (`tailwindcss`), and the output folder as shown, for what's said about a missing file. */
104
+ tools = [];
105
+ outputName = "";
106
+ /**
107
+ * Counting from `id`: by default from now, in milliseconds since 1970. A browser that was
108
+ * watching an earlier server holds a smaller number, so it reloads once this one has built
109
+ * (with the new server's CSS), even when it had seen as many updates as this one has made.
110
+ */
111
+ constructor(id = Date.now()) {
112
+ this.id = id;
113
+ }
114
+ /** Who could write a missing file: the `serve.run` tools, and the output folder's name. */
115
+ setSite(tools, outputName) {
116
+ this.tools = tools;
117
+ this.outputName = outputName;
118
+ }
119
+ /** A page linked `url` (the file `rel` in the output), and it wasn't there. The message, said in the terminal the first time. */
120
+ missing(rel, url) {
121
+ const message = missingMessage(url, this.tools, this.outputName);
122
+ if (!this.missingFiles.has(rel)) warn(warning("missing-asset", message));
123
+ this.missingFiles.set(rel, url);
124
+ return message;
125
+ }
126
+ /** After a build: the files pages linked that still aren't in `output`, said again (so they don't scroll away); the ones that turned up are forgotten. */
127
+ repeatMissing(output) {
128
+ for (const rel of [...this.missingFiles.keys()]) {
129
+ if (fs.statSync(path.join(output, rel), { throwIfNoEntry: false })?.isFile()) this.missingFiles.delete(rel);
130
+ }
131
+ for (const rel of [...this.missingFiles.keys()].sort(compareText)) {
132
+ warn(warning("missing-asset", missingMessage(this.missingFiles.get(rel), this.tools, this.outputName)));
133
+ }
134
+ }
135
+ /**
136
+ * The output may have changed: a build finished, or another tool wrote there. Look at every
137
+ * file, and note the ones that differ (which this returns). A stylesheet or script that
138
+ * differs is looked at again once it has stopped changing, so browsers never fetch one half
139
+ * written.
140
+ */
141
+ async changed(output) {
142
+ const now = /* @__PURE__ */ new Map();
143
+ walk(output, (rel, file, stat) => now.set(rel, stamp(file, stat)));
144
+ const differs = () => {
145
+ const out = [];
146
+ for (const [file, at] of now) if (!sameStamp(this.seen.get(file), at)) out.push(file);
147
+ for (const file of this.seen.keys()) if (!now.has(file)) out.push(file);
148
+ return out;
149
+ };
150
+ const writing = differs().filter((file) => now.has(file) && isAsset(file));
151
+ const stamps = await settled(writing.map((file) => path.join(output, file)));
152
+ writing.forEach((file, i) => {
153
+ const at = stamps[i];
154
+ if (at) now.set(file, at);
155
+ else now.delete(file);
156
+ });
157
+ const changed = differs();
158
+ if (!changed.length && this.error === null) return changed;
159
+ this.id += 1;
160
+ this.error = null;
161
+ for (const file of changed) this.changedAt.set(file, this.id);
162
+ this.seen = now;
163
+ return changed;
164
+ }
165
+ /** A build failed: the output is as it was, and browsers show `error`. */
166
+ failed(error) {
167
+ this.id += 1;
168
+ this.error = error;
169
+ }
170
+ /** The size the file `rel` had when it was last looked at. */
171
+ sizeSeen(rel) {
172
+ return this.seen.get(rel)?.[0];
173
+ }
174
+ /**
175
+ * The answer for a browser that last heard `since` and is showing the page in `page` (a file
176
+ * in the output): the `id` now, the build's `error`, whether to `reload`, and the stylesheets
177
+ * (`css`, as URLs) to fetch again. A page reloads when its own file changed, or a file that
178
+ * isn't a page or a stylesheet (a script, an image: any page may use it).
179
+ */
180
+ answer(since, page, base) {
181
+ let reload = false;
182
+ const css = [];
183
+ if (since !== void 0 && since > this.id) reload = true;
184
+ else if (since !== void 0) {
185
+ const known = this.seen.has(page);
186
+ for (const [file, at] of this.changedAt) {
187
+ if (at <= since) continue;
188
+ const dot = file.lastIndexOf(".");
189
+ const kind = dot === -1 ? "" : file.slice(dot + 1);
190
+ if (file === page) reload = true;
191
+ else if (kind === "css") css.push(`${base}/${file}`);
192
+ else if (PAGES.has(kind)) reload ||= !known;
193
+ else reload = true;
194
+ }
195
+ }
196
+ css.sort(compareText);
197
+ return { id: this.id, error: this.error, reload, css };
198
+ }
199
+ };
200
+
201
+ export {
202
+ isAsset,
203
+ fingerprint,
204
+ assetStamps,
205
+ sameStamps,
206
+ Live
207
+ };
@@ -0,0 +1,251 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ quoted
5
+ } from "./chunk-CMUWRPSQ.js";
6
+ import {
7
+ bail
8
+ } from "./chunk-GRWMGC7D.js";
9
+
10
+ // src/glob.ts
11
+ var stripDot = (p) => p.replace(/^(\.\/)+/, "");
12
+ var GlobProblem = class extends Error {
13
+ };
14
+ var UNOPENED = "unopened alternate group; missing '{' (maybe escape '}' with '[}]'?)";
15
+ var UNCLOSED = "unclosed alternate group; missing '}' (maybe escape '{' with '[{]'?)";
16
+ function parse(glob, windows) {
17
+ const isSeparator = (c) => c === "/" || windows && c === "\\";
18
+ const chars = [...glob];
19
+ let at = 0;
20
+ let prev, cur;
21
+ const bump = () => {
22
+ prev = cur;
23
+ cur = chars[at++];
24
+ return cur;
25
+ };
26
+ const peek = () => chars[at];
27
+ const stack = [];
28
+ const branches = [[]];
29
+ const push = (token) => {
30
+ const last = branches[branches.length - 1];
31
+ if (!last) throw new GlobProblem(UNOPENED);
32
+ last.push(token);
33
+ };
34
+ const star = () => {
35
+ const before = prev;
36
+ if (peek() !== "*") return push({ kind: "zeroOrMore" });
37
+ bump();
38
+ if (!branches[branches.length - 1].length) {
39
+ if (peek() !== void 0 && !isSeparator(peek())) {
40
+ push({ kind: "zeroOrMore" });
41
+ push({ kind: "zeroOrMore" });
42
+ } else {
43
+ push({ kind: "recursivePrefix" });
44
+ bump();
45
+ }
46
+ return;
47
+ }
48
+ if (!isSeparator(before) && (branches.length <= 1 || before !== "," && before !== "{")) {
49
+ push({ kind: "zeroOrMore" });
50
+ push({ kind: "zeroOrMore" });
51
+ return;
52
+ }
53
+ let suffix;
54
+ const next = peek();
55
+ if (next === void 0) {
56
+ bump();
57
+ suffix = true;
58
+ } else if ((next === "," || next === "}") && branches.length >= 2) suffix = true;
59
+ else if (isSeparator(next)) {
60
+ bump();
61
+ suffix = false;
62
+ } else {
63
+ push({ kind: "zeroOrMore" });
64
+ push({ kind: "zeroOrMore" });
65
+ return;
66
+ }
67
+ const popped = branches[branches.length - 1].pop();
68
+ if (popped.kind === "recursivePrefix" || popped.kind === "recursiveSuffix") push(popped);
69
+ else push({ kind: suffix ? "recursiveSuffix" : "recursiveZeroOrMore" });
70
+ };
71
+ const cls = () => {
72
+ const ranges = [];
73
+ const extend = (range, c) => {
74
+ range[1] = c;
75
+ if (range[1].codePointAt(0) < range[0].codePointAt(0)) throw new GlobProblem(`invalid range; '${range[0]}' > '${range[1]}'`);
76
+ };
77
+ let negated = false;
78
+ if (peek() === "!" || peek() === "^") {
79
+ bump();
80
+ negated = true;
81
+ }
82
+ let first = true, inRange = false;
83
+ for (; ; ) {
84
+ const c = bump();
85
+ if (c === void 0) throw new GlobProblem("unclosed character class; missing ']'");
86
+ if (c === "]") {
87
+ if (!first) break;
88
+ ranges.push(["]", "]"]);
89
+ } else if (c === "-") {
90
+ if (first) ranges.push(["-", "-"]);
91
+ else if (inRange) {
92
+ extend(ranges[ranges.length - 1], "-");
93
+ inRange = false;
94
+ } else inRange = true;
95
+ } else {
96
+ if (inRange) extend(ranges[ranges.length - 1], c);
97
+ else ranges.push([c, c]);
98
+ inRange = false;
99
+ }
100
+ first = false;
101
+ }
102
+ if (inRange) ranges.push(["-", "-"]);
103
+ push({ kind: "class", negated, ranges });
104
+ };
105
+ for (let c = bump(); c !== void 0; c = bump()) {
106
+ if (c === "?") push({ kind: "any" });
107
+ else if (c === "*") star();
108
+ else if (c === "[") cls();
109
+ else if (c === "{") {
110
+ stack.push(branches.length);
111
+ branches.push([]);
112
+ } else if (c === "}") {
113
+ const start = stack.pop();
114
+ if (start === void 0) throw new GlobProblem(UNOPENED);
115
+ push({ kind: "alternates", branches: branches.splice(start) });
116
+ } else if (c === ",") {
117
+ if (!stack.length) push({ kind: "literal", char: "," });
118
+ else branches.push([]);
119
+ } else if (c === "\\") {
120
+ if (!windows) {
121
+ const next = bump();
122
+ if (next === void 0) throw new GlobProblem("dangling '\\'");
123
+ push({ kind: "literal", char: next });
124
+ } else push({ kind: "literal", char: "/" });
125
+ } else push({ kind: "literal", char: c });
126
+ }
127
+ if (branches.length > 1) throw new GlobProblem(UNCLOSED);
128
+ return branches[0];
129
+ }
130
+ var code = (c) => c.codePointAt(0);
131
+ var isAsciiLetter = (n) => n >= 65 && n <= 90 || n >= 97 && n <= 122;
132
+ var charCode = (n) => /[0-9A-Za-z]/.test(String.fromCodePoint(n)) ? String.fromCodePoint(n) : `\\u{${n.toString(16)}}`;
133
+ var charLiteral = (n, ignoreCase) => ignoreCase && isAsciiLetter(n) ? `[${String.fromCharCode(n | 32)}${String.fromCharCode(n & ~32)}]` : charCode(n);
134
+ function classPattern(negated, ranges, ignoreCase) {
135
+ const items = ranges.map(([from, to]) => [code(from), code(to)]);
136
+ if (ignoreCase) {
137
+ for (const [lo, hi] of [...items]) {
138
+ for (const [start, end, shift] of [[65, 90, 32], [97, 122, -32]]) {
139
+ const l = Math.max(lo, start), h = Math.min(hi, end);
140
+ if (l <= h) items.push([l + shift, h + shift]);
141
+ }
142
+ }
143
+ }
144
+ return `[${negated ? "^" : ""}${items.map(([lo, hi]) => lo === hi ? charCode(lo) : `${charCode(lo)}-${charCode(hi)}`).join("")}]`;
145
+ }
146
+ function tokensPattern(tokens, ignoreCase) {
147
+ let re = "";
148
+ for (const token of tokens) {
149
+ switch (token.kind) {
150
+ case "literal":
151
+ re += [...token.char].map((c) => charLiteral(code(c), ignoreCase)).join("");
152
+ break;
153
+ case "any":
154
+ re += "[^/]";
155
+ break;
156
+ case "zeroOrMore":
157
+ re += "[^/]*";
158
+ break;
159
+ case "recursivePrefix":
160
+ re += "(?:/?|.*/)";
161
+ break;
162
+ case "recursiveSuffix":
163
+ re += "/.*";
164
+ break;
165
+ case "recursiveZeroOrMore":
166
+ re += "(?:/|/.*/)";
167
+ break;
168
+ case "class":
169
+ re += classPattern(token.negated, token.ranges, ignoreCase);
170
+ break;
171
+ case "alternates": {
172
+ const parts = token.branches.map((branch) => tokensPattern(branch, ignoreCase)).filter((part) => part !== "");
173
+ if (parts.length) re += `(?:${parts.join("|")})`;
174
+ }
175
+ }
176
+ }
177
+ return re;
178
+ }
179
+ var WINDOWS = process.platform === "win32";
180
+ function globToRegExp(glob, { ignoreCase = false, loose = false, windows = WINDOWS } = {}) {
181
+ if (loose) return looseGlobToRegExp(glob);
182
+ const tokens = parse(stripDot(glob), windows);
183
+ const re = tokens.length === 1 && tokens[0].kind === "recursivePrefix" ? ".*" : tokensPattern(tokens, ignoreCase);
184
+ return new RegExp(`^${re}$`, "su");
185
+ }
186
+ function looseGlobToRegExp(glob) {
187
+ const g = stripDot(glob);
188
+ let re = "";
189
+ let braces = 0;
190
+ for (let i = 0; i < g.length; i++) {
191
+ const c = g[i];
192
+ if (c === "*" && g[i + 1] === "*") {
193
+ const slash = g[i + 2] === "/";
194
+ re += slash ? "(?:.*/)?" : ".*";
195
+ i += slash ? 2 : 1;
196
+ } else if (c === "*") re += "[^/]*";
197
+ else if (c === "?") re += "[^/]";
198
+ else if (c === "[") {
199
+ const end = g.indexOf("]", i);
200
+ if (end === -1) re += "\\[";
201
+ else {
202
+ re += "[" + g.slice(i + 1, end).replace(/^!/, "^").replace(/\\/g, "\\\\") + "]";
203
+ i = end;
204
+ }
205
+ } else if (c === "{") {
206
+ braces++;
207
+ re += "(?:";
208
+ } else if (c === "}" && braces) {
209
+ braces--;
210
+ re += ")";
211
+ } else if (c === "," && braces) re += "|";
212
+ else re += c.replace(/[.+^$()|\\{}\]]/g, "\\$&");
213
+ }
214
+ return new RegExp(`^${re}$`);
215
+ }
216
+ function globProblem(glob, { windows = WINDOWS } = {}) {
217
+ try {
218
+ parse(stripDot(glob), windows);
219
+ return void 0;
220
+ } catch (e) {
221
+ if (e instanceof GlobProblem) return e.message;
222
+ throw e;
223
+ }
224
+ }
225
+ var isGlob = (p) => /[*?[{]/.test(p);
226
+ function globBase(glob) {
227
+ const fixed = [];
228
+ for (const part of stripDot(glob).split("/")) {
229
+ if (isGlob(part)) break;
230
+ fixed.push(part);
231
+ }
232
+ return fixed.join("/");
233
+ }
234
+ function globSet(what, globs) {
235
+ const patterns = [...globs].map((given) => {
236
+ const glob = stripDot(given);
237
+ const problem = globProblem(glob);
238
+ if (problem !== void 0) bail(`${what}: invalid glob ${quoted(glob)}: error parsing glob '${glob}': ${problem}`);
239
+ return globToRegExp(glob);
240
+ });
241
+ if (!patterns.length) return () => false;
242
+ return (p) => patterns.some((re) => re.test(p));
243
+ }
244
+
245
+ export {
246
+ globToRegExp,
247
+ globProblem,
248
+ isGlob,
249
+ globBase,
250
+ globSet
251
+ };
@@ -0,0 +1,20 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ bytes,
5
+ count,
6
+ duration,
7
+ fixed,
8
+ summary
9
+ } from "./chunk-NKXEPHRZ.js";
10
+ import "./chunk-DDV6JEC2.js";
11
+ import "./chunk-UU43WIZG.js";
12
+ import "./chunk-VJWQSYEG.js";
13
+ import "./chunk-I3PS26CI.js";
14
+ export {
15
+ bytes,
16
+ count,
17
+ duration,
18
+ fixed,
19
+ summary
20
+ };
@@ -0,0 +1,48 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
21
+ };
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
42
+
43
+ export {
44
+ __require,
45
+ __commonJS,
46
+ __export,
47
+ __toESM
48
+ };
@@ -0,0 +1,11 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ RegexError,
5
+ rustRegExp
6
+ } from "./chunk-3GYLOC6Y.js";
7
+ import "./chunk-I3PS26CI.js";
8
+ export {
9
+ RegexError,
10
+ rustRegExp
11
+ };