zile 0.0.13 β 0.0.15
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.
- package/README.md +9 -1
- package/dist/Package.d.ts +3 -1
- package/dist/Package.d.ts.map +1 -1
- package/dist/Package.js +99 -15
- package/dist/Package.js.map +1 -1
- package/dist/internal/package.json +1 -1
- package/package.json +2 -2
- package/src/Package.ts +102 -15
- package/src/Packages.test.ts +12 -0
- package/src/__snapshots__/Cli.test.ts.snap +289 -14
- package/src/__snapshots__/Package.test.ts.snap +872 -214
- package/src/__snapshots__/Packages.test.ts.snap +144 -0
|
@@ -80,13 +80,13 @@ exports[`'/basic': Package.build > default > output 1`] = `
|
|
|
80
80
|
"main": "./dist/index.js",
|
|
81
81
|
"exports": {
|
|
82
82
|
".": {
|
|
83
|
-
"src": "./index.ts",
|
|
84
83
|
"types": "./dist/index.d.ts",
|
|
84
|
+
"src": "./index.ts",
|
|
85
85
|
"default": "./dist/index.js"
|
|
86
86
|
},
|
|
87
87
|
"./foo": {
|
|
88
|
-
"src": "./foo.ts",
|
|
89
88
|
"types": "./dist/foo.d.ts",
|
|
89
|
+
"src": "./foo.ts",
|
|
90
90
|
"default": "./dist/foo.js"
|
|
91
91
|
},
|
|
92
92
|
"./config": "./dist/config.json"
|
|
@@ -210,13 +210,13 @@ exports[`'/basic': Package.build > link > output 1`] = `
|
|
|
210
210
|
"main": "./dist/index.js",
|
|
211
211
|
"exports": {
|
|
212
212
|
".": {
|
|
213
|
-
"src": "./index.ts",
|
|
214
213
|
"types": "./dist/index.d.ts",
|
|
214
|
+
"src": "./index.ts",
|
|
215
215
|
"default": "./dist/index.js"
|
|
216
216
|
},
|
|
217
217
|
"./foo": {
|
|
218
|
-
"src": "./foo.ts",
|
|
219
218
|
"types": "./dist/foo.d.ts",
|
|
219
|
+
"src": "./foo.ts",
|
|
220
220
|
"default": "./dist/foo.js"
|
|
221
221
|
},
|
|
222
222
|
"./config": "./dist/config.json"
|
|
@@ -342,8 +342,8 @@ exports[`'/basic-object-exports': Package.build > default > output 1`] = `
|
|
|
342
342
|
"type": "module",
|
|
343
343
|
"exports": {
|
|
344
344
|
".": {
|
|
345
|
-
"src": "./index.ts",
|
|
346
345
|
"types": "./dist/index.d.ts",
|
|
346
|
+
"src": "./index.ts",
|
|
347
347
|
"default": "./dist/index.js"
|
|
348
348
|
}
|
|
349
349
|
},
|
|
@@ -443,8 +443,8 @@ exports[`'/basic-object-exports': Package.build > link > output 1`] = `
|
|
|
443
443
|
"type": "module",
|
|
444
444
|
"exports": {
|
|
445
445
|
".": {
|
|
446
|
-
"src": "./index.ts",
|
|
447
446
|
"types": "./dist/index.d.ts",
|
|
447
|
+
"src": "./index.ts",
|
|
448
448
|
"default": "./dist/index.js"
|
|
449
449
|
}
|
|
450
450
|
},
|
|
@@ -501,29 +501,11 @@ exports[`'/basic-object-exports': Package.build > link > result 1`] = `
|
|
|
501
501
|
|
|
502
502
|
exports[`'/basic-object-exports': Package.build > link > types-target 1`] = `"../index.ts"`;
|
|
503
503
|
|
|
504
|
-
exports[`'/
|
|
505
|
-
|
|
506
|
-
exports[`'/error-bin-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#bin\`]`;
|
|
507
|
-
|
|
508
|
-
exports[`'/error-exports-object-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."].src\`]`;
|
|
509
|
-
|
|
510
|
-
exports[`'/error-exports-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."]\`]`;
|
|
511
|
-
|
|
512
|
-
exports[`'/error-main-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#main\`]`;
|
|
513
|
-
|
|
514
|
-
exports[`'/error-missing-entry-fields': Package.build > default > error 1`] = `[Error: package.json must have an \`exports\`, \`main\`, or \`bin\` field]`;
|
|
515
|
-
|
|
516
|
-
exports[`'/error-module-resolution': Package.build > default > error 1`] = `
|
|
517
|
-
"/repos/error-module-resolution/tsconfig.json has invalid configuration:
|
|
518
|
-
- "module" must be "nodenext". Found: "preserve"
|
|
519
|
-
- "moduleResolution" must be "nodenext". Found: "bundler""
|
|
520
|
-
`;
|
|
521
|
-
|
|
522
|
-
exports[`'/multiple-entrypoint': Package.build > default > check 1`] = `
|
|
504
|
+
exports[`'/dts-exports': Package.build > default > check 1`] = `
|
|
523
505
|
{
|
|
524
506
|
"output": {
|
|
525
507
|
"attw": "
|
|
526
|
-
|
|
508
|
+
dts-exports v0.0.0
|
|
527
509
|
|
|
528
510
|
(ignoring resolutions: 'node10', 'node16-cjs')
|
|
529
511
|
|
|
@@ -532,7 +514,7 @@ multiple-entrypoint v0.0.0
|
|
|
532
514
|
(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
|
|
533
515
|
|
|
534
516
|
|
|
535
|
-
"
|
|
517
|
+
"dts-exports"
|
|
536
518
|
|
|
537
519
|
node16 (from ESM): π’ (ESM)
|
|
538
520
|
bundler: π’
|
|
@@ -541,16 +523,7 @@ node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
|
541
523
|
|
|
542
524
|
***********************************
|
|
543
525
|
|
|
544
|
-
"
|
|
545
|
-
|
|
546
|
-
node16 (from ESM): π’ (ESM)
|
|
547
|
-
bundler: π’
|
|
548
|
-
node10: (ignored) π Resolution failed
|
|
549
|
-
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
550
|
-
|
|
551
|
-
***********************************
|
|
552
|
-
|
|
553
|
-
"multiple-entrypoint/nested/dir"
|
|
526
|
+
"dts-exports/globals"
|
|
554
527
|
|
|
555
528
|
node16 (from ESM): π’ (ESM)
|
|
556
529
|
bundler: π’
|
|
@@ -559,7 +532,7 @@ node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
|
559
532
|
|
|
560
533
|
***********************************
|
|
561
534
|
",
|
|
562
|
-
"publint": "Running publint v0.3.14 for
|
|
535
|
+
"publint": "Running publint v0.3.14 for dts-exports...
|
|
563
536
|
Packing files with \`bun pack\`...
|
|
564
537
|
Linting...
|
|
565
538
|
All good!
|
|
@@ -568,49 +541,29 @@ All good!
|
|
|
568
541
|
}
|
|
569
542
|
`;
|
|
570
543
|
|
|
571
|
-
exports[`'/
|
|
572
|
-
"
|
|
573
|
-
export function foo(options = {}) {
|
|
574
|
-
foo1(options);
|
|
575
|
-
console.log('Hello, foo!', options.value);
|
|
576
|
-
}
|
|
577
|
-
export function bar(options = {}) {
|
|
578
|
-
bar1(options);
|
|
579
|
-
console.log('Hello, bar!', options.value);
|
|
580
|
-
}
|
|
581
|
-
(function (bar) {
|
|
582
|
-
function baz(options = {}) {
|
|
583
|
-
console.log('Hello, baz!', options.value);
|
|
584
|
-
}
|
|
585
|
-
bar.baz = baz;
|
|
586
|
-
})(bar || (bar = {}));
|
|
544
|
+
exports[`'/dts-exports': Package.build > default > main 1`] = `
|
|
545
|
+
"export const foo = 'bar';
|
|
587
546
|
//# sourceMappingURL=index.js.map"
|
|
588
547
|
`;
|
|
589
548
|
|
|
590
|
-
exports[`'/
|
|
549
|
+
exports[`'/dts-exports': Package.build > default > output 1`] = `
|
|
591
550
|
"{
|
|
592
|
-
"name": "
|
|
551
|
+
"name": "dts-exports",
|
|
593
552
|
"version": "0.0.0",
|
|
594
553
|
"type": "module",
|
|
554
|
+
"main": "./dist/index.js",
|
|
595
555
|
"exports": {
|
|
596
556
|
".": {
|
|
597
|
-
"src": "./src/index.ts",
|
|
598
557
|
"types": "./dist/index.d.ts",
|
|
558
|
+
"src": "./src/index.ts",
|
|
599
559
|
"default": "./dist/index.js"
|
|
600
560
|
},
|
|
601
|
-
"./
|
|
602
|
-
"
|
|
603
|
-
"
|
|
604
|
-
"default": "./dist/foo.js"
|
|
605
|
-
},
|
|
606
|
-
"./nested/dir": {
|
|
607
|
-
"src": "./src/nested/dir/bar.ts",
|
|
608
|
-
"types": "./dist/nested/dir/bar.d.ts",
|
|
609
|
-
"default": "./dist/nested/dir/bar.js"
|
|
561
|
+
"./globals": {
|
|
562
|
+
"types": "./dist/globals.d.ts",
|
|
563
|
+
"src": "./src/globals.d.ts"
|
|
610
564
|
}
|
|
611
565
|
},
|
|
612
566
|
"sideEffects": false,
|
|
613
|
-
"main": "./dist/index.js",
|
|
614
567
|
"module": "./dist/index.js",
|
|
615
568
|
"types": "./dist/index.d.ts"
|
|
616
569
|
}
|
|
@@ -618,32 +571,20 @@ exports[`'/multiple-entrypoint': Package.build > default > output 1`] = `
|
|
|
618
571
|
|
|
619
572
|
|
|
620
573
|
βββ dist
|
|
621
|
-
β βββ
|
|
622
|
-
β β βββ dir
|
|
623
|
-
β β βββ bar.d.ts
|
|
624
|
-
β β βββ bar.d.ts.map
|
|
625
|
-
β β βββ bar.js
|
|
626
|
-
β β βββ bar.js.map
|
|
627
|
-
β βββ foo.d.ts
|
|
628
|
-
β βββ foo.d.ts.map
|
|
629
|
-
β βββ foo.js
|
|
630
|
-
β βββ foo.js.map
|
|
574
|
+
β βββ globals.d.ts
|
|
631
575
|
β βββ index.d.ts
|
|
632
576
|
β βββ index.d.ts.map
|
|
633
577
|
β βββ index.js
|
|
634
578
|
β βββ index.js.map
|
|
635
579
|
βββ src
|
|
636
|
-
β βββ
|
|
637
|
-
β β βββ dir
|
|
638
|
-
β β βββ bar.ts
|
|
639
|
-
β βββ foo.ts
|
|
580
|
+
β βββ globals.d.ts
|
|
640
581
|
β βββ index.ts
|
|
641
582
|
βββ package.json
|
|
642
583
|
βββ tsconfig.json
|
|
643
584
|
"
|
|
644
585
|
`;
|
|
645
586
|
|
|
646
|
-
exports[`'/
|
|
587
|
+
exports[`'/dts-exports': Package.build > default > result 1`] = `
|
|
647
588
|
{
|
|
648
589
|
"packageJson": {
|
|
649
590
|
"exports": {
|
|
@@ -652,20 +593,14 @@ exports[`'/multiple-entrypoint': Package.build > default > result 1`] = `
|
|
|
652
593
|
"src": "./src/index.ts",
|
|
653
594
|
"types": "./dist/index.d.ts",
|
|
654
595
|
},
|
|
655
|
-
"./
|
|
656
|
-
"
|
|
657
|
-
"
|
|
658
|
-
"types": "./dist/foo.d.ts",
|
|
659
|
-
},
|
|
660
|
-
"./nested/dir": {
|
|
661
|
-
"default": "./dist/nested/dir/bar.js",
|
|
662
|
-
"src": "./src/nested/dir/bar.ts",
|
|
663
|
-
"types": "./dist/nested/dir/bar.d.ts",
|
|
596
|
+
"./globals": {
|
|
597
|
+
"src": "./src/globals.d.ts",
|
|
598
|
+
"types": "./dist/globals.d.ts",
|
|
664
599
|
},
|
|
665
600
|
},
|
|
666
601
|
"main": "./dist/index.js",
|
|
667
602
|
"module": "./dist/index.js",
|
|
668
|
-
"name": "
|
|
603
|
+
"name": "dts-exports",
|
|
669
604
|
"sideEffects": false,
|
|
670
605
|
"type": "module",
|
|
671
606
|
"types": "./dist/index.d.ts",
|
|
@@ -684,7 +619,7 @@ exports[`'/multiple-entrypoint': Package.build > default > result 1`] = `
|
|
|
684
619
|
"moduleDetection": "force",
|
|
685
620
|
"moduleResolution": "nodenext",
|
|
686
621
|
"noEmit": false,
|
|
687
|
-
"outDir": "/repos/
|
|
622
|
+
"outDir": "/repos/dts-exports/dist",
|
|
688
623
|
"skipLibCheck": true,
|
|
689
624
|
"sourceMap": true,
|
|
690
625
|
"strict": true,
|
|
@@ -693,57 +628,37 @@ exports[`'/multiple-entrypoint': Package.build > default > result 1`] = `
|
|
|
693
628
|
},
|
|
694
629
|
"exclude": [],
|
|
695
630
|
"include": [
|
|
696
|
-
"/repos/
|
|
697
|
-
"/repos/multiple-entrypoint/src/foo.ts",
|
|
698
|
-
"/repos/multiple-entrypoint/src/nested/dir/bar.ts",
|
|
631
|
+
"/repos/dts-exports/src/index.ts",
|
|
699
632
|
],
|
|
700
633
|
},
|
|
701
634
|
}
|
|
702
635
|
`;
|
|
703
636
|
|
|
704
|
-
exports[`'/
|
|
705
|
-
"export declare
|
|
706
|
-
export declare namespace foo {
|
|
707
|
-
type Options = {
|
|
708
|
-
value?: string | undefined;
|
|
709
|
-
};
|
|
710
|
-
}
|
|
711
|
-
export declare function bar(options?: bar.Options): void;
|
|
712
|
-
export declare namespace bar {
|
|
713
|
-
type Options = {
|
|
714
|
-
value?: string | undefined;
|
|
715
|
-
};
|
|
716
|
-
function baz(options?: Options): void;
|
|
717
|
-
}
|
|
637
|
+
exports[`'/dts-exports': Package.build > default > types 1`] = `
|
|
638
|
+
"export declare const foo = "bar";
|
|
718
639
|
//# sourceMappingURL=index.d.ts.map"
|
|
719
640
|
`;
|
|
720
641
|
|
|
721
|
-
exports[`'/
|
|
642
|
+
exports[`'/dts-exports': Package.build > link > main-target 1`] = `"../src/index.ts"`;
|
|
722
643
|
|
|
723
|
-
exports[`'/
|
|
644
|
+
exports[`'/dts-exports': Package.build > link > output 1`] = `
|
|
724
645
|
"{
|
|
725
|
-
"name": "
|
|
646
|
+
"name": "dts-exports",
|
|
726
647
|
"version": "0.0.0",
|
|
727
648
|
"type": "module",
|
|
649
|
+
"main": "./dist/index.js",
|
|
728
650
|
"exports": {
|
|
729
651
|
".": {
|
|
730
|
-
"src": "./src/index.ts",
|
|
731
652
|
"types": "./dist/index.d.ts",
|
|
653
|
+
"src": "./src/index.ts",
|
|
732
654
|
"default": "./dist/index.js"
|
|
733
655
|
},
|
|
734
|
-
"./
|
|
735
|
-
"
|
|
736
|
-
"
|
|
737
|
-
"default": "./dist/foo.js"
|
|
738
|
-
},
|
|
739
|
-
"./nested/dir": {
|
|
740
|
-
"src": "./src/nested/dir/bar.ts",
|
|
741
|
-
"types": "./dist/nested/dir/bar.d.ts",
|
|
742
|
-
"default": "./dist/nested/dir/bar.js"
|
|
656
|
+
"./globals": {
|
|
657
|
+
"types": "./dist/globals.d.ts",
|
|
658
|
+
"src": "./src/globals.d.ts"
|
|
743
659
|
}
|
|
744
660
|
},
|
|
745
661
|
"sideEffects": false,
|
|
746
|
-
"main": "./dist/index.js",
|
|
747
662
|
"module": "./dist/index.js",
|
|
748
663
|
"types": "./dist/index.d.ts"
|
|
749
664
|
}
|
|
@@ -751,26 +666,18 @@ exports[`'/multiple-entrypoint': Package.build > link > output 1`] = `
|
|
|
751
666
|
|
|
752
667
|
|
|
753
668
|
βββ dist
|
|
754
|
-
β βββ
|
|
755
|
-
β β βββ dir
|
|
756
|
-
β β βββ bar.d.ts -> ../../../src/nested/dir/bar.ts
|
|
757
|
-
β β βββ bar.js -> ../../../src/nested/dir/bar.ts
|
|
758
|
-
β βββ foo.d.ts -> ../src/foo.ts
|
|
759
|
-
β βββ foo.js -> ../src/foo.ts
|
|
669
|
+
β βββ globals.d.ts -> ../src/globals.d.ts
|
|
760
670
|
β βββ index.d.ts -> ../src/index.ts
|
|
761
671
|
β βββ index.js -> ../src/index.ts
|
|
762
672
|
βββ src
|
|
763
|
-
β βββ
|
|
764
|
-
β β βββ dir
|
|
765
|
-
β β βββ bar.ts
|
|
766
|
-
β βββ foo.ts
|
|
673
|
+
β βββ globals.d.ts
|
|
767
674
|
β βββ index.ts
|
|
768
675
|
βββ package.json
|
|
769
676
|
βββ tsconfig.json
|
|
770
677
|
"
|
|
771
678
|
`;
|
|
772
679
|
|
|
773
|
-
exports[`'/
|
|
680
|
+
exports[`'/dts-exports': Package.build > link > result 1`] = `
|
|
774
681
|
{
|
|
775
682
|
"packageJson": {
|
|
776
683
|
"exports": {
|
|
@@ -779,20 +686,14 @@ exports[`'/multiple-entrypoint': Package.build > link > result 1`] = `
|
|
|
779
686
|
"src": "./src/index.ts",
|
|
780
687
|
"types": "./dist/index.d.ts",
|
|
781
688
|
},
|
|
782
|
-
"./
|
|
783
|
-
"
|
|
784
|
-
"
|
|
785
|
-
"types": "./dist/foo.d.ts",
|
|
786
|
-
},
|
|
787
|
-
"./nested/dir": {
|
|
788
|
-
"default": "./dist/nested/dir/bar.js",
|
|
789
|
-
"src": "./src/nested/dir/bar.ts",
|
|
790
|
-
"types": "./dist/nested/dir/bar.d.ts",
|
|
689
|
+
"./globals": {
|
|
690
|
+
"src": "./src/globals.d.ts",
|
|
691
|
+
"types": "./dist/globals.d.ts",
|
|
791
692
|
},
|
|
792
693
|
},
|
|
793
694
|
"main": "./dist/index.js",
|
|
794
695
|
"module": "./dist/index.js",
|
|
795
|
-
"name": "
|
|
696
|
+
"name": "dts-exports",
|
|
796
697
|
"sideEffects": false,
|
|
797
698
|
"type": "module",
|
|
798
699
|
"types": "./dist/index.d.ts",
|
|
@@ -813,29 +714,40 @@ exports[`'/multiple-entrypoint': Package.build > link > result 1`] = `
|
|
|
813
714
|
}
|
|
814
715
|
`;
|
|
815
716
|
|
|
816
|
-
exports[`'/
|
|
717
|
+
exports[`'/dts-exports': Package.build > link > types-target 1`] = `"../src/index.ts"`;
|
|
817
718
|
|
|
818
|
-
exports[`'/
|
|
719
|
+
exports[`'/dts-exports-object': Package.build > default > check 1`] = `
|
|
819
720
|
{
|
|
820
721
|
"output": {
|
|
821
722
|
"attw": "
|
|
822
|
-
|
|
723
|
+
dts-exports-object v0.0.0
|
|
823
724
|
|
|
824
725
|
(ignoring resolutions: 'node10', 'node16-cjs')
|
|
825
726
|
|
|
826
727
|
(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
|
|
827
728
|
|
|
729
|
+
(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
|
|
828
730
|
|
|
829
|
-
|
|
731
|
+
|
|
732
|
+
"dts-exports-object"
|
|
830
733
|
|
|
831
734
|
node16 (from ESM): π’ (ESM)
|
|
832
735
|
bundler: π’
|
|
833
736
|
node10: (ignored) π’
|
|
834
737
|
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
835
738
|
|
|
739
|
+
***********************************
|
|
740
|
+
|
|
741
|
+
"dts-exports-object/globals"
|
|
742
|
+
|
|
743
|
+
node16 (from ESM): π’ (ESM)
|
|
744
|
+
bundler: π’
|
|
745
|
+
node10: (ignored) π Resolution failed
|
|
746
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
747
|
+
|
|
836
748
|
***********************************
|
|
837
749
|
",
|
|
838
|
-
"publint": "Running publint v0.3.14 for
|
|
750
|
+
"publint": "Running publint v0.3.14 for dts-exports-object...
|
|
839
751
|
Packing files with \`bun pack\`...
|
|
840
752
|
Linting...
|
|
841
753
|
All good!
|
|
@@ -844,74 +756,66 @@ All good!
|
|
|
844
756
|
}
|
|
845
757
|
`;
|
|
846
758
|
|
|
847
|
-
exports[`'/
|
|
848
|
-
"
|
|
849
|
-
export function foo(options = {}) {
|
|
850
|
-
foo1(options);
|
|
851
|
-
console.log('Hello, foo!', options.value);
|
|
852
|
-
}
|
|
853
|
-
export function bar(options = {}) {
|
|
854
|
-
bar1(options);
|
|
855
|
-
console.log('Hello, bar!', options.value);
|
|
856
|
-
}
|
|
857
|
-
(function (bar) {
|
|
858
|
-
function baz(options = {}) {
|
|
859
|
-
console.log('Hello, baz!', options.value);
|
|
860
|
-
}
|
|
861
|
-
bar.baz = baz;
|
|
862
|
-
})(bar || (bar = {}));
|
|
759
|
+
exports[`'/dts-exports-object': Package.build > default > main 1`] = `
|
|
760
|
+
"export const foo = 'bar';
|
|
863
761
|
//# sourceMappingURL=index.js.map"
|
|
864
762
|
`;
|
|
865
763
|
|
|
866
|
-
exports[`'/
|
|
764
|
+
exports[`'/dts-exports-object': Package.build > default > output 1`] = `
|
|
867
765
|
"{
|
|
868
|
-
"name": "
|
|
766
|
+
"name": "dts-exports-object",
|
|
869
767
|
"version": "0.0.0",
|
|
870
768
|
"type": "module",
|
|
871
769
|
"main": "./dist/index.js",
|
|
872
|
-
"sideEffects": false,
|
|
873
|
-
"module": "./dist/index.js",
|
|
874
|
-
"types": "./dist/index.d.ts",
|
|
875
770
|
"exports": {
|
|
876
771
|
".": {
|
|
877
|
-
"src": "./index.ts",
|
|
878
772
|
"types": "./dist/index.d.ts",
|
|
773
|
+
"src": "./src/index.ts",
|
|
879
774
|
"default": "./dist/index.js"
|
|
775
|
+
},
|
|
776
|
+
"./globals": {
|
|
777
|
+
"types": "./dist/globals.d.ts",
|
|
778
|
+
"src": "./src/globals.d.ts"
|
|
880
779
|
}
|
|
881
|
-
}
|
|
780
|
+
},
|
|
781
|
+
"sideEffects": false,
|
|
782
|
+
"module": "./dist/index.js",
|
|
783
|
+
"types": "./dist/index.d.ts"
|
|
882
784
|
}
|
|
883
785
|
|
|
884
786
|
|
|
885
787
|
|
|
886
788
|
βββ dist
|
|
887
|
-
β βββ
|
|
888
|
-
β βββ foo.d.ts.map
|
|
889
|
-
β βββ foo.js
|
|
890
|
-
β βββ foo.js.map
|
|
789
|
+
β βββ globals.d.ts
|
|
891
790
|
β βββ index.d.ts
|
|
892
791
|
β βββ index.d.ts.map
|
|
893
792
|
β βββ index.js
|
|
894
793
|
β βββ index.js.map
|
|
895
|
-
βββ
|
|
896
|
-
βββ
|
|
794
|
+
βββ src
|
|
795
|
+
β βββ globals.d.ts
|
|
796
|
+
β βββ index.ts
|
|
897
797
|
βββ package.json
|
|
898
798
|
βββ tsconfig.json
|
|
899
799
|
"
|
|
900
800
|
`;
|
|
901
801
|
|
|
902
|
-
exports[`'/
|
|
802
|
+
exports[`'/dts-exports-object': Package.build > default > result 1`] = `
|
|
903
803
|
{
|
|
904
804
|
"packageJson": {
|
|
905
805
|
"exports": {
|
|
906
806
|
".": {
|
|
907
807
|
"default": "./dist/index.js",
|
|
908
|
-
"src": "./index.ts",
|
|
808
|
+
"src": "./src/index.ts",
|
|
909
809
|
"types": "./dist/index.d.ts",
|
|
910
810
|
},
|
|
811
|
+
"./globals": {
|
|
812
|
+
"src": "./src/globals.d.ts",
|
|
813
|
+
"types": "./dist/globals.d.ts",
|
|
814
|
+
},
|
|
911
815
|
},
|
|
912
816
|
"main": "./dist/index.js",
|
|
913
817
|
"module": "./dist/index.js",
|
|
914
|
-
"name": "
|
|
818
|
+
"name": "dts-exports-object",
|
|
915
819
|
"sideEffects": false,
|
|
916
820
|
"type": "module",
|
|
917
821
|
"types": "./dist/index.d.ts",
|
|
@@ -930,7 +834,7 @@ exports[`'/single-entrypoint': Package.build > default > result 1`] = `
|
|
|
930
834
|
"moduleDetection": "force",
|
|
931
835
|
"moduleResolution": "nodenext",
|
|
932
836
|
"noEmit": false,
|
|
933
|
-
"outDir": "/repos/
|
|
837
|
+
"outDir": "/repos/dts-exports-object/dist",
|
|
934
838
|
"skipLibCheck": true,
|
|
935
839
|
"sourceMap": true,
|
|
936
840
|
"strict": true,
|
|
@@ -939,74 +843,72 @@ exports[`'/single-entrypoint': Package.build > default > result 1`] = `
|
|
|
939
843
|
},
|
|
940
844
|
"exclude": [],
|
|
941
845
|
"include": [
|
|
942
|
-
"/repos/
|
|
846
|
+
"/repos/dts-exports-object/src/index.ts",
|
|
943
847
|
],
|
|
944
848
|
},
|
|
945
849
|
}
|
|
946
850
|
`;
|
|
947
851
|
|
|
948
|
-
exports[`'/
|
|
949
|
-
"export declare
|
|
950
|
-
export declare namespace foo {
|
|
951
|
-
type Options = {
|
|
952
|
-
value?: string | undefined;
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
export declare function bar(options?: bar.Options): void;
|
|
956
|
-
export declare namespace bar {
|
|
957
|
-
type Options = {
|
|
958
|
-
value?: string | undefined;
|
|
959
|
-
};
|
|
960
|
-
function baz(options?: Options): void;
|
|
961
|
-
}
|
|
852
|
+
exports[`'/dts-exports-object': Package.build > default > types 1`] = `
|
|
853
|
+
"export declare const foo = "bar";
|
|
962
854
|
//# sourceMappingURL=index.d.ts.map"
|
|
963
855
|
`;
|
|
964
856
|
|
|
965
|
-
exports[`'/
|
|
857
|
+
exports[`'/dts-exports-object': Package.build > link > main-target 1`] = `"../src/index.ts"`;
|
|
966
858
|
|
|
967
|
-
exports[`'/
|
|
859
|
+
exports[`'/dts-exports-object': Package.build > link > output 1`] = `
|
|
968
860
|
"{
|
|
969
|
-
"name": "
|
|
861
|
+
"name": "dts-exports-object",
|
|
970
862
|
"version": "0.0.0",
|
|
971
863
|
"type": "module",
|
|
972
864
|
"main": "./dist/index.js",
|
|
973
|
-
"sideEffects": false,
|
|
974
|
-
"module": "./dist/index.js",
|
|
975
|
-
"types": "./dist/index.d.ts",
|
|
976
865
|
"exports": {
|
|
977
866
|
".": {
|
|
978
|
-
"src": "./index.ts",
|
|
979
867
|
"types": "./dist/index.d.ts",
|
|
868
|
+
"src": "./src/index.ts",
|
|
980
869
|
"default": "./dist/index.js"
|
|
870
|
+
},
|
|
871
|
+
"./globals": {
|
|
872
|
+
"types": "./dist/globals.d.ts",
|
|
873
|
+
"src": "./src/globals.d.ts"
|
|
981
874
|
}
|
|
982
|
-
}
|
|
875
|
+
},
|
|
876
|
+
"sideEffects": false,
|
|
877
|
+
"module": "./dist/index.js",
|
|
878
|
+
"types": "./dist/index.d.ts"
|
|
983
879
|
}
|
|
984
880
|
|
|
985
881
|
|
|
986
882
|
|
|
987
883
|
βββ dist
|
|
988
|
-
β βββ
|
|
989
|
-
β
|
|
990
|
-
|
|
991
|
-
βββ
|
|
884
|
+
β βββ globals.d.ts -> ../src/globals.d.ts
|
|
885
|
+
β βββ index.d.ts -> ../src/index.ts
|
|
886
|
+
β βββ index.js -> ../src/index.ts
|
|
887
|
+
βββ src
|
|
888
|
+
β βββ globals.d.ts
|
|
889
|
+
β βββ index.ts
|
|
992
890
|
βββ package.json
|
|
993
891
|
βββ tsconfig.json
|
|
994
892
|
"
|
|
995
893
|
`;
|
|
996
894
|
|
|
997
|
-
exports[`'/
|
|
895
|
+
exports[`'/dts-exports-object': Package.build > link > result 1`] = `
|
|
998
896
|
{
|
|
999
897
|
"packageJson": {
|
|
1000
898
|
"exports": {
|
|
1001
899
|
".": {
|
|
1002
900
|
"default": "./dist/index.js",
|
|
1003
|
-
"src": "./index.ts",
|
|
901
|
+
"src": "./src/index.ts",
|
|
1004
902
|
"types": "./dist/index.d.ts",
|
|
1005
903
|
},
|
|
904
|
+
"./globals": {
|
|
905
|
+
"src": "./src/globals.d.ts",
|
|
906
|
+
"types": "./dist/globals.d.ts",
|
|
907
|
+
},
|
|
1006
908
|
},
|
|
1007
909
|
"main": "./dist/index.js",
|
|
1008
910
|
"module": "./dist/index.js",
|
|
1009
|
-
"name": "
|
|
911
|
+
"name": "dts-exports-object",
|
|
1010
912
|
"sideEffects": false,
|
|
1011
913
|
"type": "module",
|
|
1012
914
|
"types": "./dist/index.d.ts",
|
|
@@ -1027,4 +929,760 @@ exports[`'/single-entrypoint': Package.build > link > result 1`] = `
|
|
|
1027
929
|
}
|
|
1028
930
|
`;
|
|
1029
931
|
|
|
1030
|
-
exports[`'/
|
|
932
|
+
exports[`'/dts-exports-object': Package.build > link > types-target 1`] = `"../src/index.ts"`;
|
|
933
|
+
|
|
934
|
+
exports[`'/error-bin-object-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent-cli.ts\` does not exist on \`package.json#bin.cli\`]`;
|
|
935
|
+
|
|
936
|
+
exports[`'/error-bin-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#bin\`]`;
|
|
937
|
+
|
|
938
|
+
exports[`'/error-exports-object-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."].src\`]`;
|
|
939
|
+
|
|
940
|
+
exports[`'/error-exports-string-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#exports["."]\`]`;
|
|
941
|
+
|
|
942
|
+
exports[`'/error-main-not-exists': Package.build > default > error 1`] = `[Error: \`./non-existent.ts\` does not exist on \`package.json#main\`]`;
|
|
943
|
+
|
|
944
|
+
exports[`'/error-missing-entry-fields': Package.build > default > error 1`] = `[Error: package.json must have an \`exports\`, \`main\`, or \`bin\` field]`;
|
|
945
|
+
|
|
946
|
+
exports[`'/error-module-resolution': Package.build > default > error 1`] = `
|
|
947
|
+
"/repos/error-module-resolution/tsconfig.json has invalid configuration:
|
|
948
|
+
- "module" must be "nodenext". Found: "preserve"
|
|
949
|
+
- "moduleResolution" must be "nodenext". Found: "bundler""
|
|
950
|
+
`;
|
|
951
|
+
|
|
952
|
+
exports[`'/multiple-entrypoint': Package.build > default > check 1`] = `
|
|
953
|
+
{
|
|
954
|
+
"output": {
|
|
955
|
+
"attw": "
|
|
956
|
+
multiple-entrypoint v0.0.0
|
|
957
|
+
|
|
958
|
+
(ignoring resolutions: 'node10', 'node16-cjs')
|
|
959
|
+
|
|
960
|
+
(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
|
|
961
|
+
|
|
962
|
+
(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
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
"multiple-entrypoint"
|
|
966
|
+
|
|
967
|
+
node16 (from ESM): π’ (ESM)
|
|
968
|
+
bundler: π’
|
|
969
|
+
node10: (ignored) π’
|
|
970
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
971
|
+
|
|
972
|
+
***********************************
|
|
973
|
+
|
|
974
|
+
"multiple-entrypoint/foo"
|
|
975
|
+
|
|
976
|
+
node16 (from ESM): π’ (ESM)
|
|
977
|
+
bundler: π’
|
|
978
|
+
node10: (ignored) π Resolution failed
|
|
979
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
980
|
+
|
|
981
|
+
***********************************
|
|
982
|
+
|
|
983
|
+
"multiple-entrypoint/nested/dir"
|
|
984
|
+
|
|
985
|
+
node16 (from ESM): π’ (ESM)
|
|
986
|
+
bundler: π’
|
|
987
|
+
node10: (ignored) π Resolution failed
|
|
988
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
989
|
+
|
|
990
|
+
***********************************
|
|
991
|
+
",
|
|
992
|
+
"publint": "Running publint v0.3.14 for multiple-entrypoint...
|
|
993
|
+
Packing files with \`bun pack\`...
|
|
994
|
+
Linting...
|
|
995
|
+
All good!
|
|
996
|
+
",
|
|
997
|
+
},
|
|
998
|
+
}
|
|
999
|
+
`;
|
|
1000
|
+
|
|
1001
|
+
exports[`'/multiple-entrypoint': Package.build > default > main 1`] = `
|
|
1002
|
+
"import { bar as bar1, foo as foo1 } from './foo.js';
|
|
1003
|
+
export function foo(options = {}) {
|
|
1004
|
+
foo1(options);
|
|
1005
|
+
console.log('Hello, foo!', options.value);
|
|
1006
|
+
}
|
|
1007
|
+
export function bar(options = {}) {
|
|
1008
|
+
bar1(options);
|
|
1009
|
+
console.log('Hello, bar!', options.value);
|
|
1010
|
+
}
|
|
1011
|
+
(function (bar) {
|
|
1012
|
+
function baz(options = {}) {
|
|
1013
|
+
console.log('Hello, baz!', options.value);
|
|
1014
|
+
}
|
|
1015
|
+
bar.baz = baz;
|
|
1016
|
+
})(bar || (bar = {}));
|
|
1017
|
+
//# sourceMappingURL=index.js.map"
|
|
1018
|
+
`;
|
|
1019
|
+
|
|
1020
|
+
exports[`'/multiple-entrypoint': Package.build > default > output 1`] = `
|
|
1021
|
+
"{
|
|
1022
|
+
"name": "multiple-entrypoint",
|
|
1023
|
+
"version": "0.0.0",
|
|
1024
|
+
"type": "module",
|
|
1025
|
+
"exports": {
|
|
1026
|
+
".": {
|
|
1027
|
+
"types": "./dist/index.d.ts",
|
|
1028
|
+
"src": "./src/index.ts",
|
|
1029
|
+
"default": "./dist/index.js"
|
|
1030
|
+
},
|
|
1031
|
+
"./foo": {
|
|
1032
|
+
"types": "./dist/foo.d.ts",
|
|
1033
|
+
"src": "./src/foo.ts",
|
|
1034
|
+
"default": "./dist/foo.js"
|
|
1035
|
+
},
|
|
1036
|
+
"./nested/dir": {
|
|
1037
|
+
"types": "./dist/nested/dir/bar.d.ts",
|
|
1038
|
+
"src": "./src/nested/dir/bar.ts",
|
|
1039
|
+
"default": "./dist/nested/dir/bar.js"
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
"sideEffects": false,
|
|
1043
|
+
"main": "./dist/index.js",
|
|
1044
|
+
"module": "./dist/index.js",
|
|
1045
|
+
"types": "./dist/index.d.ts"
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
βββ dist
|
|
1051
|
+
β βββ nested
|
|
1052
|
+
β β βββ dir
|
|
1053
|
+
β β βββ bar.d.ts
|
|
1054
|
+
β β βββ bar.d.ts.map
|
|
1055
|
+
β β βββ bar.js
|
|
1056
|
+
β β βββ bar.js.map
|
|
1057
|
+
β βββ foo.d.ts
|
|
1058
|
+
β βββ foo.d.ts.map
|
|
1059
|
+
β βββ foo.js
|
|
1060
|
+
β βββ foo.js.map
|
|
1061
|
+
β βββ index.d.ts
|
|
1062
|
+
β βββ index.d.ts.map
|
|
1063
|
+
β βββ index.js
|
|
1064
|
+
β βββ index.js.map
|
|
1065
|
+
βββ src
|
|
1066
|
+
β βββ nested
|
|
1067
|
+
β β βββ dir
|
|
1068
|
+
β β βββ bar.ts
|
|
1069
|
+
β βββ foo.ts
|
|
1070
|
+
β βββ index.ts
|
|
1071
|
+
βββ package.json
|
|
1072
|
+
βββ tsconfig.json
|
|
1073
|
+
"
|
|
1074
|
+
`;
|
|
1075
|
+
|
|
1076
|
+
exports[`'/multiple-entrypoint': Package.build > default > result 1`] = `
|
|
1077
|
+
{
|
|
1078
|
+
"packageJson": {
|
|
1079
|
+
"exports": {
|
|
1080
|
+
".": {
|
|
1081
|
+
"default": "./dist/index.js",
|
|
1082
|
+
"src": "./src/index.ts",
|
|
1083
|
+
"types": "./dist/index.d.ts",
|
|
1084
|
+
},
|
|
1085
|
+
"./foo": {
|
|
1086
|
+
"default": "./dist/foo.js",
|
|
1087
|
+
"src": "./src/foo.ts",
|
|
1088
|
+
"types": "./dist/foo.d.ts",
|
|
1089
|
+
},
|
|
1090
|
+
"./nested/dir": {
|
|
1091
|
+
"default": "./dist/nested/dir/bar.js",
|
|
1092
|
+
"src": "./src/nested/dir/bar.ts",
|
|
1093
|
+
"types": "./dist/nested/dir/bar.d.ts",
|
|
1094
|
+
},
|
|
1095
|
+
},
|
|
1096
|
+
"main": "./dist/index.js",
|
|
1097
|
+
"module": "./dist/index.js",
|
|
1098
|
+
"name": "multiple-entrypoint",
|
|
1099
|
+
"sideEffects": false,
|
|
1100
|
+
"type": "module",
|
|
1101
|
+
"types": "./dist/index.d.ts",
|
|
1102
|
+
"version": "0.0.0",
|
|
1103
|
+
},
|
|
1104
|
+
"tsConfig": {
|
|
1105
|
+
"compilerOptions": {
|
|
1106
|
+
"composite": false,
|
|
1107
|
+
"declaration": true,
|
|
1108
|
+
"declarationDir": undefined,
|
|
1109
|
+
"declarationMap": true,
|
|
1110
|
+
"emitDeclarationOnly": false,
|
|
1111
|
+
"esModuleInterop": true,
|
|
1112
|
+
"isolatedModules": true,
|
|
1113
|
+
"module": "nodenext",
|
|
1114
|
+
"moduleDetection": "force",
|
|
1115
|
+
"moduleResolution": "nodenext",
|
|
1116
|
+
"noEmit": false,
|
|
1117
|
+
"outDir": "/repos/multiple-entrypoint/dist",
|
|
1118
|
+
"skipLibCheck": true,
|
|
1119
|
+
"sourceMap": true,
|
|
1120
|
+
"strict": true,
|
|
1121
|
+
"target": "es2021",
|
|
1122
|
+
"verbatimModuleSyntax": true,
|
|
1123
|
+
},
|
|
1124
|
+
"exclude": [],
|
|
1125
|
+
"include": [
|
|
1126
|
+
"/repos/multiple-entrypoint/src/index.ts",
|
|
1127
|
+
"/repos/multiple-entrypoint/src/foo.ts",
|
|
1128
|
+
"/repos/multiple-entrypoint/src/nested/dir/bar.ts",
|
|
1129
|
+
],
|
|
1130
|
+
},
|
|
1131
|
+
}
|
|
1132
|
+
`;
|
|
1133
|
+
|
|
1134
|
+
exports[`'/multiple-entrypoint': Package.build > default > types 1`] = `
|
|
1135
|
+
"export declare function foo(options?: foo.Options): void;
|
|
1136
|
+
export declare namespace foo {
|
|
1137
|
+
type Options = {
|
|
1138
|
+
value?: string | undefined;
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
export declare function bar(options?: bar.Options): void;
|
|
1142
|
+
export declare namespace bar {
|
|
1143
|
+
type Options = {
|
|
1144
|
+
value?: string | undefined;
|
|
1145
|
+
};
|
|
1146
|
+
function baz(options?: Options): void;
|
|
1147
|
+
}
|
|
1148
|
+
//# sourceMappingURL=index.d.ts.map"
|
|
1149
|
+
`;
|
|
1150
|
+
|
|
1151
|
+
exports[`'/multiple-entrypoint': Package.build > link > main-target 1`] = `"../src/index.ts"`;
|
|
1152
|
+
|
|
1153
|
+
exports[`'/multiple-entrypoint': Package.build > link > output 1`] = `
|
|
1154
|
+
"{
|
|
1155
|
+
"name": "multiple-entrypoint",
|
|
1156
|
+
"version": "0.0.0",
|
|
1157
|
+
"type": "module",
|
|
1158
|
+
"exports": {
|
|
1159
|
+
".": {
|
|
1160
|
+
"types": "./dist/index.d.ts",
|
|
1161
|
+
"src": "./src/index.ts",
|
|
1162
|
+
"default": "./dist/index.js"
|
|
1163
|
+
},
|
|
1164
|
+
"./foo": {
|
|
1165
|
+
"types": "./dist/foo.d.ts",
|
|
1166
|
+
"src": "./src/foo.ts",
|
|
1167
|
+
"default": "./dist/foo.js"
|
|
1168
|
+
},
|
|
1169
|
+
"./nested/dir": {
|
|
1170
|
+
"types": "./dist/nested/dir/bar.d.ts",
|
|
1171
|
+
"src": "./src/nested/dir/bar.ts",
|
|
1172
|
+
"default": "./dist/nested/dir/bar.js"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
"sideEffects": false,
|
|
1176
|
+
"main": "./dist/index.js",
|
|
1177
|
+
"module": "./dist/index.js",
|
|
1178
|
+
"types": "./dist/index.d.ts"
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
βββ dist
|
|
1184
|
+
β βββ nested
|
|
1185
|
+
β β βββ dir
|
|
1186
|
+
β β βββ bar.d.ts -> ../../../src/nested/dir/bar.ts
|
|
1187
|
+
β β βββ bar.js -> ../../../src/nested/dir/bar.ts
|
|
1188
|
+
β βββ foo.d.ts -> ../src/foo.ts
|
|
1189
|
+
β βββ foo.js -> ../src/foo.ts
|
|
1190
|
+
β βββ index.d.ts -> ../src/index.ts
|
|
1191
|
+
β βββ index.js -> ../src/index.ts
|
|
1192
|
+
βββ src
|
|
1193
|
+
β βββ nested
|
|
1194
|
+
β β βββ dir
|
|
1195
|
+
β β βββ bar.ts
|
|
1196
|
+
β βββ foo.ts
|
|
1197
|
+
β βββ index.ts
|
|
1198
|
+
βββ package.json
|
|
1199
|
+
βββ tsconfig.json
|
|
1200
|
+
"
|
|
1201
|
+
`;
|
|
1202
|
+
|
|
1203
|
+
exports[`'/multiple-entrypoint': Package.build > link > result 1`] = `
|
|
1204
|
+
{
|
|
1205
|
+
"packageJson": {
|
|
1206
|
+
"exports": {
|
|
1207
|
+
".": {
|
|
1208
|
+
"default": "./dist/index.js",
|
|
1209
|
+
"src": "./src/index.ts",
|
|
1210
|
+
"types": "./dist/index.d.ts",
|
|
1211
|
+
},
|
|
1212
|
+
"./foo": {
|
|
1213
|
+
"default": "./dist/foo.js",
|
|
1214
|
+
"src": "./src/foo.ts",
|
|
1215
|
+
"types": "./dist/foo.d.ts",
|
|
1216
|
+
},
|
|
1217
|
+
"./nested/dir": {
|
|
1218
|
+
"default": "./dist/nested/dir/bar.js",
|
|
1219
|
+
"src": "./src/nested/dir/bar.ts",
|
|
1220
|
+
"types": "./dist/nested/dir/bar.d.ts",
|
|
1221
|
+
},
|
|
1222
|
+
},
|
|
1223
|
+
"main": "./dist/index.js",
|
|
1224
|
+
"module": "./dist/index.js",
|
|
1225
|
+
"name": "multiple-entrypoint",
|
|
1226
|
+
"sideEffects": false,
|
|
1227
|
+
"type": "module",
|
|
1228
|
+
"types": "./dist/index.d.ts",
|
|
1229
|
+
"version": "0.0.0",
|
|
1230
|
+
},
|
|
1231
|
+
"tsConfig": {
|
|
1232
|
+
"compilerOptions": {
|
|
1233
|
+
"isolatedModules": true,
|
|
1234
|
+
"module": "nodenext",
|
|
1235
|
+
"moduleDetection": "force",
|
|
1236
|
+
"moduleResolution": "nodenext",
|
|
1237
|
+
"noEmit": true,
|
|
1238
|
+
"skipLibCheck": true,
|
|
1239
|
+
"strict": true,
|
|
1240
|
+
"verbatimModuleSyntax": true,
|
|
1241
|
+
},
|
|
1242
|
+
},
|
|
1243
|
+
}
|
|
1244
|
+
`;
|
|
1245
|
+
|
|
1246
|
+
exports[`'/multiple-entrypoint': Package.build > link > types-target 1`] = `"../src/index.ts"`;
|
|
1247
|
+
|
|
1248
|
+
exports[`'/single-entrypoint': Package.build > default > check 1`] = `
|
|
1249
|
+
{
|
|
1250
|
+
"output": {
|
|
1251
|
+
"attw": "
|
|
1252
|
+
single-entrypoint v0.0.0
|
|
1253
|
+
|
|
1254
|
+
(ignoring resolutions: 'node10', 'node16-cjs')
|
|
1255
|
+
|
|
1256
|
+
(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
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
"single-entrypoint"
|
|
1260
|
+
|
|
1261
|
+
node16 (from ESM): π’ (ESM)
|
|
1262
|
+
bundler: π’
|
|
1263
|
+
node10: (ignored) π’
|
|
1264
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
1265
|
+
|
|
1266
|
+
***********************************
|
|
1267
|
+
",
|
|
1268
|
+
"publint": "Running publint v0.3.14 for single-entrypoint...
|
|
1269
|
+
Packing files with \`bun pack\`...
|
|
1270
|
+
Linting...
|
|
1271
|
+
All good!
|
|
1272
|
+
",
|
|
1273
|
+
},
|
|
1274
|
+
}
|
|
1275
|
+
`;
|
|
1276
|
+
|
|
1277
|
+
exports[`'/single-entrypoint': Package.build > default > main 1`] = `
|
|
1278
|
+
"import { bar as bar1, foo as foo1 } from './foo.js';
|
|
1279
|
+
export function foo(options = {}) {
|
|
1280
|
+
foo1(options);
|
|
1281
|
+
console.log('Hello, foo!', options.value);
|
|
1282
|
+
}
|
|
1283
|
+
export function bar(options = {}) {
|
|
1284
|
+
bar1(options);
|
|
1285
|
+
console.log('Hello, bar!', options.value);
|
|
1286
|
+
}
|
|
1287
|
+
(function (bar) {
|
|
1288
|
+
function baz(options = {}) {
|
|
1289
|
+
console.log('Hello, baz!', options.value);
|
|
1290
|
+
}
|
|
1291
|
+
bar.baz = baz;
|
|
1292
|
+
})(bar || (bar = {}));
|
|
1293
|
+
//# sourceMappingURL=index.js.map"
|
|
1294
|
+
`;
|
|
1295
|
+
|
|
1296
|
+
exports[`'/single-entrypoint': Package.build > default > output 1`] = `
|
|
1297
|
+
"{
|
|
1298
|
+
"name": "single-entrypoint",
|
|
1299
|
+
"version": "0.0.0",
|
|
1300
|
+
"type": "module",
|
|
1301
|
+
"main": "./dist/index.js",
|
|
1302
|
+
"sideEffects": false,
|
|
1303
|
+
"module": "./dist/index.js",
|
|
1304
|
+
"types": "./dist/index.d.ts",
|
|
1305
|
+
"exports": {
|
|
1306
|
+
".": {
|
|
1307
|
+
"types": "./dist/index.d.ts",
|
|
1308
|
+
"src": "./index.ts",
|
|
1309
|
+
"default": "./dist/index.js"
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
βββ dist
|
|
1317
|
+
β βββ foo.d.ts
|
|
1318
|
+
β βββ foo.d.ts.map
|
|
1319
|
+
β βββ foo.js
|
|
1320
|
+
β βββ foo.js.map
|
|
1321
|
+
β βββ index.d.ts
|
|
1322
|
+
β βββ index.d.ts.map
|
|
1323
|
+
β βββ index.js
|
|
1324
|
+
β βββ index.js.map
|
|
1325
|
+
βββ foo.ts
|
|
1326
|
+
βββ index.ts
|
|
1327
|
+
βββ package.json
|
|
1328
|
+
βββ tsconfig.json
|
|
1329
|
+
"
|
|
1330
|
+
`;
|
|
1331
|
+
|
|
1332
|
+
exports[`'/single-entrypoint': Package.build > default > result 1`] = `
|
|
1333
|
+
{
|
|
1334
|
+
"packageJson": {
|
|
1335
|
+
"exports": {
|
|
1336
|
+
".": {
|
|
1337
|
+
"default": "./dist/index.js",
|
|
1338
|
+
"src": "./index.ts",
|
|
1339
|
+
"types": "./dist/index.d.ts",
|
|
1340
|
+
},
|
|
1341
|
+
},
|
|
1342
|
+
"main": "./dist/index.js",
|
|
1343
|
+
"module": "./dist/index.js",
|
|
1344
|
+
"name": "single-entrypoint",
|
|
1345
|
+
"sideEffects": false,
|
|
1346
|
+
"type": "module",
|
|
1347
|
+
"types": "./dist/index.d.ts",
|
|
1348
|
+
"version": "0.0.0",
|
|
1349
|
+
},
|
|
1350
|
+
"tsConfig": {
|
|
1351
|
+
"compilerOptions": {
|
|
1352
|
+
"composite": false,
|
|
1353
|
+
"declaration": true,
|
|
1354
|
+
"declarationDir": undefined,
|
|
1355
|
+
"declarationMap": true,
|
|
1356
|
+
"emitDeclarationOnly": false,
|
|
1357
|
+
"esModuleInterop": true,
|
|
1358
|
+
"isolatedModules": true,
|
|
1359
|
+
"module": "nodenext",
|
|
1360
|
+
"moduleDetection": "force",
|
|
1361
|
+
"moduleResolution": "nodenext",
|
|
1362
|
+
"noEmit": false,
|
|
1363
|
+
"outDir": "/repos/single-entrypoint/dist",
|
|
1364
|
+
"skipLibCheck": true,
|
|
1365
|
+
"sourceMap": true,
|
|
1366
|
+
"strict": true,
|
|
1367
|
+
"target": "es2021",
|
|
1368
|
+
"verbatimModuleSyntax": true,
|
|
1369
|
+
},
|
|
1370
|
+
"exclude": [],
|
|
1371
|
+
"include": [
|
|
1372
|
+
"/repos/single-entrypoint/index.ts",
|
|
1373
|
+
],
|
|
1374
|
+
},
|
|
1375
|
+
}
|
|
1376
|
+
`;
|
|
1377
|
+
|
|
1378
|
+
exports[`'/single-entrypoint': Package.build > default > types 1`] = `
|
|
1379
|
+
"export declare function foo(options?: foo.Options): void;
|
|
1380
|
+
export declare namespace foo {
|
|
1381
|
+
type Options = {
|
|
1382
|
+
value?: string | undefined;
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
export declare function bar(options?: bar.Options): void;
|
|
1386
|
+
export declare namespace bar {
|
|
1387
|
+
type Options = {
|
|
1388
|
+
value?: string | undefined;
|
|
1389
|
+
};
|
|
1390
|
+
function baz(options?: Options): void;
|
|
1391
|
+
}
|
|
1392
|
+
//# sourceMappingURL=index.d.ts.map"
|
|
1393
|
+
`;
|
|
1394
|
+
|
|
1395
|
+
exports[`'/single-entrypoint': Package.build > link > main-target 1`] = `"../index.ts"`;
|
|
1396
|
+
|
|
1397
|
+
exports[`'/single-entrypoint': Package.build > link > output 1`] = `
|
|
1398
|
+
"{
|
|
1399
|
+
"name": "single-entrypoint",
|
|
1400
|
+
"version": "0.0.0",
|
|
1401
|
+
"type": "module",
|
|
1402
|
+
"main": "./dist/index.js",
|
|
1403
|
+
"sideEffects": false,
|
|
1404
|
+
"module": "./dist/index.js",
|
|
1405
|
+
"types": "./dist/index.d.ts",
|
|
1406
|
+
"exports": {
|
|
1407
|
+
".": {
|
|
1408
|
+
"types": "./dist/index.d.ts",
|
|
1409
|
+
"src": "./index.ts",
|
|
1410
|
+
"default": "./dist/index.js"
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
βββ dist
|
|
1418
|
+
β βββ index.d.ts -> ../index.ts
|
|
1419
|
+
β βββ index.js -> ../index.ts
|
|
1420
|
+
βββ foo.ts
|
|
1421
|
+
βββ index.ts
|
|
1422
|
+
βββ package.json
|
|
1423
|
+
βββ tsconfig.json
|
|
1424
|
+
"
|
|
1425
|
+
`;
|
|
1426
|
+
|
|
1427
|
+
exports[`'/single-entrypoint': Package.build > link > result 1`] = `
|
|
1428
|
+
{
|
|
1429
|
+
"packageJson": {
|
|
1430
|
+
"exports": {
|
|
1431
|
+
".": {
|
|
1432
|
+
"default": "./dist/index.js",
|
|
1433
|
+
"src": "./index.ts",
|
|
1434
|
+
"types": "./dist/index.d.ts",
|
|
1435
|
+
},
|
|
1436
|
+
},
|
|
1437
|
+
"main": "./dist/index.js",
|
|
1438
|
+
"module": "./dist/index.js",
|
|
1439
|
+
"name": "single-entrypoint",
|
|
1440
|
+
"sideEffects": false,
|
|
1441
|
+
"type": "module",
|
|
1442
|
+
"types": "./dist/index.d.ts",
|
|
1443
|
+
"version": "0.0.0",
|
|
1444
|
+
},
|
|
1445
|
+
"tsConfig": {
|
|
1446
|
+
"compilerOptions": {
|
|
1447
|
+
"isolatedModules": true,
|
|
1448
|
+
"module": "nodenext",
|
|
1449
|
+
"moduleDetection": "force",
|
|
1450
|
+
"moduleResolution": "nodenext",
|
|
1451
|
+
"noEmit": true,
|
|
1452
|
+
"skipLibCheck": true,
|
|
1453
|
+
"strict": true,
|
|
1454
|
+
"verbatimModuleSyntax": true,
|
|
1455
|
+
},
|
|
1456
|
+
},
|
|
1457
|
+
}
|
|
1458
|
+
`;
|
|
1459
|
+
|
|
1460
|
+
exports[`'/single-entrypoint': Package.build > link > types-target 1`] = `"../index.ts"`;
|
|
1461
|
+
|
|
1462
|
+
exports[`'/wildcard-exports': Package.build > default > check 1`] = `
|
|
1463
|
+
{
|
|
1464
|
+
"output": {
|
|
1465
|
+
"attw": "
|
|
1466
|
+
wildcard-exports v0.0.0
|
|
1467
|
+
|
|
1468
|
+
(ignoring resolutions: 'node10', 'node16-cjs')
|
|
1469
|
+
|
|
1470
|
+
(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
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
"wildcard-exports"
|
|
1474
|
+
|
|
1475
|
+
node16 (from ESM): π’ (ESM)
|
|
1476
|
+
bundler: π’
|
|
1477
|
+
node10: (ignored) π’
|
|
1478
|
+
node16 (from CJS): (ignored) β οΈ ESM (dynamic import only)
|
|
1479
|
+
|
|
1480
|
+
***********************************
|
|
1481
|
+
|
|
1482
|
+
"wildcard-exports/utils/*"
|
|
1483
|
+
|
|
1484
|
+
node16 (from ESM): (wildcard)
|
|
1485
|
+
bundler: (wildcard)
|
|
1486
|
+
node10: (ignored) (wildcard)
|
|
1487
|
+
node16 (from CJS): (ignored) (wildcard)
|
|
1488
|
+
|
|
1489
|
+
***********************************
|
|
1490
|
+
",
|
|
1491
|
+
"publint": "Running publint v0.3.14 for wildcard-exports...
|
|
1492
|
+
Packing files with \`bun pack\`...
|
|
1493
|
+
Linting...
|
|
1494
|
+
All good!
|
|
1495
|
+
",
|
|
1496
|
+
},
|
|
1497
|
+
}
|
|
1498
|
+
`;
|
|
1499
|
+
|
|
1500
|
+
exports[`'/wildcard-exports': Package.build > default > main 1`] = `
|
|
1501
|
+
"export const name = 'wildcard-exports';
|
|
1502
|
+
//# sourceMappingURL=index.js.map"
|
|
1503
|
+
`;
|
|
1504
|
+
|
|
1505
|
+
exports[`'/wildcard-exports': Package.build > default > output 1`] = `
|
|
1506
|
+
"{
|
|
1507
|
+
"name": "wildcard-exports",
|
|
1508
|
+
"version": "0.0.0",
|
|
1509
|
+
"type": "module",
|
|
1510
|
+
"exports": {
|
|
1511
|
+
".": {
|
|
1512
|
+
"types": "./dist/index.d.ts",
|
|
1513
|
+
"src": "./index.ts",
|
|
1514
|
+
"default": "./dist/index.js"
|
|
1515
|
+
},
|
|
1516
|
+
"./utils/*": {
|
|
1517
|
+
"types": "./dist/utils/*.d.ts",
|
|
1518
|
+
"src": "./utils/*",
|
|
1519
|
+
"default": "./dist/utils/*.js"
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
"sideEffects": false,
|
|
1523
|
+
"main": "./dist/index.js",
|
|
1524
|
+
"module": "./dist/index.js",
|
|
1525
|
+
"types": "./dist/index.d.ts"
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
βββ dist
|
|
1531
|
+
β βββ utils
|
|
1532
|
+
β β βββ format.d.ts
|
|
1533
|
+
β β βββ format.d.ts.map
|
|
1534
|
+
β β βββ format.js
|
|
1535
|
+
β β βββ format.js.map
|
|
1536
|
+
β β βββ helper.d.ts
|
|
1537
|
+
β β βββ helper.d.ts.map
|
|
1538
|
+
β β βββ helper.js
|
|
1539
|
+
β β βββ helper.js.map
|
|
1540
|
+
β βββ index.d.ts
|
|
1541
|
+
β βββ index.d.ts.map
|
|
1542
|
+
β βββ index.js
|
|
1543
|
+
β βββ index.js.map
|
|
1544
|
+
βββ utils
|
|
1545
|
+
β βββ format.ts
|
|
1546
|
+
β βββ helper.ts
|
|
1547
|
+
βββ index.ts
|
|
1548
|
+
βββ package.json
|
|
1549
|
+
βββ tsconfig.json
|
|
1550
|
+
"
|
|
1551
|
+
`;
|
|
1552
|
+
|
|
1553
|
+
exports[`'/wildcard-exports': Package.build > default > result 1`] = `
|
|
1554
|
+
{
|
|
1555
|
+
"packageJson": {
|
|
1556
|
+
"exports": {
|
|
1557
|
+
".": {
|
|
1558
|
+
"default": "./dist/index.js",
|
|
1559
|
+
"src": "./index.ts",
|
|
1560
|
+
"types": "./dist/index.d.ts",
|
|
1561
|
+
},
|
|
1562
|
+
"./utils/*": {
|
|
1563
|
+
"default": "./dist/utils/*.js",
|
|
1564
|
+
"src": "./utils/*",
|
|
1565
|
+
"types": "./dist/utils/*.d.ts",
|
|
1566
|
+
},
|
|
1567
|
+
},
|
|
1568
|
+
"main": "./dist/index.js",
|
|
1569
|
+
"module": "./dist/index.js",
|
|
1570
|
+
"name": "wildcard-exports",
|
|
1571
|
+
"sideEffects": false,
|
|
1572
|
+
"type": "module",
|
|
1573
|
+
"types": "./dist/index.d.ts",
|
|
1574
|
+
"version": "0.0.0",
|
|
1575
|
+
},
|
|
1576
|
+
"tsConfig": {
|
|
1577
|
+
"compilerOptions": {
|
|
1578
|
+
"composite": false,
|
|
1579
|
+
"declaration": true,
|
|
1580
|
+
"declarationDir": undefined,
|
|
1581
|
+
"declarationMap": true,
|
|
1582
|
+
"emitDeclarationOnly": false,
|
|
1583
|
+
"esModuleInterop": true,
|
|
1584
|
+
"isolatedModules": true,
|
|
1585
|
+
"module": "nodenext",
|
|
1586
|
+
"moduleDetection": "force",
|
|
1587
|
+
"moduleResolution": "nodenext",
|
|
1588
|
+
"noEmit": false,
|
|
1589
|
+
"outDir": "/repos/wildcard-exports/dist",
|
|
1590
|
+
"skipLibCheck": true,
|
|
1591
|
+
"sourceMap": true,
|
|
1592
|
+
"strict": true,
|
|
1593
|
+
"target": "es2021",
|
|
1594
|
+
"verbatimModuleSyntax": true,
|
|
1595
|
+
},
|
|
1596
|
+
"exclude": [],
|
|
1597
|
+
"include": [
|
|
1598
|
+
"/repos/wildcard-exports/index.ts",
|
|
1599
|
+
"/repos/wildcard-exports/utils/format.ts",
|
|
1600
|
+
"/repos/wildcard-exports/utils/helper.ts",
|
|
1601
|
+
],
|
|
1602
|
+
},
|
|
1603
|
+
}
|
|
1604
|
+
`;
|
|
1605
|
+
|
|
1606
|
+
exports[`'/wildcard-exports': Package.build > default > types 1`] = `
|
|
1607
|
+
"export declare const name = "wildcard-exports";
|
|
1608
|
+
//# sourceMappingURL=index.d.ts.map"
|
|
1609
|
+
`;
|
|
1610
|
+
|
|
1611
|
+
exports[`'/wildcard-exports': Package.build > link > main-target 1`] = `"../index.ts"`;
|
|
1612
|
+
|
|
1613
|
+
exports[`'/wildcard-exports': Package.build > link > output 1`] = `
|
|
1614
|
+
"{
|
|
1615
|
+
"name": "wildcard-exports",
|
|
1616
|
+
"version": "0.0.0",
|
|
1617
|
+
"type": "module",
|
|
1618
|
+
"exports": {
|
|
1619
|
+
".": {
|
|
1620
|
+
"types": "./dist/index.d.ts",
|
|
1621
|
+
"src": "./index.ts",
|
|
1622
|
+
"default": "./dist/index.js"
|
|
1623
|
+
},
|
|
1624
|
+
"./utils/*": {
|
|
1625
|
+
"types": "./dist/utils/*.d.ts",
|
|
1626
|
+
"src": "./utils/*",
|
|
1627
|
+
"default": "./dist/utils/*.js"
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
"sideEffects": false,
|
|
1631
|
+
"main": "./dist/index.js",
|
|
1632
|
+
"module": "./dist/index.js",
|
|
1633
|
+
"types": "./dist/index.d.ts"
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
βββ dist
|
|
1639
|
+
β βββ index.d.ts -> ../index.ts
|
|
1640
|
+
β βββ index.js -> ../index.ts
|
|
1641
|
+
βββ utils
|
|
1642
|
+
β βββ format.ts
|
|
1643
|
+
β βββ helper.ts
|
|
1644
|
+
βββ index.ts
|
|
1645
|
+
βββ package.json
|
|
1646
|
+
βββ tsconfig.json
|
|
1647
|
+
"
|
|
1648
|
+
`;
|
|
1649
|
+
|
|
1650
|
+
exports[`'/wildcard-exports': Package.build > link > result 1`] = `
|
|
1651
|
+
{
|
|
1652
|
+
"packageJson": {
|
|
1653
|
+
"exports": {
|
|
1654
|
+
".": {
|
|
1655
|
+
"default": "./dist/index.js",
|
|
1656
|
+
"src": "./index.ts",
|
|
1657
|
+
"types": "./dist/index.d.ts",
|
|
1658
|
+
},
|
|
1659
|
+
"./utils/*": {
|
|
1660
|
+
"default": "./dist/utils/*.js",
|
|
1661
|
+
"src": "./utils/*",
|
|
1662
|
+
"types": "./dist/utils/*.d.ts",
|
|
1663
|
+
},
|
|
1664
|
+
},
|
|
1665
|
+
"main": "./dist/index.js",
|
|
1666
|
+
"module": "./dist/index.js",
|
|
1667
|
+
"name": "wildcard-exports",
|
|
1668
|
+
"sideEffects": false,
|
|
1669
|
+
"type": "module",
|
|
1670
|
+
"types": "./dist/index.d.ts",
|
|
1671
|
+
"version": "0.0.0",
|
|
1672
|
+
},
|
|
1673
|
+
"tsConfig": {
|
|
1674
|
+
"compilerOptions": {
|
|
1675
|
+
"isolatedModules": true,
|
|
1676
|
+
"module": "nodenext",
|
|
1677
|
+
"moduleDetection": "force",
|
|
1678
|
+
"moduleResolution": "nodenext",
|
|
1679
|
+
"noEmit": true,
|
|
1680
|
+
"skipLibCheck": true,
|
|
1681
|
+
"strict": true,
|
|
1682
|
+
"verbatimModuleSyntax": true,
|
|
1683
|
+
},
|
|
1684
|
+
},
|
|
1685
|
+
}
|
|
1686
|
+
`;
|
|
1687
|
+
|
|
1688
|
+
exports[`'/wildcard-exports': Package.build > link > types-target 1`] = `"../index.ts"`;
|