@@ -1819,7 +1819,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
1819
1819
// Sibling package.json
1820
1820
await applyFilesToTempFsAndContext ( tempFs , context , {
1821
1821
'libs/my-lib/tsconfig.json' : `{}` ,
1822
- 'libs/my-lib/tsconfig.lib.json' : `{}` ,
1822
+ 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"outDir": "dist"} }` ,
1823
1823
'libs/my-lib/tsconfig.build.json' : `{}` ,
1824
1824
'libs/my-lib/package.json' : `{}` ,
1825
1825
} ) ;
@@ -1867,7 +1867,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
1867
1867
// Sibling package.json
1868
1868
await applyFilesToTempFsAndContext ( tempFs , context , {
1869
1869
'libs/my-lib/tsconfig.json' : `{}` ,
1870
- 'libs/my-lib/tsconfig.lib.json' : `{}` ,
1870
+ 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"outDir": "dist"} }` ,
1871
1871
'libs/my-lib/tsconfig.build.json' : `{}` ,
1872
1872
'libs/my-lib/package.json' : `{}` ,
1873
1873
} ) ;
@@ -1917,7 +1917,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
1917
1917
// Sibling package.json
1918
1918
await applyFilesToTempFsAndContext ( tempFs , context , {
1919
1919
'libs/my-lib/tsconfig.json' : `{}` ,
1920
- 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"rootDir ": "src "}}` ,
1920
+ 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"outDir ": "dist "}}` ,
1921
1921
'libs/my-lib/tsconfig.build.json' : `{}` ,
1922
1922
'libs/my-lib/package.json' : `{"main": "dist/index.js"}` ,
1923
1923
} ) ;
@@ -1965,7 +1965,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
1965
1965
"options": {
1966
1966
"cwd": "libs/my-lib",
1967
1967
},
1968
- "outputs": [],
1968
+ "outputs": [
1969
+ "{projectRoot}/dist",
1970
+ ],
1969
1971
"syncGenerators": [
1970
1972
"@nx/js:typescript-sync",
1971
1973
],
@@ -1978,8 +1980,8 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
1978
1980
1979
1981
// Sibling project.json
1980
1982
await applyFilesToTempFsAndContext ( tempFs , context , {
1981
- 'libs/my-lib/tsconfig.json' : `{"compilerOptions": {"rootDir": "src"} }` ,
1982
- 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"rootDir ": "src "}}` ,
1983
+ 'libs/my-lib/tsconfig.json' : `{}` ,
1984
+ 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"outDir ": "dist "}}` ,
1983
1985
'libs/my-lib/tsconfig.build.json' : `{}` ,
1984
1986
'libs/my-lib/project.json' : `{}` ,
1985
1987
} ) ;
@@ -2027,7 +2029,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2027
2029
"options": {
2028
2030
"cwd": "libs/my-lib",
2029
2031
},
2030
- "outputs": [],
2032
+ "outputs": [
2033
+ "{projectRoot}/dist",
2034
+ ],
2031
2035
"syncGenerators": [
2032
2036
"@nx/js:typescript-sync",
2033
2037
],
@@ -2043,7 +2047,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2043
2047
// Sibling package.json
2044
2048
await applyFilesToTempFsAndContext ( tempFs , context , {
2045
2049
'libs/my-lib/tsconfig.json' : `{}` ,
2046
- 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"rootDir ": "src "}}` ,
2050
+ 'libs/my-lib/tsconfig.lib.json' : `{"compilerOptions": {"outDir ": "dist "}}` ,
2047
2051
'libs/my-lib/tsconfig.build.json' : `{}` ,
2048
2052
'libs/my-lib/package.json' : `{ "main": "dist/index.js" }` ,
2049
2053
} ) ;
@@ -2093,7 +2097,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2093
2097
"options": {
2094
2098
"cwd": "libs/my-lib",
2095
2099
},
2096
- "outputs": [],
2100
+ "outputs": [
2101
+ "{projectRoot}/dist",
2102
+ ],
2097
2103
"syncGenerators": [
2098
2104
"@nx/js:typescript-sync",
2099
2105
],
@@ -2110,7 +2116,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2110
2116
await applyFilesToTempFsAndContext ( tempFs , context , {
2111
2117
'libs/my-lib/tsconfig.json' : `{}` ,
2112
2118
'libs/my-lib/tsconfig.lib.json' : `{}` ,
2113
- 'libs/my-lib/tsconfig.build.json' : `{"compilerOptions": {"rootDir ": "src "}}` ,
2119
+ 'libs/my-lib/tsconfig.build.json' : `{"compilerOptions": {"outDir ": "dist "}}` ,
2114
2120
'libs/my-lib/project.json' : `{}` ,
2115
2121
} ) ;
2116
2122
expect (
@@ -2159,7 +2165,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2159
2165
"options": {
2160
2166
"cwd": "libs/my-lib",
2161
2167
},
2162
- "outputs": [],
2168
+ "outputs": [
2169
+ "{projectRoot}/dist",
2170
+ ],
2163
2171
"syncGenerators": [
2164
2172
"@nx/js:typescript-sync",
2165
2173
],
@@ -2193,7 +2201,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2193
2201
await applyFilesToTempFsAndContext ( tempFs , context , {
2194
2202
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2195
2203
compilerOptions : {
2196
- rootDir : 'src ' ,
2204
+ outDir : 'dist ' ,
2197
2205
} ,
2198
2206
include : [ 'src/**/*.ts' ] ,
2199
2207
exclude : [ 'src/**/*.spec.ts' ] ,
@@ -2247,7 +2255,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2247
2255
"options": {
2248
2256
"cwd": "libs/my-lib",
2249
2257
},
2250
- "outputs": [],
2258
+ "outputs": [
2259
+ "{projectRoot}/dist",
2260
+ ],
2251
2261
"syncGenerators": [
2252
2262
"@nx/js:typescript-sync",
2253
2263
],
@@ -2272,7 +2282,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2272
2282
extends : '../../tsconfig.foo.json' ,
2273
2283
include : [ 'src/**/*.ts' ] ,
2274
2284
compilerOptions : {
2275
- rootDir : 'src ' ,
2285
+ outDir : 'dist ' ,
2276
2286
} ,
2277
2287
} ) ,
2278
2288
'libs/my-lib/package.json' : `{"main": "dist/index.js"}` ,
@@ -2326,7 +2336,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2326
2336
"options": {
2327
2337
"cwd": "libs/my-lib",
2328
2338
},
2329
- "outputs": [],
2339
+ "outputs": [
2340
+ "{projectRoot}/dist",
2341
+ ],
2330
2342
"syncGenerators": [
2331
2343
"@nx/js:typescript-sync",
2332
2344
],
@@ -2351,7 +2363,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2351
2363
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2352
2364
extends : '../../tsconfig.foo.json' ,
2353
2365
compilerOptions : {
2354
- rootDir : 'src ' ,
2366
+ outDir : 'dist ' ,
2355
2367
} ,
2356
2368
include : [ 'src/**/*.ts' ] ,
2357
2369
} ) ,
@@ -2412,7 +2424,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2412
2424
"options": {
2413
2425
"cwd": "libs/my-lib",
2414
2426
},
2415
- "outputs": [],
2427
+ "outputs": [
2428
+ "{projectRoot}/dist",
2429
+ ],
2416
2430
"syncGenerators": [
2417
2431
"@nx/js:typescript-sync",
2418
2432
],
@@ -2428,7 +2442,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2428
2442
await applyFilesToTempFsAndContext ( tempFs , context , {
2429
2443
'libs/my-lib/tsconfig.json' : '{}' ,
2430
2444
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2431
- compilerOptions : { rootDir : 'src ' } ,
2445
+ compilerOptions : { outDir : 'dist ' } ,
2432
2446
include : [ 'src/**/*.ts' ] ,
2433
2447
exclude : [ 'src/**/foo.ts' ] , // should be ignored because a referenced internal project includes this same pattern
2434
2448
references : [
@@ -2494,7 +2508,9 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2494
2508
"options": {
2495
2509
"cwd": "libs/my-lib",
2496
2510
},
2497
- "outputs": [],
2511
+ "outputs": [
2512
+ "{projectRoot}/dist",
2513
+ ],
2498
2514
"syncGenerators": [
2499
2515
"@nx/js:typescript-sync",
2500
2516
],
@@ -2511,7 +2527,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2511
2527
await applyFilesToTempFsAndContext ( tempFs , context , {
2512
2528
'libs/my-lib/tsconfig.json' : '{}' ,
2513
2529
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2514
- compilerOptions : { rootDir : 'src ' } , // rootDir is required to determine if the project is buildable
2530
+ compilerOptions : { outDir : 'dist ' } , // outDir is required to determine if the project is buildable
2515
2531
include : [ 'src/**/*.ts' ] ,
2516
2532
exclude : [ 'src/**/foo.ts' ] , // should be ignored
2517
2533
references : [ { path : './tsconfig.other.json' } ] ,
@@ -2548,7 +2564,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2548
2564
await applyFilesToTempFsAndContext ( tempFs , context , {
2549
2565
'libs/my-lib/tsconfig.json' : '{}' ,
2550
2566
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2551
- compilerOptions : { rootDir : 'src ' } ,
2567
+ compilerOptions : { outDir : 'dist ' } ,
2552
2568
include : [ '**/*.ts' ] ,
2553
2569
exclude : [ '**/foo.ts' ] , // should be ignored
2554
2570
references : [ { path : './tsconfig.other.json' } ] ,
@@ -2584,7 +2600,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2584
2600
await applyFilesToTempFsAndContext ( tempFs , context , {
2585
2601
'libs/my-lib/tsconfig.json' : '{}' ,
2586
2602
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2587
- compilerOptions : { rootDir : 'src ' } , // rooDir is required to determine if the project is buildable
2603
+ compilerOptions : { outDir : 'dist ' } , // outDir is required to determine if the project is buildable
2588
2604
include : [ 'src/**/*.ts' ] ,
2589
2605
exclude : [ 'src/**/foo.ts' ] , // should be ignored
2590
2606
references : [ { path : './tsconfig.other.json' } ] ,
@@ -2620,7 +2636,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2620
2636
await applyFilesToTempFsAndContext ( tempFs , context , {
2621
2637
'libs/my-lib/tsconfig.json' : '{}' ,
2622
2638
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2623
- compilerOptions : { rootDir : 'src ' } ,
2639
+ compilerOptions : { outDir : 'dist ' } ,
2624
2640
include : [ 'src/**/*.ts' ] ,
2625
2641
exclude : [ 'src/**/foo.ts' ] , // should be ignored
2626
2642
references : [ { path : './tsconfig.other.json' } ] ,
@@ -2656,7 +2672,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2656
2672
await applyFilesToTempFsAndContext ( tempFs , context , {
2657
2673
'libs/my-lib/tsconfig.json' : '{}' ,
2658
2674
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2659
- compilerOptions : { rootDir : 'src ' } ,
2675
+ compilerOptions : { outDir : 'dist ' } ,
2660
2676
include : [ 'src/**/*.ts' ] ,
2661
2677
exclude : [
2662
2678
'src/**/foo.ts' , // should be ignored
@@ -2696,7 +2712,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2696
2712
it ( 'should fall back to named inputs when not using include' , async ( ) => {
2697
2713
await applyFilesToTempFsAndContext ( tempFs , context , {
2698
2714
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2699
- compilerOptions : { rootDir : 'src ' } ,
2715
+ compilerOptions : { outDir : 'dist ' } ,
2700
2716
files : [ 'main.ts' ] ,
2701
2717
} ) ,
2702
2718
'libs/my-lib/tsconfig.json' : `{}` ,
@@ -2746,19 +2762,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2746
2762
"cwd": "libs/my-lib",
2747
2763
},
2748
2764
"outputs": [
2749
- "{projectRoot}/**/*.js",
2750
- "{projectRoot}/**/*.cjs",
2751
- "{projectRoot}/**/*.mjs",
2752
- "{projectRoot}/**/*.jsx",
2753
- "{projectRoot}/**/*.js.map",
2754
- "{projectRoot}/**/*.jsx.map",
2755
- "{projectRoot}/**/*.d.ts",
2756
- "{projectRoot}/**/*.d.cts",
2757
- "{projectRoot}/**/*.d.mts",
2758
- "{projectRoot}/**/*.d.ts.map",
2759
- "{projectRoot}/**/*.d.cts.map",
2760
- "{projectRoot}/**/*.d.mts.map",
2761
- "{projectRoot}/tsconfig.lib.tsbuildinfo",
2765
+ "{projectRoot}/dist",
2762
2766
],
2763
2767
"syncGenerators": [
2764
2768
"@nx/js:typescript-sync",
@@ -2778,12 +2782,11 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2778
2782
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2779
2783
compilerOptions : {
2780
2784
outFile : '../../dist/libs/my-lib/index.js' ,
2781
- rootDir : 'src' ,
2782
2785
} ,
2783
2786
files : [ 'main.ts' ] ,
2784
2787
} ) ,
2785
2788
'libs/my-lib/tsconfig.json' : `{}` ,
2786
- 'libs/my-lib/package.json' : `{"main": "dist/libs/my-lib/index.js" }` ,
2789
+ 'libs/my-lib/package.json' : `{}` ,
2787
2790
} ) ;
2788
2791
expect (
2789
2792
await invokeCreateNodesOnMatchingFiles ( context , {
@@ -2851,12 +2854,11 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2851
2854
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2852
2855
compilerOptions : {
2853
2856
outDir : '../../dist/libs/my-lib' ,
2854
- rootDir : 'src' ,
2855
2857
} ,
2856
2858
files : [ 'main.ts' ] ,
2857
2859
} ) ,
2858
2860
'libs/my-lib/tsconfig.json' : `{}` ,
2859
- 'libs/my-lib/package.json' : `{"main": "dist/libs/my-lib/index.js"}` ,
2861
+ 'libs/my-lib/package.json' : `{"main": "../../ dist/libs/my-lib/index.js"}` ,
2860
2862
} ) ;
2861
2863
expect (
2862
2864
await invokeCreateNodesOnMatchingFiles ( context , {
@@ -2919,7 +2921,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
2919
2921
it ( 'should add the inline output files when `outDir` is not defined' , async ( ) => {
2920
2922
await applyFilesToTempFsAndContext ( tempFs , context , {
2921
2923
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
2922
- compilerOptions : { rootDir : 'src' } ,
2923
2924
files : [ 'main.ts' ] ,
2924
2925
} ) ,
2925
2926
'libs/my-lib/tsconfig.json' : `{}` ,
@@ -3000,19 +3001,17 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
3000
3001
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
3001
3002
compilerOptions : {
3002
3003
outFile : '../../dist/libs/my-lib/lib.js' ,
3003
- rootDir : 'src' ,
3004
3004
} ,
3005
3005
files : [ 'main.ts' ] ,
3006
3006
references : [ { path : './tsconfig.other.json' } ] ,
3007
3007
} ) ,
3008
3008
'libs/my-lib/tsconfig.other.json' : JSON . stringify ( {
3009
3009
compilerOptions : {
3010
3010
outDir : '../../dist/libs/my-lib/other' ,
3011
- rootDir : 'src' ,
3012
3011
} ,
3013
3012
include : [ 'other/**/*.ts' ] ,
3014
3013
} ) ,
3015
- 'libs/my-lib/package.json' : `{"main": "dist/libs/my-lib/lib.js"}` ,
3014
+ 'libs/my-lib/package.json' : `{"main": "../../ dist/libs/my-lib/lib.js"}` ,
3016
3015
} ) ;
3017
3016
expect (
3018
3017
await invokeCreateNodesOnMatchingFiles ( context , {
@@ -3087,12 +3086,11 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
3087
3086
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
3088
3087
compilerOptions : {
3089
3088
outFile : '../../dist/libs/my-lib/index.js' ,
3090
- rootDir : 'src' ,
3091
3089
tsBuildInfoFile : '../../dist/libs/my-lib/my-lib.tsbuildinfo' ,
3092
3090
} ,
3093
3091
files : [ 'main.ts' ] ,
3094
3092
} ) ,
3095
- 'libs/my-lib/package.json' : `{"main": "dist/libs/my-lib/index.js"}` ,
3093
+ 'libs/my-lib/package.json' : `{"main": "../../ dist/libs/my-lib/index.js"}` ,
3096
3094
} ) ;
3097
3095
expect (
3098
3096
await invokeCreateNodesOnMatchingFiles ( context , {
@@ -3159,7 +3157,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
3159
3157
'libs/my-lib/tsconfig.json' : '{}' ,
3160
3158
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
3161
3159
compilerOptions : {
3162
- rootDir : 'src' ,
3163
3160
tsBuildInfoFile : '../../dist/libs/my-lib/my-lib.tsbuildinfo' ,
3164
3161
} ,
3165
3162
files : [ 'main.ts' ] ,
@@ -3239,7 +3236,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
3239
3236
await applyFilesToTempFsAndContext ( tempFs , context , {
3240
3237
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
3241
3238
compilerOptions : {
3242
- rootDir : 'src' ,
3243
3239
outDir : 'dist' ,
3244
3240
tsBuildInfoFile : 'my-lib.tsbuildinfo' ,
3245
3241
} ,
@@ -3312,7 +3308,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
3312
3308
'libs/my-lib/tsconfig.lib.json' : JSON . stringify ( {
3313
3309
compilerOptions : {
3314
3310
outDir : 'dist' ,
3315
- rootDir : 'src' ,
3316
3311
tsBuildInfoFile : 'dist/my-lib.tsbuildinfo' ,
3317
3312
} ,
3318
3313
files : [ 'main.ts' ] ,
0 commit comments