@@ -13,7 +13,7 @@ import {
1313} from "../src/import-path.js" ;
1414
1515const model = ( over : Partial < ResolvedTarget > = { } ) : ResolvedTarget => ( {
16- name : "default" , outDir : "db/gen" , importBase : "@mf /db/generated" ,
16+ name : "default" , outDir : "db/gen" , importBase : "@acme /db/generated" ,
1717 outputLayout : "package" , dbImport : "../index" , runtime : true , ...over ,
1818} ) ;
1919const web = ( over : Partial < ResolvedTarget > = { } ) : ResolvedTarget => ( {
@@ -23,50 +23,50 @@ const web = (over: Partial<ResolvedTarget> = {}): ResolvedTarget => ({
2323
2424describe ( "entityModuleSpecifier" , ( ) => {
2525 it ( "same target → relative (honors extStyle), package layout" , ( ) => {
26- expect ( entityModuleSpecifier ( model ( ) , model ( ) , "mikes ::commerce" , "Program" , "none" ) )
26+ expect ( entityModuleSpecifier ( model ( ) , model ( ) , "shop ::commerce" , "Program" , "none" ) )
2727 . toBe ( "./Program" ) ;
28- expect ( entityModuleSpecifier ( model ( ) , model ( ) , "mikes ::commerce" , "Program" , "js" ) )
28+ expect ( entityModuleSpecifier ( model ( ) , model ( ) , "shop ::commerce" , "Program" , "js" ) )
2929 . toBe ( "./Program.js" ) ;
3030 } ) ;
3131 it ( "same target → relative, flat layout" , ( ) => {
32- expect ( entityModuleSpecifier ( model ( { outputLayout : "flat" } ) , model ( { outputLayout : "flat" } ) , "mikes ::commerce" , "Program" , "none" ) )
32+ expect ( entityModuleSpecifier ( model ( { outputLayout : "flat" } ) , model ( { outputLayout : "flat" } ) , "shop ::commerce" , "Program" , "none" ) )
3333 . toBe ( "./Program" ) ;
3434 } ) ;
3535 it ( "cross target, package layout → extension-less importBase path (extStyle ignored)" , ( ) => {
36- expect ( entityModuleSpecifier ( web ( ) , model ( ) , "mikes ::commerce" , "Program" , "js" ) )
37- . toBe ( "@mf /db/generated/mikes /commerce/Program" ) ;
36+ expect ( entityModuleSpecifier ( web ( ) , model ( ) , "shop ::commerce" , "Program" , "js" ) )
37+ . toBe ( "@acme /db/generated/shop /commerce/Program" ) ;
3838 } ) ;
3939 it ( "cross target, flat layout → importBase + entity, no package path" , ( ) => {
40- expect ( entityModuleSpecifier ( web ( { outputLayout : "flat" } ) , model ( { outputLayout : "flat" } ) , "mikes ::commerce" , "Program" , "none" ) )
41- . toBe ( "@mf /db/generated/Program" ) ;
40+ expect ( entityModuleSpecifier ( web ( { outputLayout : "flat" } ) , model ( { outputLayout : "flat" } ) , "shop ::commerce" , "Program" , "none" ) )
41+ . toBe ( "@acme /db/generated/Program" ) ;
4242 } ) ;
4343 it ( "cross target, entity at root package → importBase + entity" , ( ) => {
4444 expect ( entityModuleSpecifier ( web ( ) , model ( ) , undefined , "Tag" , "none" ) )
45- . toBe ( "@mf /db/generated/Tag" ) ;
45+ . toBe ( "@acme /db/generated/Tag" ) ;
4646 } ) ;
4747 it ( "cross target without importBase → throws" , ( ) => {
48- expect ( ( ) => entityModuleSpecifier ( web ( ) , model ( { importBase : undefined } ) , "mikes ::commerce" , "Program" , "none" ) )
48+ expect ( ( ) => entityModuleSpecifier ( web ( ) , model ( { importBase : undefined } ) , "shop ::commerce" , "Program" , "none" ) )
4949 . toThrow ( / i m p o r t B a s e / ) ;
5050 } ) ;
5151} ) ;
5252
5353describe ( "siblingSpecifier" , ( ) => {
5454 it ( "always same-target relative, package layout" , ( ) => {
55- expect ( siblingSpecifier ( web ( ) , "mikes ::commerce" , "Program.columns" , "none" ) ) . toBe ( "./Program.columns" ) ;
55+ expect ( siblingSpecifier ( web ( ) , "shop ::commerce" , "Program.columns" , "none" ) ) . toBe ( "./Program.columns" ) ;
5656 } ) ;
5757 it ( "honors extStyle" , ( ) => {
58- expect ( siblingSpecifier ( web ( ) , "mikes ::commerce" , "Program.columns" , "js" ) ) . toBe ( "./Program.columns.js" ) ;
58+ expect ( siblingSpecifier ( web ( ) , "shop ::commerce" , "Program.columns" , "js" ) ) . toBe ( "./Program.columns.js" ) ;
5959 } ) ;
6060} ) ;
6161
6262describe ( "barrelModuleSpecifier" , ( ) => {
6363 it ( "same target (package) → './<pkg-path>/<entity>'" , ( ) => {
64- expect ( barrelModuleSpecifier ( model ( ) , model ( ) , "mikes ::commerce" , "Program" , "none" ) )
65- . toBe ( "./mikes /commerce/Program" ) ;
64+ expect ( barrelModuleSpecifier ( model ( ) , model ( ) , "shop ::commerce" , "Program" , "none" ) )
65+ . toBe ( "./shop /commerce/Program" ) ;
6666 } ) ;
6767 it ( "cross target → extension-less importBase path" , ( ) => {
68- expect ( barrelModuleSpecifier ( web ( ) , model ( ) , "mikes ::commerce" , "Program" , "none" ) )
69- . toBe ( "@mf /db/generated/mikes /commerce/Program" ) ;
68+ expect ( barrelModuleSpecifier ( web ( ) , model ( ) , "shop ::commerce" , "Program" , "none" ) )
69+ . toBe ( "@acme /db/generated/shop /commerce/Program" ) ;
7070 } ) ;
7171} ) ;
7272
0 commit comments