zile 0.0.0 → 0.0.2

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,972 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`'/basic': Package.build > default > check 1`] = `
4
+ {
5
+ "output": {
6
+ "attw": "
7
+ basic v0.0.0
8
+
9
+ (ignoring resolutions: 'node10', 'node16-cjs')
10
+
11
+ (ignored per resolution) ⚠️ A require call resolved to an ESM JavaScript file, which is an error in Node and some bundlers. CommonJS consumers will need to use a dynamic import. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSResolvesToESM.md
12
+
13
+
14
+ "basic"
15
+
16
+ node16 (from ESM): 🟢 (ESM)
17
+ bundler: 🟢
18
+ node10: (ignored) 🟢
19
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
20
+
21
+ ***********************************
22
+ ",
23
+ "publint": "Running publint v0.3.14 for basic...
24
+ Packing files with \`bun pack\`...
25
+ Linting...
26
+ All good!
27
+ ",
28
+ },
29
+ }
30
+ `;
31
+
32
+ exports[`'/basic': Package.build > default > main 1`] = `
33
+ "import { bar as bar1, foo as foo1 } from './foo.js';
34
+ export function foo(options = {}) {
35
+ foo1(options);
36
+ console.log('Hello, foo!', options.value);
37
+ }
38
+ export function bar(options = {}) {
39
+ bar1(options);
40
+ console.log('Hello, bar!', options.value);
41
+ }
42
+ (function (bar) {
43
+ function baz(options = {}) {
44
+ console.log('Hello, baz!', options.value);
45
+ }
46
+ bar.baz = baz;
47
+ })(bar || (bar = {}));
48
+ //# sourceMappingURL=index.js.map"
49
+ `;
50
+
51
+ exports[`'/basic': Package.build > default > output 1`] = `
52
+ "{
53
+ "name": "basic",
54
+ "version": "0.0.0",
55
+ "type": "module",
56
+ "bin": {
57
+ "basic": "./dist/cli.js",
58
+ "basic.src": "./cli.ts"
59
+ },
60
+ "main": "./dist/index.js",
61
+ "sideEffects": false,
62
+ "module": "./dist/index.js",
63
+ "types": "./dist/index.d.ts",
64
+ "exports": {
65
+ ".": {
66
+ "src": "./index.ts",
67
+ "types": "./dist/index.d.ts",
68
+ "default": "./dist/index.js"
69
+ }
70
+ }
71
+ }
72
+
73
+
74
+ ├── dist
75
+ │ ├── cli.d.ts
76
+ │ ├── cli.d.ts.map
77
+ │ ├── cli.js
78
+ │ ├── cli.js.map
79
+ │ ├── foo.d.ts
80
+ │ ├── foo.d.ts.map
81
+ │ ├── foo.js
82
+ │ ├── foo.js.map
83
+ │ ├── index.d.ts
84
+ │ ├── index.d.ts.map
85
+ │ ├── index.js
86
+ │ └── index.js.map
87
+ ├── cli.ts
88
+ ├── foo.ts
89
+ ├── index.ts
90
+ ├── package.json
91
+ └── tsconfig.json
92
+ "
93
+ `;
94
+
95
+ exports[`'/basic': Package.build > default > result 1`] = `
96
+ {
97
+ "packageJson": {
98
+ "bin": {
99
+ "basic": "./dist/cli.js",
100
+ "basic.src": "./cli.ts",
101
+ },
102
+ "exports": {
103
+ ".": {
104
+ "default": "./dist/index.js",
105
+ "src": "./index.ts",
106
+ "types": "./dist/index.d.ts",
107
+ },
108
+ },
109
+ "main": "./dist/index.js",
110
+ "module": "./dist/index.js",
111
+ "name": "basic",
112
+ "sideEffects": false,
113
+ "type": "module",
114
+ "types": "./dist/index.d.ts",
115
+ "version": "0.0.0",
116
+ },
117
+ "tsConfig": {
118
+ "compilerOptions": {
119
+ "composite": false,
120
+ "declaration": true,
121
+ "declarationDir": undefined,
122
+ "declarationMap": true,
123
+ "emitDeclarationOnly": false,
124
+ "esModuleInterop": true,
125
+ "isolatedModules": true,
126
+ "module": "nodenext",
127
+ "moduleDetection": "force",
128
+ "moduleResolution": "nodenext",
129
+ "noEmit": false,
130
+ "outDir": "/repos/basic/dist",
131
+ "skipLibCheck": true,
132
+ "sourceMap": true,
133
+ "strict": true,
134
+ "target": "es2021",
135
+ "verbatimModuleSyntax": true,
136
+ },
137
+ "exclude": [],
138
+ "include": [
139
+ "/repos/basic/cli.ts",
140
+ "/repos/basic/index.ts",
141
+ ],
142
+ },
143
+ }
144
+ `;
145
+
146
+ exports[`'/basic': Package.build > default > types 1`] = `
147
+ "export declare function foo(options?: foo.Options): void;
148
+ export declare namespace foo {
149
+ type Options = {
150
+ value?: string | undefined;
151
+ };
152
+ }
153
+ export declare function bar(options?: bar.Options): void;
154
+ export declare namespace bar {
155
+ type Options = {
156
+ value?: string | undefined;
157
+ };
158
+ function baz(options?: Options): void;
159
+ }
160
+ //# sourceMappingURL=index.d.ts.map"
161
+ `;
162
+
163
+ exports[`'/basic': Package.build > link > main-target 1`] = `"../index.ts"`;
164
+
165
+ exports[`'/basic': Package.build > link > output 1`] = `
166
+ "{
167
+ "name": "basic",
168
+ "version": "0.0.0",
169
+ "type": "module",
170
+ "bin": {
171
+ "basic": "./dist/cli.js",
172
+ "basic.src": "./cli.ts"
173
+ },
174
+ "main": "./dist/index.js",
175
+ "sideEffects": false,
176
+ "module": "./dist/index.js",
177
+ "types": "./dist/index.d.ts",
178
+ "exports": {
179
+ ".": {
180
+ "src": "./index.ts",
181
+ "types": "./dist/index.d.ts",
182
+ "default": "./dist/index.js"
183
+ }
184
+ }
185
+ }
186
+
187
+
188
+ ├── dist
189
+ │ ├── index.d.ts -> ../index.ts
190
+ │ └── index.js -> ../index.ts
191
+ ├── cli.ts
192
+ ├── foo.ts
193
+ ├── index.ts
194
+ ├── package.json
195
+ └── tsconfig.json
196
+ "
197
+ `;
198
+
199
+ exports[`'/basic': Package.build > link > result 1`] = `
200
+ {
201
+ "packageJson": {
202
+ "bin": {
203
+ "basic": "./dist/cli.js",
204
+ "basic.src": "./cli.ts",
205
+ },
206
+ "exports": {
207
+ ".": {
208
+ "default": "./dist/index.js",
209
+ "src": "./index.ts",
210
+ "types": "./dist/index.d.ts",
211
+ },
212
+ },
213
+ "main": "./dist/index.js",
214
+ "module": "./dist/index.js",
215
+ "name": "basic",
216
+ "sideEffects": false,
217
+ "type": "module",
218
+ "types": "./dist/index.d.ts",
219
+ "version": "0.0.0",
220
+ },
221
+ "tsConfig": {
222
+ "compilerOptions": {
223
+ "isolatedModules": true,
224
+ "module": "nodenext",
225
+ "moduleDetection": "force",
226
+ "moduleResolution": "nodenext",
227
+ "noEmit": true,
228
+ "skipLibCheck": true,
229
+ "strict": true,
230
+ "verbatimModuleSyntax": true,
231
+ },
232
+ },
233
+ }
234
+ `;
235
+
236
+ exports[`'/basic': Package.build > link > types-target 1`] = `"../index.ts"`;
237
+
238
+ exports[`'/basic-object-exports': Package.build > default > check 1`] = `
239
+ {
240
+ "output": {
241
+ "attw": "
242
+ basic v0.0.0
243
+
244
+ (ignoring resolutions: 'node10', 'node16-cjs')
245
+
246
+ (ignored per resolution) ⚠️ A require call resolved to an ESM JavaScript file, which is an error in Node and some bundlers. CommonJS consumers will need to use a dynamic import. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSResolvesToESM.md
247
+
248
+
249
+ "basic"
250
+
251
+ node16 (from ESM): 🟢 (ESM)
252
+ bundler: 🟢
253
+ node10: (ignored) 🟢
254
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
255
+
256
+ ***********************************
257
+ ",
258
+ "publint": "Running publint v0.3.14 for basic...
259
+ Packing files with \`bun pack\`...
260
+ Linting...
261
+ All good!
262
+ ",
263
+ },
264
+ }
265
+ `;
266
+
267
+ exports[`'/basic-object-exports': Package.build > default > main 1`] = `
268
+ "import { bar as bar1, foo as foo1 } from './foo.js';
269
+ export function foo(options = {}) {
270
+ foo1(options);
271
+ console.log('Hello, foo!', options.value);
272
+ }
273
+ export function bar(options = {}) {
274
+ bar1(options);
275
+ console.log('Hello, bar!', options.value);
276
+ }
277
+ (function (bar) {
278
+ function baz(options = {}) {
279
+ console.log('Hello, baz!', options.value);
280
+ }
281
+ bar.baz = baz;
282
+ })(bar || (bar = {}));
283
+ //# sourceMappingURL=index.js.map"
284
+ `;
285
+
286
+ exports[`'/basic-object-exports': Package.build > default > output 1`] = `
287
+ "{
288
+ "name": "basic",
289
+ "version": "0.0.0",
290
+ "type": "module",
291
+ "exports": {
292
+ ".": {
293
+ "src": "./index.ts",
294
+ "types": "./dist/index.d.ts",
295
+ "default": "./dist/index.js"
296
+ }
297
+ },
298
+ "sideEffects": false,
299
+ "main": "./dist/index.js",
300
+ "module": "./dist/index.js",
301
+ "types": "./dist/index.d.ts"
302
+ }
303
+
304
+
305
+ ├── dist
306
+ │ ├── foo.d.ts
307
+ │ ├── foo.d.ts.map
308
+ │ ├── foo.js
309
+ │ ├── foo.js.map
310
+ │ ├── index.d.ts
311
+ │ ├── index.d.ts.map
312
+ │ ├── index.js
313
+ │ └── index.js.map
314
+ ├── foo.ts
315
+ ├── index.ts
316
+ ├── package.json
317
+ └── tsconfig.json
318
+ "
319
+ `;
320
+
321
+ exports[`'/basic-object-exports': Package.build > default > result 1`] = `
322
+ {
323
+ "packageJson": {
324
+ "exports": {
325
+ ".": {
326
+ "default": "./dist/index.js",
327
+ "src": "./index.ts",
328
+ "types": "./dist/index.d.ts",
329
+ },
330
+ },
331
+ "main": "./dist/index.js",
332
+ "module": "./dist/index.js",
333
+ "name": "basic",
334
+ "sideEffects": false,
335
+ "type": "module",
336
+ "types": "./dist/index.d.ts",
337
+ "version": "0.0.0",
338
+ },
339
+ "tsConfig": {
340
+ "compilerOptions": {
341
+ "composite": false,
342
+ "declaration": true,
343
+ "declarationDir": undefined,
344
+ "declarationMap": true,
345
+ "emitDeclarationOnly": false,
346
+ "esModuleInterop": true,
347
+ "isolatedModules": true,
348
+ "module": "nodenext",
349
+ "moduleDetection": "force",
350
+ "moduleResolution": "nodenext",
351
+ "noEmit": false,
352
+ "outDir": "/repos/basic-object-exports/dist",
353
+ "skipLibCheck": true,
354
+ "sourceMap": true,
355
+ "strict": true,
356
+ "target": "es2021",
357
+ "verbatimModuleSyntax": true,
358
+ },
359
+ "exclude": [],
360
+ "include": [
361
+ "/repos/basic-object-exports/index.ts",
362
+ ],
363
+ },
364
+ }
365
+ `;
366
+
367
+ exports[`'/basic-object-exports': Package.build > default > types 1`] = `
368
+ "export declare function foo(options?: foo.Options): void;
369
+ export declare namespace foo {
370
+ type Options = {
371
+ value?: string | undefined;
372
+ };
373
+ }
374
+ export declare function bar(options?: bar.Options): void;
375
+ export declare namespace bar {
376
+ type Options = {
377
+ value?: string | undefined;
378
+ };
379
+ function baz(options?: Options): void;
380
+ }
381
+ //# sourceMappingURL=index.d.ts.map"
382
+ `;
383
+
384
+ exports[`'/basic-object-exports': Package.build > link > main-target 1`] = `"../index.ts"`;
385
+
386
+ exports[`'/basic-object-exports': Package.build > link > output 1`] = `
387
+ "{
388
+ "name": "basic",
389
+ "version": "0.0.0",
390
+ "type": "module",
391
+ "exports": {
392
+ ".": {
393
+ "src": "./index.ts",
394
+ "types": "./dist/index.d.ts",
395
+ "default": "./dist/index.js"
396
+ }
397
+ },
398
+ "sideEffects": false,
399
+ "main": "./dist/index.js",
400
+ "module": "./dist/index.js",
401
+ "types": "./dist/index.d.ts"
402
+ }
403
+
404
+
405
+ ├── dist
406
+ │ ├── index.d.ts -> ../index.ts
407
+ │ └── index.js -> ../index.ts
408
+ ├── foo.ts
409
+ ├── index.ts
410
+ ├── package.json
411
+ └── tsconfig.json
412
+ "
413
+ `;
414
+
415
+ exports[`'/basic-object-exports': Package.build > link > result 1`] = `
416
+ {
417
+ "packageJson": {
418
+ "exports": {
419
+ ".": {
420
+ "default": "./dist/index.js",
421
+ "src": "./index.ts",
422
+ "types": "./dist/index.d.ts",
423
+ },
424
+ },
425
+ "main": "./dist/index.js",
426
+ "module": "./dist/index.js",
427
+ "name": "basic",
428
+ "sideEffects": false,
429
+ "type": "module",
430
+ "types": "./dist/index.d.ts",
431
+ "version": "0.0.0",
432
+ },
433
+ "tsConfig": {
434
+ "compilerOptions": {
435
+ "isolatedModules": true,
436
+ "module": "nodenext",
437
+ "moduleDetection": "force",
438
+ "moduleResolution": "nodenext",
439
+ "noEmit": true,
440
+ "skipLibCheck": true,
441
+ "strict": true,
442
+ "verbatimModuleSyntax": true,
443
+ },
444
+ },
445
+ }
446
+ `;
447
+
448
+ exports[`'/basic-object-exports': Package.build > link > types-target 1`] = `"../index.ts"`;
449
+
450
+ exports[`'/error-bin-object-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent-cli.ts\` does not exist on \`package.json#bin.cli\`]`;
451
+
452
+ exports[`'/error-bin-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#bin\`]`;
453
+
454
+ exports[`'/error-exports-object-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."].src\`]`;
455
+
456
+ exports[`'/error-exports-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."]\`]`;
457
+
458
+ exports[`'/error-main-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#main\`]`;
459
+
460
+ exports[`'/error-missing-entry-fields': Package.build > default > error 1`] = `[Error: package.json must have an \`exports\`, \`main\`, or \`bin\` field]`;
461
+
462
+ exports[`'/error-module-resolution': Package.build > default > error 1`] = `
463
+ "/repos/error-module-resolution/tsconfig.json has invalid configuration:
464
+ - "module" must be "nodenext". Found: "preserve"
465
+ - "moduleResolution" must be "nodenext". Found: "bundler""
466
+ `;
467
+
468
+ exports[`'/multiple-entrypoint': Package.build > default > check 1`] = `
469
+ {
470
+ "output": {
471
+ "attw": "
472
+ multiple-entrypoint v0.0.0
473
+
474
+ (ignoring resolutions: 'node10', 'node16-cjs')
475
+
476
+ (ignored per resolution) ⚠️ A require call resolved to an ESM JavaScript file, which is an error in Node and some bundlers. CommonJS consumers will need to use a dynamic import. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSResolvesToESM.md
477
+
478
+ (ignored per resolution) 💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md
479
+
480
+
481
+ "multiple-entrypoint"
482
+
483
+ node16 (from ESM): 🟢 (ESM)
484
+ bundler: 🟢
485
+ node10: (ignored) 🟢
486
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
487
+
488
+ ***********************************
489
+
490
+ "multiple-entrypoint/foo"
491
+
492
+ node16 (from ESM): 🟢 (ESM)
493
+ bundler: 🟢
494
+ node10: (ignored) 💀 Resolution failed
495
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
496
+
497
+ ***********************************
498
+
499
+ "multiple-entrypoint/nested/dir"
500
+
501
+ node16 (from ESM): 🟢 (ESM)
502
+ bundler: 🟢
503
+ node10: (ignored) 💀 Resolution failed
504
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
505
+
506
+ ***********************************
507
+ ",
508
+ "publint": "Running publint v0.3.14 for multiple-entrypoint...
509
+ Packing files with \`bun pack\`...
510
+ Linting...
511
+ All good!
512
+ ",
513
+ },
514
+ }
515
+ `;
516
+
517
+ exports[`'/multiple-entrypoint': Package.build > default > main 1`] = `
518
+ "import { bar as bar1, foo as foo1 } from './foo.js';
519
+ export function foo(options = {}) {
520
+ foo1(options);
521
+ console.log('Hello, foo!', options.value);
522
+ }
523
+ export function bar(options = {}) {
524
+ bar1(options);
525
+ console.log('Hello, bar!', options.value);
526
+ }
527
+ (function (bar) {
528
+ function baz(options = {}) {
529
+ console.log('Hello, baz!', options.value);
530
+ }
531
+ bar.baz = baz;
532
+ })(bar || (bar = {}));
533
+ //# sourceMappingURL=index.js.map"
534
+ `;
535
+
536
+ exports[`'/multiple-entrypoint': Package.build > default > output 1`] = `
537
+ "{
538
+ "name": "multiple-entrypoint",
539
+ "version": "0.0.0",
540
+ "type": "module",
541
+ "exports": {
542
+ ".": {
543
+ "src": "./src/index.ts",
544
+ "types": "./dist/index.d.ts",
545
+ "default": "./dist/index.js"
546
+ },
547
+ "./foo": {
548
+ "src": "./src/foo.ts",
549
+ "types": "./dist/foo.d.ts",
550
+ "default": "./dist/foo.js"
551
+ },
552
+ "./nested/dir": {
553
+ "src": "./src/nested/dir/bar.ts",
554
+ "types": "./dist/nested/dir/bar.d.ts",
555
+ "default": "./dist/nested/dir/bar.js"
556
+ }
557
+ },
558
+ "sideEffects": false,
559
+ "main": "./dist/index.js",
560
+ "module": "./dist/index.js",
561
+ "types": "./dist/index.d.ts"
562
+ }
563
+
564
+
565
+ ├── dist
566
+ │ ├── nested
567
+ │ │ └── dir
568
+ │ │ ├── bar.d.ts
569
+ │ │ ├── bar.d.ts.map
570
+ │ │ ├── bar.js
571
+ │ │ └── bar.js.map
572
+ │ ├── foo.d.ts
573
+ │ ├── foo.d.ts.map
574
+ │ ├── foo.js
575
+ │ ├── foo.js.map
576
+ │ ├── index.d.ts
577
+ │ ├── index.d.ts.map
578
+ │ ├── index.js
579
+ │ └── index.js.map
580
+ ├── src
581
+ │ ├── nested
582
+ │ │ └── dir
583
+ │ │ └── bar.ts
584
+ │ ├── foo.ts
585
+ │ └── index.ts
586
+ ├── package.json
587
+ └── tsconfig.json
588
+ "
589
+ `;
590
+
591
+ exports[`'/multiple-entrypoint': Package.build > default > result 1`] = `
592
+ {
593
+ "packageJson": {
594
+ "exports": {
595
+ ".": {
596
+ "default": "./dist/index.js",
597
+ "src": "./src/index.ts",
598
+ "types": "./dist/index.d.ts",
599
+ },
600
+ "./foo": {
601
+ "default": "./dist/foo.js",
602
+ "src": "./src/foo.ts",
603
+ "types": "./dist/foo.d.ts",
604
+ },
605
+ "./nested/dir": {
606
+ "default": "./dist/nested/dir/bar.js",
607
+ "src": "./src/nested/dir/bar.ts",
608
+ "types": "./dist/nested/dir/bar.d.ts",
609
+ },
610
+ },
611
+ "main": "./dist/index.js",
612
+ "module": "./dist/index.js",
613
+ "name": "multiple-entrypoint",
614
+ "sideEffects": false,
615
+ "type": "module",
616
+ "types": "./dist/index.d.ts",
617
+ "version": "0.0.0",
618
+ },
619
+ "tsConfig": {
620
+ "compilerOptions": {
621
+ "composite": false,
622
+ "declaration": true,
623
+ "declarationDir": undefined,
624
+ "declarationMap": true,
625
+ "emitDeclarationOnly": false,
626
+ "esModuleInterop": true,
627
+ "isolatedModules": true,
628
+ "module": "nodenext",
629
+ "moduleDetection": "force",
630
+ "moduleResolution": "nodenext",
631
+ "noEmit": false,
632
+ "outDir": "/repos/multiple-entrypoint/dist",
633
+ "skipLibCheck": true,
634
+ "sourceMap": true,
635
+ "strict": true,
636
+ "target": "es2021",
637
+ "verbatimModuleSyntax": true,
638
+ },
639
+ "exclude": [],
640
+ "include": [
641
+ "/repos/multiple-entrypoint/src/index.ts",
642
+ "/repos/multiple-entrypoint/src/foo.ts",
643
+ "/repos/multiple-entrypoint/src/nested/dir/bar.ts",
644
+ ],
645
+ },
646
+ }
647
+ `;
648
+
649
+ exports[`'/multiple-entrypoint': Package.build > default > types 1`] = `
650
+ "export declare function foo(options?: foo.Options): void;
651
+ export declare namespace foo {
652
+ type Options = {
653
+ value?: string | undefined;
654
+ };
655
+ }
656
+ export declare function bar(options?: bar.Options): void;
657
+ export declare namespace bar {
658
+ type Options = {
659
+ value?: string | undefined;
660
+ };
661
+ function baz(options?: Options): void;
662
+ }
663
+ //# sourceMappingURL=index.d.ts.map"
664
+ `;
665
+
666
+ exports[`'/multiple-entrypoint': Package.build > link > main-target 1`] = `"../src/index.ts"`;
667
+
668
+ exports[`'/multiple-entrypoint': Package.build > link > output 1`] = `
669
+ "{
670
+ "name": "multiple-entrypoint",
671
+ "version": "0.0.0",
672
+ "type": "module",
673
+ "exports": {
674
+ ".": {
675
+ "src": "./src/index.ts",
676
+ "types": "./dist/index.d.ts",
677
+ "default": "./dist/index.js"
678
+ },
679
+ "./foo": {
680
+ "src": "./src/foo.ts",
681
+ "types": "./dist/foo.d.ts",
682
+ "default": "./dist/foo.js"
683
+ },
684
+ "./nested/dir": {
685
+ "src": "./src/nested/dir/bar.ts",
686
+ "types": "./dist/nested/dir/bar.d.ts",
687
+ "default": "./dist/nested/dir/bar.js"
688
+ }
689
+ },
690
+ "sideEffects": false,
691
+ "main": "./dist/index.js",
692
+ "module": "./dist/index.js",
693
+ "types": "./dist/index.d.ts"
694
+ }
695
+
696
+
697
+ ├── dist
698
+ │ ├── nested
699
+ │ │ └── dir
700
+ │ │ ├── bar.d.ts -> ../../../src/nested/dir/bar.ts
701
+ │ │ └── bar.js -> ../../../src/nested/dir/bar.ts
702
+ │ ├── foo.d.ts -> ../src/foo.ts
703
+ │ ├── foo.js -> ../src/foo.ts
704
+ │ ├── index.d.ts -> ../src/index.ts
705
+ │ └── index.js -> ../src/index.ts
706
+ ├── src
707
+ │ ├── nested
708
+ │ │ └── dir
709
+ │ │ └── bar.ts
710
+ │ ├── foo.ts
711
+ │ └── index.ts
712
+ ├── package.json
713
+ └── tsconfig.json
714
+ "
715
+ `;
716
+
717
+ exports[`'/multiple-entrypoint': Package.build > link > result 1`] = `
718
+ {
719
+ "packageJson": {
720
+ "exports": {
721
+ ".": {
722
+ "default": "./dist/index.js",
723
+ "src": "./src/index.ts",
724
+ "types": "./dist/index.d.ts",
725
+ },
726
+ "./foo": {
727
+ "default": "./dist/foo.js",
728
+ "src": "./src/foo.ts",
729
+ "types": "./dist/foo.d.ts",
730
+ },
731
+ "./nested/dir": {
732
+ "default": "./dist/nested/dir/bar.js",
733
+ "src": "./src/nested/dir/bar.ts",
734
+ "types": "./dist/nested/dir/bar.d.ts",
735
+ },
736
+ },
737
+ "main": "./dist/index.js",
738
+ "module": "./dist/index.js",
739
+ "name": "multiple-entrypoint",
740
+ "sideEffects": false,
741
+ "type": "module",
742
+ "types": "./dist/index.d.ts",
743
+ "version": "0.0.0",
744
+ },
745
+ "tsConfig": {
746
+ "compilerOptions": {
747
+ "isolatedModules": true,
748
+ "module": "nodenext",
749
+ "moduleDetection": "force",
750
+ "moduleResolution": "nodenext",
751
+ "noEmit": true,
752
+ "skipLibCheck": true,
753
+ "strict": true,
754
+ "verbatimModuleSyntax": true,
755
+ },
756
+ },
757
+ }
758
+ `;
759
+
760
+ exports[`'/multiple-entrypoint': Package.build > link > types-target 1`] = `"../src/index.ts"`;
761
+
762
+ exports[`'/single-entrypoint': Package.build > default > check 1`] = `
763
+ {
764
+ "output": {
765
+ "attw": "
766
+ single-entrypoint v0.0.0
767
+
768
+ (ignoring resolutions: 'node10', 'node16-cjs')
769
+
770
+ (ignored per resolution) ⚠️ A require call resolved to an ESM JavaScript file, which is an error in Node and some bundlers. CommonJS consumers will need to use a dynamic import. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSResolvesToESM.md
771
+
772
+
773
+ "single-entrypoint"
774
+
775
+ node16 (from ESM): 🟢 (ESM)
776
+ bundler: 🟢
777
+ node10: (ignored) 🟢
778
+ node16 (from CJS): (ignored) ⚠️ ESM (dynamic import only)
779
+
780
+ ***********************************
781
+ ",
782
+ "publint": "Running publint v0.3.14 for single-entrypoint...
783
+ Packing files with \`bun pack\`...
784
+ Linting...
785
+ All good!
786
+ ",
787
+ },
788
+ }
789
+ `;
790
+
791
+ exports[`'/single-entrypoint': Package.build > default > main 1`] = `
792
+ "import { bar as bar1, foo as foo1 } from './foo.js';
793
+ export function foo(options = {}) {
794
+ foo1(options);
795
+ console.log('Hello, foo!', options.value);
796
+ }
797
+ export function bar(options = {}) {
798
+ bar1(options);
799
+ console.log('Hello, bar!', options.value);
800
+ }
801
+ (function (bar) {
802
+ function baz(options = {}) {
803
+ console.log('Hello, baz!', options.value);
804
+ }
805
+ bar.baz = baz;
806
+ })(bar || (bar = {}));
807
+ //# sourceMappingURL=index.js.map"
808
+ `;
809
+
810
+ exports[`'/single-entrypoint': Package.build > default > output 1`] = `
811
+ "{
812
+ "name": "single-entrypoint",
813
+ "version": "0.0.0",
814
+ "type": "module",
815
+ "main": "./dist/index.js",
816
+ "sideEffects": false,
817
+ "module": "./dist/index.js",
818
+ "types": "./dist/index.d.ts",
819
+ "exports": {
820
+ ".": {
821
+ "src": "./index.ts",
822
+ "types": "./dist/index.d.ts",
823
+ "default": "./dist/index.js"
824
+ }
825
+ }
826
+ }
827
+
828
+
829
+ ├── dist
830
+ │ ├── foo.d.ts
831
+ │ ├── foo.d.ts.map
832
+ │ ├── foo.js
833
+ │ ├── foo.js.map
834
+ │ ├── index.d.ts
835
+ │ ├── index.d.ts.map
836
+ │ ├── index.js
837
+ │ └── index.js.map
838
+ ├── foo.ts
839
+ ├── index.ts
840
+ ├── package.json
841
+ └── tsconfig.json
842
+ "
843
+ `;
844
+
845
+ exports[`'/single-entrypoint': Package.build > default > result 1`] = `
846
+ {
847
+ "packageJson": {
848
+ "exports": {
849
+ ".": {
850
+ "default": "./dist/index.js",
851
+ "src": "./index.ts",
852
+ "types": "./dist/index.d.ts",
853
+ },
854
+ },
855
+ "main": "./dist/index.js",
856
+ "module": "./dist/index.js",
857
+ "name": "single-entrypoint",
858
+ "sideEffects": false,
859
+ "type": "module",
860
+ "types": "./dist/index.d.ts",
861
+ "version": "0.0.0",
862
+ },
863
+ "tsConfig": {
864
+ "compilerOptions": {
865
+ "composite": false,
866
+ "declaration": true,
867
+ "declarationDir": undefined,
868
+ "declarationMap": true,
869
+ "emitDeclarationOnly": false,
870
+ "esModuleInterop": true,
871
+ "isolatedModules": true,
872
+ "module": "nodenext",
873
+ "moduleDetection": "force",
874
+ "moduleResolution": "nodenext",
875
+ "noEmit": false,
876
+ "outDir": "/repos/single-entrypoint/dist",
877
+ "skipLibCheck": true,
878
+ "sourceMap": true,
879
+ "strict": true,
880
+ "target": "es2021",
881
+ "verbatimModuleSyntax": true,
882
+ },
883
+ "exclude": [],
884
+ "include": [
885
+ "/repos/single-entrypoint/index.ts",
886
+ ],
887
+ },
888
+ }
889
+ `;
890
+
891
+ exports[`'/single-entrypoint': Package.build > default > types 1`] = `
892
+ "export declare function foo(options?: foo.Options): void;
893
+ export declare namespace foo {
894
+ type Options = {
895
+ value?: string | undefined;
896
+ };
897
+ }
898
+ export declare function bar(options?: bar.Options): void;
899
+ export declare namespace bar {
900
+ type Options = {
901
+ value?: string | undefined;
902
+ };
903
+ function baz(options?: Options): void;
904
+ }
905
+ //# sourceMappingURL=index.d.ts.map"
906
+ `;
907
+
908
+ exports[`'/single-entrypoint': Package.build > link > main-target 1`] = `"../index.ts"`;
909
+
910
+ exports[`'/single-entrypoint': Package.build > link > output 1`] = `
911
+ "{
912
+ "name": "single-entrypoint",
913
+ "version": "0.0.0",
914
+ "type": "module",
915
+ "main": "./dist/index.js",
916
+ "sideEffects": false,
917
+ "module": "./dist/index.js",
918
+ "types": "./dist/index.d.ts",
919
+ "exports": {
920
+ ".": {
921
+ "src": "./index.ts",
922
+ "types": "./dist/index.d.ts",
923
+ "default": "./dist/index.js"
924
+ }
925
+ }
926
+ }
927
+
928
+
929
+ ├── dist
930
+ │ ├── index.d.ts -> ../index.ts
931
+ │ └── index.js -> ../index.ts
932
+ ├── foo.ts
933
+ ├── index.ts
934
+ ├── package.json
935
+ └── tsconfig.json
936
+ "
937
+ `;
938
+
939
+ exports[`'/single-entrypoint': Package.build > link > result 1`] = `
940
+ {
941
+ "packageJson": {
942
+ "exports": {
943
+ ".": {
944
+ "default": "./dist/index.js",
945
+ "src": "./index.ts",
946
+ "types": "./dist/index.d.ts",
947
+ },
948
+ },
949
+ "main": "./dist/index.js",
950
+ "module": "./dist/index.js",
951
+ "name": "single-entrypoint",
952
+ "sideEffects": false,
953
+ "type": "module",
954
+ "types": "./dist/index.d.ts",
955
+ "version": "0.0.0",
956
+ },
957
+ "tsConfig": {
958
+ "compilerOptions": {
959
+ "isolatedModules": true,
960
+ "module": "nodenext",
961
+ "moduleDetection": "force",
962
+ "moduleResolution": "nodenext",
963
+ "noEmit": true,
964
+ "skipLibCheck": true,
965
+ "strict": true,
966
+ "verbatimModuleSyntax": true,
967
+ },
968
+ },
969
+ }
970
+ `;
971
+
972
+ exports[`'/single-entrypoint': Package.build > link > types-target 1`] = `"../index.ts"`;