@yaks/esbuild 0.0.0-stage → 0.2.36

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 (123) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +450 -2
  3. package/_dist/bundle.d.ts +6 -0
  4. package/_dist/bundle.d.ts.map +1 -0
  5. package/_dist/compile.d.ts +72 -0
  6. package/_dist/compile.d.ts.map +1 -0
  7. package/_dist/dependencies.d.ts +15 -0
  8. package/_dist/dependencies.d.ts.map +1 -0
  9. package/_dist/file.d.ts +185 -0
  10. package/_dist/file.d.ts.map +1 -0
  11. package/_dist/graph.d.ts +104 -0
  12. package/_dist/graph.d.ts.map +1 -0
  13. package/_dist/home.d.ts +15 -0
  14. package/_dist/home.d.ts.map +1 -0
  15. package/_dist/link.d.ts +192 -0
  16. package/_dist/link.d.ts.map +1 -0
  17. package/_dist/lock.d.ts +30 -0
  18. package/_dist/lock.d.ts.map +1 -0
  19. package/_dist/mod.d.ts +6 -0
  20. package/_dist/mod.d.ts.map +1 -0
  21. package/_dist/pack.d.ts +42 -0
  22. package/_dist/pack.d.ts.map +1 -0
  23. package/_dist/package.d.ts +11 -0
  24. package/_dist/package.d.ts.map +1 -0
  25. package/_dist/plan.d.ts +135 -0
  26. package/_dist/plan.d.ts.map +1 -0
  27. package/_dist/platform.d.ts +27 -0
  28. package/_dist/platform.d.ts.map +1 -0
  29. package/_dist/resolve.d.ts +42 -0
  30. package/_dist/resolve.d.ts.map +1 -0
  31. package/_dist/shelf.d.ts +11 -0
  32. package/_dist/shelf.d.ts.map +1 -0
  33. package/_dist/strip.d.ts +51 -0
  34. package/_dist/strip.d.ts.map +1 -0
  35. package/_dist/timing.d.ts +6 -0
  36. package/_dist/timing.d.ts.map +1 -0
  37. package/_dist/unpack.d.ts +14 -0
  38. package/_dist/unpack.d.ts.map +1 -0
  39. package/analysis.js +72 -0
  40. package/analysis.js.map +1 -0
  41. package/analysis.ts +82 -0
  42. package/bundle.js +320 -0
  43. package/bundle.js.map +1 -0
  44. package/bundle.ts +415 -0
  45. package/common.js +129 -0
  46. package/common.js.map +1 -0
  47. package/common.ts +138 -0
  48. package/compile.js +500 -0
  49. package/compile.js.map +1 -0
  50. package/compile.ts +622 -0
  51. package/container.js +142 -0
  52. package/container.js.map +1 -0
  53. package/container.ts +183 -0
  54. package/deno.json +1 -0
  55. package/dependencies.js +31 -0
  56. package/dependencies.js.map +1 -0
  57. package/dependencies.ts +40 -0
  58. package/file.js +303 -0
  59. package/file.js.map +1 -0
  60. package/file.ts +443 -0
  61. package/forward.ts +49 -0
  62. package/graph.js +297 -0
  63. package/graph.js.map +1 -0
  64. package/graph.ts +360 -0
  65. package/home.js +40 -0
  66. package/home.js.map +1 -0
  67. package/home.ts +52 -0
  68. package/link.js +455 -0
  69. package/link.js.map +1 -0
  70. package/link.ts +596 -0
  71. package/lock.js +129 -0
  72. package/lock.js.map +1 -0
  73. package/lock.ts +161 -0
  74. package/mod.js +14 -0
  75. package/mod.js.map +1 -0
  76. package/mod.ts +43 -0
  77. package/npm.js +362 -0
  78. package/npm.js.map +1 -0
  79. package/npm.ts +429 -0
  80. package/pack.js +188 -0
  81. package/pack.js.map +1 -0
  82. package/pack.ts +225 -0
  83. package/package.js +199 -0
  84. package/package.js.map +1 -0
  85. package/package.json +60 -4
  86. package/package.ts +255 -0
  87. package/plan.js +273 -0
  88. package/plan.js.map +1 -0
  89. package/plan.ts +395 -0
  90. package/platform.js +160 -0
  91. package/platform.js.map +1 -0
  92. package/platform.ts +238 -0
  93. package/resolve.js +86 -0
  94. package/resolve.js.map +1 -0
  95. package/resolve.ts +144 -0
  96. package/said.js +44 -0
  97. package/said.js.map +1 -0
  98. package/said.ts +61 -0
  99. package/serve.ts +37 -0
  100. package/sha256.js +7 -0
  101. package/sha256.js.map +1 -0
  102. package/sha256.ts +10 -0
  103. package/shared.js +646 -0
  104. package/shared.js.map +1 -0
  105. package/shared.ts +813 -0
  106. package/shelf.js +73 -0
  107. package/shelf.js.map +1 -0
  108. package/shelf.ts +110 -0
  109. package/strip.js +114 -0
  110. package/strip.js.map +1 -0
  111. package/strip.ts +117 -0
  112. package/tar.js +87 -0
  113. package/tar.js.map +1 -0
  114. package/tar.ts +99 -0
  115. package/timing.js +37 -0
  116. package/timing.js.map +1 -0
  117. package/timing.ts +71 -0
  118. package/unpack.js +40 -0
  119. package/unpack.js.map +1 -0
  120. package/unpack.ts +60 -0
  121. package/used.js +91 -0
  122. package/used.js.map +1 -0
  123. package/used.ts +116 -0
package/file.js ADDED
@@ -0,0 +1,303 @@
1
+ // One module compiled on its own (D-499): TypeScript and JSX stripped to the
2
+ // JavaScript a browser runs (./strip.ts `compiled`), every import kept as
3
+ // written and every line where it was, so a stack trace names the source's
4
+ // own line. A file compiles the same wherever it is and whichever app holds
5
+ // it, so its output is kept once, under the name `compiledName` gives it: the
6
+ // source's address (the SHA-256 of its bytes, the name a host already keeps
7
+ // it under), what kind of file it is, the options, and the compiler's
8
+ // version. A file seen before, anywhere on the platform, costs a lookup, and
9
+ // one the release before used costs nothing, not even a read of its source.
10
+ //
11
+ // This holds no compiler, so a host whose upload cannot carry sucrase (the
12
+ // yaks.app kernel) names and keeps output and compiles through a host that
13
+ // can (its compiler Worker).
14
+ import { parse } from "es-module-lexer/js";
15
+ import { found } from "./graph.js";
16
+ /** What the compile makes, as a number: output kept under another is made
17
+ * again. Raise it whenever the same source would compile to other bytes. */ export let COMPILER = 1;
18
+ /** What compiling one of an app's files makes (./strip.ts `compiled`), as a
19
+ * number, apart from `COMPILER`, which names every package's modules too:
20
+ * a file kept under another is compiled again. */ export let FILE_COMPILER = 2;
21
+ /** What a pack of an app's own modules makes (./pack.ts), as a number: a
22
+ * pack kept under another is made again. Raise it whenever the same modules
23
+ * would pack to other bytes. */ export let PACKER = 7;
24
+ /** What a file is by its path: `ts`, `tsx`, `jsx` and their kin compile,
25
+ * anything else is JavaScript as written. */ export let kindOf = (path)=>path.slice(path.lastIndexOf('.') + 1);
26
+ let hex = (bytes)=>Array.from(new Uint8Array(bytes), (b)=>b.toString(16).padStart(2, '0')).join('');
27
+ let COMPILED = new Set([
28
+ 'ts',
29
+ 'mts',
30
+ 'cts',
31
+ 'tsx',
32
+ 'jsx'
33
+ ]);
34
+ let sha256 = async (bytes)=>hex(await crypto.subtle.digest('SHA-256', bytes));
35
+ /** A source's address: the SHA-256 of its bytes, in hex. */ export let addressOf = (source)=>sha256(new TextEncoder().encode(source));
36
+ /** The name a file's compiled output is kept under, from its source's
37
+ * address: one name for one output, whichever app or path holds the source.
38
+ *
39
+ * ```ts
40
+ * import { assertEquals, assertNotEquals } from '@std/assert'
41
+ * let x = await addressOf('x')
42
+ * assertEquals(await compiledName('a.ts', x), await compiledName('b/c.ts', x))
43
+ * assertNotEquals(await compiledName('a.ts', x), await compiledName('a.tsx', x))
44
+ * assertNotEquals(
45
+ * await compiledName('a.tsx', x),
46
+ * await compiledName('a.tsx', x, { jsxImportSource: 'preact' }),
47
+ * )
48
+ * ```
49
+ */ export let compiledName = (path, address, { jsxImportSource = '' } = {})=>{
50
+ let kind = COMPILED.has(kindOf(path)) ? kindOf(path) : 'js';
51
+ return sha256(new TextEncoder().encode(`${FILE_COMPILER}\0${kind}\0${jsxImportSource}\0${address}`));
52
+ };
53
+ /** Where package modules are kept in a byte store, whichever host: every
54
+ * app's, under one prefix, since a name is the same output in any of them,
55
+ * and served to anyone at `MODULES_AT`. */ export let MODULES = 'modules/';
56
+ /** Where an app's own compiled scripts are kept: once for every app, as
57
+ * package modules are, but apart from them, so `MODULES_AT` never answers
58
+ * one. An app serves its own at its scripts' paths, behind its own access. */ export let APP_MODULES = 'app-modules/';
59
+ /** Where a host serves what it keeps under `MODULES`, from its one origin,
60
+ * so every app's pages share one cache of each. */ export let MODULES_AT = '/__m/';
61
+ /** A `Keep` over a byte store (@yaks/blob's, a bucket's), each module at
62
+ * `MODULES` + its name + `.js`. */ export let keptIn = (store, prefix = MODULES)=>({
63
+ has: (name)=>store.has(`${prefix}${name}.js`),
64
+ put: async (name, code)=>{
65
+ await store.put(`${prefix}${name}.js`, new TextEncoder().encode(code));
66
+ }
67
+ });
68
+ /** Sources held as text, each addressed. */ export let sourcesOf = (files)=>Promise.all(files.map(async ({ path, source })=>({
69
+ path,
70
+ address: await addressOf(source),
71
+ read: ()=>source
72
+ })));
73
+ /** Each file's compiled name, compiling and keeping only output nobody kept
74
+ * before. `known` names output kept already (the release before's), taken at
75
+ * its word, its source never read; any other name costs one `has`, and a miss
76
+ * a read, a compile and a `put`. Six at once, as a Worker holds six
77
+ * connections. */ export let compiledFiles = async (files, keep, compile, { known = new Set(), options = {}, output } = {})=>{
78
+ let names = new Map();
79
+ let queue = [
80
+ ...files
81
+ ];
82
+ let work = async ()=>{
83
+ for(let file = queue.shift(); file; file = queue.shift()){
84
+ let name = await compiledName(file.path, file.address, options);
85
+ if (!known.has(name) && !await keep.has(name)) {
86
+ let code = await compile(file.path, await file.read(), options);
87
+ output?.set(file.path, code);
88
+ await keep.put(name, code);
89
+ }
90
+ names.set(file.path, name);
91
+ }
92
+ };
93
+ await Promise.all(Array.from({
94
+ length: 6
95
+ }, work));
96
+ return names;
97
+ };
98
+ /** What names a package's compile: `name@version`, and after it the rest of
99
+ * a specifier a pattern export matches, built alone (./package.ts).
100
+ *
101
+ * ```ts
102
+ * import { assertEquals } from '@std/assert'
103
+ * assertEquals(packageKey('three', '0.180.0'), 'three@0.180.0')
104
+ * assertEquals(
105
+ * packageKey('three', '0.180.0', 'three/addons/controls/OrbitControls.js'),
106
+ * 'three@0.180.0/addons/controls/OrbitControls.js',
107
+ * )
108
+ * ```
109
+ */ export let packageKey = (name, version, subpath)=>`${name}@${version}${subpath ? subpath.slice(name.length) : ''}`;
110
+ /** The name a package version's compile is kept under (./package.ts), from
111
+ * its key (`packageKey`): its record of entries is `<name>.json` beside its
112
+ * modules.
113
+ *
114
+ * ```ts
115
+ * import { assertNotEquals } from '@std/assert'
116
+ * assertNotEquals(
117
+ * await packageName('preact@10.26.0'),
118
+ * await packageName('preact@10.26.1'),
119
+ * )
120
+ * ```
121
+ */ export let packageName = (key)=>sha256(new TextEncoder().encode(`${COMPILER}\0package\0${key}`));
122
+ /** A specifier no export of its package names: nothing to compile. */ export class Unexported extends Error {
123
+ name = 'Unexported';
124
+ }
125
+ /** A package version's entries and imports, compiled once for the platform:
126
+ * read from its record in `store`, or compiled, every module kept, and then
127
+ * the record, so a record names only modules that are there. A record from
128
+ * before it said its imports and links is compiled again. */ export let keptPackage = async (store, key, compile, prefix = MODULES)=>{
129
+ let record = `${prefix}${await packageName(key)}.json`;
130
+ let held = await store.read(record);
131
+ let was = held && JSON.parse(new TextDecoder().decode(held));
132
+ if (was?.entries && was.imports && was.links) return was;
133
+ let { entries, modules, imports, links } = await compile();
134
+ let queue = Object.entries(modules);
135
+ let work = async ()=>{
136
+ for(let next = queue.shift(); next; next = queue.shift()){
137
+ await store.put(prefix + next[0], new TextEncoder().encode(next[1]));
138
+ }
139
+ };
140
+ await Promise.all(Array.from({
141
+ length: 6
142
+ }, work));
143
+ let kept = {
144
+ entries,
145
+ imports,
146
+ links
147
+ };
148
+ await store.put(record, new TextEncoder().encode(JSON.stringify(kept)));
149
+ return kept;
150
+ };
151
+ let TYPES = {
152
+ js: 'text/javascript; charset=utf-8',
153
+ css: 'text/css; charset=utf-8',
154
+ json: 'application/json',
155
+ svg: 'image/svg+xml'
156
+ };
157
+ // A kept module's file: a name and its kind, or a package's resource under
158
+ // its name.
159
+ let SERVED = /^[a-f0-9]{64}(?:\.(?:js|css)|\/(?:[\w@+~-][\w.@+~-]*\/)*[\w@+~-][\w.@+~-]*)$/;
160
+ /** A kept module, or a package's resource, at `file` under `MODULES_AT`, for
161
+ * every app and every page: immutable, since a name is written once, and
162
+ * readable from any origin. Null when nothing is kept there. */ export let servedModule = async (store, file, prefix = MODULES)=>{
163
+ if (!SERVED.test(file)) return null;
164
+ let bytes = await store.read(prefix + file);
165
+ if (!bytes) return null;
166
+ return new Response(bytes, {
167
+ headers: {
168
+ 'content-type': TYPES[kindOf(file)] ?? 'text/plain; charset=utf-8',
169
+ 'cache-control': 'public, max-age=31536000, immutable',
170
+ 'access-control-allow-origin': '*',
171
+ 'x-content-type-options': 'nosniff'
172
+ }
173
+ });
174
+ };
175
+ /** What a page's import map names for the bare specifiers its modules
176
+ * import: each entry of each package an app's release uses (`packages`, as
177
+ * `keptPackage` keeps them), at `origin` + `MODULES_AT`, and each alias its
178
+ * renderer gives (`react` for `preact/compat`) at its target's address.
179
+ *
180
+ * ```ts
181
+ * import { assertEquals } from '@std/assert'
182
+ * assertEquals(
183
+ * bareMap(
184
+ * [{ entries: { preact: 'a.js', 'preact/compat': 'b.js' } }],
185
+ * { react: 'preact/compat', 'react-dom': 'preact/compat', x: 'gone' },
186
+ * 'https://yaks.app',
187
+ * ),
188
+ * {
189
+ * preact: 'https://yaks.app/__m/a.js',
190
+ * 'preact/compat': 'https://yaks.app/__m/b.js',
191
+ * react: 'https://yaks.app/__m/b.js',
192
+ * 'react-dom': 'https://yaks.app/__m/b.js',
193
+ * },
194
+ * )
195
+ * ```
196
+ */ export let bareMap = (packages, aliases = {}, origin)=>{
197
+ let map = {};
198
+ for (let { entries } of packages){
199
+ for (let [spec, file] of Object.entries(entries)){
200
+ map[spec] = `${origin}${MODULES_AT}${file}`;
201
+ }
202
+ }
203
+ for (let [spec, to] of Object.entries(aliases)){
204
+ if (map[to] && !map[spec]) map[spec] = map[to];
205
+ }
206
+ return map;
207
+ };
208
+ let relatives = (path, js, scripts, all)=>{
209
+ let lexed;
210
+ try {
211
+ lexed = parse(js)[0];
212
+ } catch {
213
+ return null;
214
+ }
215
+ return lexed.flatMap(({ n: spec, d })=>{
216
+ if (spec == null || !all && d != -1 || d == -2) return [];
217
+ if (!/^\.\.?\//.test(spec)) return [
218
+ {
219
+ spec,
220
+ to: null,
221
+ at: null
222
+ }
223
+ ];
224
+ let to = decodeURIComponent(new URL(spec, `https://app.invalid/${path}`).pathname.slice(1));
225
+ return [
226
+ {
227
+ spec,
228
+ to,
229
+ at: found(to, (p)=>scripts.has(p))
230
+ }
231
+ ];
232
+ });
233
+ };
234
+ /** What the app's script at `path` imports statically, read from its
235
+ * compiled module `js`, as a release's module graph names it: another of
236
+ * the app's `scripts` as `./<path>` from the app's root, found as a compile
237
+ * finds it (`./lib/n` loads lib/n.ts), and a bare specifier as written. The
238
+ * module is lexed, so an import in a comment or a string names nothing; it
239
+ * is the compiled module, so the JSX runtime the compiler writes in is named
240
+ * and an `import type` is gone. `import('x')` loads only when it runs. An
241
+ * address none of the app's scripts is, or a module that does not lex, names
242
+ * nothing.
243
+ *
244
+ * ```ts
245
+ * import { assertEquals } from '@std/assert'
246
+ * assertEquals(
247
+ * scriptLinks(
248
+ * 'ui/main.ts',
249
+ * "import { a } from '../lib/a.ts'\nexport * from 'preact'\n" +
250
+ * "import { b } from '../lib/b'\n" +
251
+ * "export let n = {}\n// import { f } from './f.ts'\n" +
252
+ * "let later = () => import('./late.ts')",
253
+ * new Set(['lib/a.ts', 'lib/b.tsx', 'ui/f.ts', 'ui/late.ts']),
254
+ * ),
255
+ * ['./lib/a.ts', 'preact', './lib/b.tsx'],
256
+ * )
257
+ * ```
258
+ */ export let scriptLinks = (path, js, scripts)=>{
259
+ let out = new Set();
260
+ for (let { spec, to, at } of relatives(path, js, scripts, false) ?? []){
261
+ if (to == null) {
262
+ if (!spec.startsWith('/') && !spec.includes(':')) out.add(spec);
263
+ } else if (at) out.add(`./${at}`);
264
+ }
265
+ return [
266
+ ...out
267
+ ];
268
+ };
269
+ /** Each path from the app's root that the script at `path` imports, by
270
+ * `import` or `import()`, naming none of the app's `scripts` but one a
271
+ * compile finds (./graph.ts `found`), with the script it loads: what a
272
+ * page's map names so the browser loads it there.
273
+ *
274
+ * ```ts
275
+ * import { assertEquals } from '@std/assert'
276
+ * assertEquals(
277
+ * looseImports('main.ts', "import './lib/n'\nimport('./ui')\n" +
278
+ * "import './lib/n.ts'", new Set(['lib/n.ts', 'ui/index.ts'])),
279
+ * { 'lib/n': 'lib/n.ts', ui: 'ui/index.ts' },
280
+ * )
281
+ * ```
282
+ */ export let looseImports = (path, js, scripts)=>Object.fromEntries((relatives(path, js, scripts, true) ?? []).flatMap(({ to, at })=>to != null && at != null && at != to ? [
283
+ [
284
+ to,
285
+ at
286
+ ]
287
+ ] : []));
288
+ /** Each kept module of `packages` by its address under `origin`, and what it
289
+ * imports statically: the package's other modules by their addresses, and
290
+ * bare specifiers as written (@yaks/esbuild/package `Compiled`).
291
+ *
292
+ * ```ts
293
+ * import { assertEquals } from '@std/assert'
294
+ * assertEquals(
295
+ * packageLinks([{ links: { 'a.js': ['./b.js', 'preact'] } }], 'https://y'),
296
+ * { 'https://y/__m/a.js': ['https://y/__m/b.js', 'preact'] },
297
+ * )
298
+ * ```
299
+ */ export let packageLinks = (packages, origin)=>Object.fromEntries(packages.flatMap(({ links })=>Object.entries(links).map(([file, to])=>[
300
+ `${origin}${MODULES_AT}${file}`,
301
+ to.map((t)=>t.startsWith('./') ? `${origin}${MODULES_AT}${t.slice(2)}` : t)
302
+ ])));
303
+ //# sourceMappingURL=file.js.map
package/file.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sources":["./file.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,sEAAsE;AACtE,6EAA6E;AAC7E,4EAA4E;AAC5E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,6BAA6B;AAC7B,SAAS,KAAK,6BAAsC;AACpD,SAAS,KAAK,qBAAoB;AAElC;0EAC0E,GAC1E,OAAO,IAAI,WAAW,EAAC;AAEvB;;gDAEgD,GAChD,OAAO,IAAI,gBAAgB,EAAC;AAE5B;;8BAE8B,GAC9B,OAAO,IAAI,SAAS,EAAC;AAOrB;2CAC2C,GAC3C,OAAO,IAAI,SAAS,CAAC,OACnB,KAA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