@@ -90,46 +90,32 @@ Deno.test("should build test project - basic", async () => {
9090 `/src/
9191/esm/mod.test.js
9292/esm/mod.test.d.ts
93- /esm/mod.test.d.ts.map
9493/script/mod.test.js
9594/script/mod.test.d.ts
96- /script/mod.test.d.ts.map
9795/esm/deps/deno.land/std@0.181.0/fmt/colors.js
9896/esm/deps/deno.land/std@0.181.0/fmt/colors.d.ts
99- /esm/deps/deno.land/std@0.181.0/fmt/colors.d.ts.map
10097/script/deps/deno.land/std@0.181.0/fmt/colors.js
10198/script/deps/deno.land/std@0.181.0/fmt/colors.d.ts
102- /script/deps/deno.land/std@0.181.0/fmt/colors.d.ts.map
10399/esm/deps/deno.land/std@0.181.0/testing/_diff.js
104100/esm/deps/deno.land/std@0.181.0/testing/_diff.d.ts
105- /esm/deps/deno.land/std@0.181.0/testing/_diff.d.ts.map
106101/script/deps/deno.land/std@0.181.0/testing/_diff.js
107102/script/deps/deno.land/std@0.181.0/testing/_diff.d.ts
108- /script/deps/deno.land/std@0.181.0/testing/_diff.d.ts.map
109103/esm/deps/deno.land/std@0.181.0/testing/_format.js
110104/esm/deps/deno.land/std@0.181.0/testing/_format.d.ts
111- /esm/deps/deno.land/std@0.181.0/testing/_format.d.ts.map
112105/script/deps/deno.land/std@0.181.0/testing/_format.js
113106/script/deps/deno.land/std@0.181.0/testing/_format.d.ts
114- /script/deps/deno.land/std@0.181.0/testing/_format.d.ts.map
115107/esm/deps/deno.land/std@0.181.0/testing/asserts.js
116108/esm/deps/deno.land/std@0.181.0/testing/asserts.d.ts
117- /esm/deps/deno.land/std@0.181.0/testing/asserts.d.ts.map
118109/script/deps/deno.land/std@0.181.0/testing/asserts.js
119110/script/deps/deno.land/std@0.181.0/testing/asserts.d.ts
120- /script/deps/deno.land/std@0.181.0/testing/asserts.d.ts.map
121111/esm/_dnt.test_polyfills.js
122112/esm/_dnt.test_polyfills.d.ts
123- /esm/_dnt.test_polyfills.d.ts.map
124113/script/_dnt.test_polyfills.js
125114/script/_dnt.test_polyfills.d.ts
126- /script/_dnt.test_polyfills.d.ts.map
127115/esm/_dnt.test_shims.js
128116/esm/_dnt.test_shims.d.ts
129- /esm/_dnt.test_shims.d.ts.map
130117/script/_dnt.test_shims.js
131118/script/_dnt.test_shims.d.ts
132- /script/_dnt.test_shims.d.ts.map
133119/test_runner.cjs
134120yarn.lock
135121pnpm-lock.yaml
@@ -183,25 +169,18 @@ Deno.test("should build test project without esm", async () => {
183169 `/src/
184170/script/mod.test.js
185171/types/mod.test.d.ts
186- /types/mod.test.d.ts.map
187172/script/deps/deno.land/std@0.181.0/fmt/colors.js
188173/types/deps/deno.land/std@0.181.0/fmt/colors.d.ts
189- /types/deps/deno.land/std@0.181.0/fmt/colors.d.ts.map
190174/script/deps/deno.land/std@0.181.0/testing/_diff.js
191175/types/deps/deno.land/std@0.181.0/testing/_diff.d.ts
192- /types/deps/deno.land/std@0.181.0/testing/_diff.d.ts.map
193176/script/deps/deno.land/std@0.181.0/testing/_format.js
194177/types/deps/deno.land/std@0.181.0/testing/_format.d.ts
195- /types/deps/deno.land/std@0.181.0/testing/_format.d.ts.map
196178/script/deps/deno.land/std@0.181.0/testing/asserts.js
197179/types/deps/deno.land/std@0.181.0/testing/asserts.d.ts
198- /types/deps/deno.land/std@0.181.0/testing/asserts.d.ts.map
199180/script/_dnt.test_polyfills.js
200181/types/_dnt.test_polyfills.d.ts
201- /types/_dnt.test_polyfills.d.ts.map
202182/script/_dnt.test_shims.js
203183/types/_dnt.test_shims.d.ts
204- /types/_dnt.test_shims.d.ts.map
205184/test_runner.cjs
206185yarn.lock
207186pnpm-lock.yaml
@@ -334,7 +313,7 @@ Deno.test("should build test project with declarations inline by default", async
334313 }
335314} ) ;
336315
337- Deno . test ( "should build test project with declaration maps by default" , async ( ) => {
316+ Deno . test ( "should build test project without declaration maps by default" , async ( ) => {
338317 await runTest ( "test_project" , {
339318 entryPoints : [ "mod.ts" ] ,
340319 outDir : "./npm" ,
@@ -346,16 +325,41 @@ Deno.test("should build test project with declaration maps by default", async ()
346325 name : "add" ,
347326 version : "1.0.0" ,
348327 } ,
328+ } , ( output ) => {
329+ output . assertNotExists ( "script/mod.d.ts.map" ) ;
330+ output . assertNotExists ( "esm/mod.d.ts.map" ) ;
331+ // nothing points at the sources, so they're not published
332+ assertStringIncludes ( output . npmIgnore , "/src/\n" ) ;
333+ } ) ;
334+ } ) ;
335+
336+ Deno . test ( "should build test project with declaration maps when enabled" , async ( ) => {
337+ await runTest ( "test_project" , {
338+ entryPoints : [ "mod.ts" ] ,
339+ outDir : "./npm" ,
340+ declaration : "inline" ,
341+ declarationMap : true ,
342+ shims : {
343+ deno : "dev" ,
344+ } ,
345+ package : {
346+ name : "add" ,
347+ version : "1.0.0" ,
348+ } ,
349349 } , ( output ) => {
350350 output . assertNotExists ( "types/mod.d.ts" ) ;
351351 output . assertExists ( "script/mod.d.ts.map" ) ;
352352 output . assertExists ( "esm/mod.d.ts.map" ) ;
353+ // the declaration maps point at the sources, so they must be published
354+ output . assertExists ( "src/mod.ts" ) ;
355+ assertEquals ( output . npmIgnore . includes ( "/src/\n" ) , false ) ;
353356 } ) ;
354357
355358 await runTest ( "test_project" , {
356359 entryPoints : [ "mod.ts" ] ,
357360 outDir : "./npm" ,
358361 declaration : "separate" ,
362+ declarationMap : true ,
359363 shims : {
360364 deno : "dev" ,
361365 } ,
@@ -367,6 +371,29 @@ Deno.test("should build test project with declaration maps by default", async ()
367371 output . assertExists ( "types/mod.d.ts.map" ) ;
368372 output . assertNotExists ( "script/mod.d.ts.map" ) ;
369373 output . assertNotExists ( "esm/mod.d.ts.map" ) ;
374+ output . assertExists ( "src/mod.ts" ) ;
375+ assertEquals ( output . npmIgnore . includes ( "/src/\n" ) , false ) ;
376+ } ) ;
377+ } ) ;
378+
379+ Deno . test ( "should not create declaration maps when the sources are skipped" , async ( ) => {
380+ await runTest ( "test_project" , {
381+ entryPoints : [ "mod.ts" ] ,
382+ outDir : "./npm" ,
383+ declaration : "inline" ,
384+ declarationMap : true ,
385+ skipSourceOutput : true ,
386+ shims : {
387+ deno : "dev" ,
388+ } ,
389+ package : {
390+ name : "add" ,
391+ version : "1.0.0" ,
392+ } ,
393+ } , ( output ) => {
394+ output . assertNotExists ( "src/mod.ts" ) ;
395+ output . assertNotExists ( "script/mod.d.ts.map" ) ;
396+ output . assertNotExists ( "esm/mod.d.ts.map" ) ;
370397 } ) ;
371398} ) ;
372399
@@ -569,62 +596,55 @@ Deno.test("should build with source maps", async () => {
569596 output . assertExists ( "esm/mod.js.map" ) ;
570597 assertEquals (
571598 output . npmIgnore ,
572- `/esm/mod.test.js
599+ `/src/mod.test.ts
600+ /esm/mod.test.js
573601/esm/mod.test.js.map
574602/esm/mod.test.d.ts
575- /esm/mod.test.d.ts.map
576603/script/mod.test.js
577604/script/mod.test.js.map
578605/script/mod.test.d.ts
579- /script/mod.test.d.ts.map
606+ /src/deps/deno.land/std@0.181.0/fmt/colors.ts
580607/esm/deps/deno.land/std@0.181.0/fmt/colors.js
581608/esm/deps/deno.land/std@0.181.0/fmt/colors.js.map
582609/esm/deps/deno.land/std@0.181.0/fmt/colors.d.ts
583- /esm/deps/deno.land/std@0.181.0/fmt/colors.d.ts.map
584610/script/deps/deno.land/std@0.181.0/fmt/colors.js
585611/script/deps/deno.land/std@0.181.0/fmt/colors.js.map
586612/script/deps/deno.land/std@0.181.0/fmt/colors.d.ts
587- /script /deps/deno.land/std@0.181.0/fmt/colors.d.ts.map
613+ /src /deps/deno.land/std@0.181.0/testing/_diff.ts
588614/esm/deps/deno.land/std@0.181.0/testing/_diff.js
589615/esm/deps/deno.land/std@0.181.0/testing/_diff.js.map
590616/esm/deps/deno.land/std@0.181.0/testing/_diff.d.ts
591- /esm/deps/deno.land/std@0.181.0/testing/_diff.d.ts.map
592617/script/deps/deno.land/std@0.181.0/testing/_diff.js
593618/script/deps/deno.land/std@0.181.0/testing/_diff.js.map
594619/script/deps/deno.land/std@0.181.0/testing/_diff.d.ts
595- /script /deps/deno.land/std@0.181.0/testing/_diff.d.ts.map
620+ /src /deps/deno.land/std@0.181.0/testing/_format.ts
596621/esm/deps/deno.land/std@0.181.0/testing/_format.js
597622/esm/deps/deno.land/std@0.181.0/testing/_format.js.map
598623/esm/deps/deno.land/std@0.181.0/testing/_format.d.ts
599- /esm/deps/deno.land/std@0.181.0/testing/_format.d.ts.map
600624/script/deps/deno.land/std@0.181.0/testing/_format.js
601625/script/deps/deno.land/std@0.181.0/testing/_format.js.map
602626/script/deps/deno.land/std@0.181.0/testing/_format.d.ts
603- /script /deps/deno.land/std@0.181.0/testing/_format.d.ts.map
627+ /src /deps/deno.land/std@0.181.0/testing/asserts.ts
604628/esm/deps/deno.land/std@0.181.0/testing/asserts.js
605629/esm/deps/deno.land/std@0.181.0/testing/asserts.js.map
606630/esm/deps/deno.land/std@0.181.0/testing/asserts.d.ts
607- /esm/deps/deno.land/std@0.181.0/testing/asserts.d.ts.map
608631/script/deps/deno.land/std@0.181.0/testing/asserts.js
609632/script/deps/deno.land/std@0.181.0/testing/asserts.js.map
610633/script/deps/deno.land/std@0.181.0/testing/asserts.d.ts
611- /script/deps/deno.land/std@0.181.0/testing/asserts.d.ts.map
634+ /src/_dnt.test_polyfills.ts
612635/esm/_dnt.test_polyfills.js
613636/esm/_dnt.test_polyfills.js.map
614637/esm/_dnt.test_polyfills.d.ts
615- /esm/_dnt.test_polyfills.d.ts.map
616638/script/_dnt.test_polyfills.js
617639/script/_dnt.test_polyfills.js.map
618640/script/_dnt.test_polyfills.d.ts
619- /script /_dnt.test_polyfills.d.ts.map
641+ /src /_dnt.test_shims.ts
620642/esm/_dnt.test_shims.js
621643/esm/_dnt.test_shims.js.map
622644/esm/_dnt.test_shims.d.ts
623- /esm/_dnt.test_shims.d.ts.map
624645/script/_dnt.test_shims.js
625646/script/_dnt.test_shims.js.map
626647/script/_dnt.test_shims.d.ts
627- /script/_dnt.test_shims.d.ts.map
628648/test_runner.cjs
629649yarn.lock
630650pnpm-lock.yaml
@@ -691,11 +711,9 @@ Deno.test("should build with package mappings", async () => {
691711/esm/mod.test.js
692712/script/mod.test.js
693713/types/mod.test.d.ts
694- /types/mod.test.d.ts.map
695714/esm/_dnt.test_shims.js
696715/script/_dnt.test_shims.js
697716/types/_dnt.test_shims.d.ts
698- /types/_dnt.test_shims.d.ts.map
699717/test_runner.cjs
700718yarn.lock
701719pnpm-lock.yaml
@@ -1380,16 +1398,12 @@ Deno.test("should build jsr project", async () => {
13801398 `/src/
13811399/esm/mod.test.js
13821400/esm/mod.test.d.ts
1383- /esm/mod.test.d.ts.map
13841401/script/mod.test.js
13851402/script/mod.test.d.ts
1386- /script/mod.test.d.ts.map
13871403/esm/_dnt.test_shims.js
13881404/esm/_dnt.test_shims.d.ts
1389- /esm/_dnt.test_shims.d.ts.map
13901405/script/_dnt.test_shims.js
13911406/script/_dnt.test_shims.d.ts
1392- /script/_dnt.test_shims.d.ts.map
13931407/test_runner.cjs
13941408yarn.lock
13951409pnpm-lock.yaml
0 commit comments