File tree Expand file tree Collapse file tree
apps/cli/src/lib/orca/patchers/rule Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { npmDistTagForCliVersion } from "../../../../public-cli" ;
12import type { FileOp } from "../file-writer/types" ;
23import type { PatchContext , PatchView } from "../../types" ;
34import { AbstractRulePatcher } from "../base" ;
@@ -40,7 +41,7 @@ export class AngularPatcher extends AbstractRulePatcher {
4041 {
4142 kind : "add-dep" ,
4243 name : SDK_DEPENDENCY ,
43- version : dependencyVersionForCli ( ctx . cliVersion , "alpha" ) ,
44+ version : npmDistTagForCliVersion ( ctx . cliVersion ) ,
4445 } ,
4546 ] ;
4647 }
@@ -61,8 +62,3 @@ export class AngularPatcher extends AbstractRulePatcher {
6162 } ;
6263 }
6364}
64-
65- function dependencyVersionForCli ( cliVersion : string , fallback : string ) : string {
66- const prerelease = cliVersion . match ( / ^ \d + \. \d + \. \d + - ( [ 0 - 9 A - Z a - z ] + ) (?: [ . - ] | $ ) / ) ?. [ 1 ] ;
67- return prerelease ?? fallback ;
68- }
Original file line number Diff line number Diff line change 1+ import { npmDistTagForCliVersion } from "../../../../public-cli" ;
12import { configCandidates } from "../config-paths" ;
23import type { FileOp } from "../file-writer/types" ;
34import type { PatchContext , PatchView } from "../../types" ;
@@ -54,7 +55,7 @@ export class NuxtPatcher extends AbstractRulePatcher {
5455 {
5556 kind : "add-dep" ,
5657 name : SDK_DEPENDENCY ,
57- version : dependencyVersionForCli ( ctx . cliVersion , "alpha" ) ,
58+ version : npmDistTagForCliVersion ( ctx . cliVersion ) ,
5859 } ,
5960 ] ;
6061 }
@@ -82,8 +83,3 @@ export class NuxtPatcher extends AbstractRulePatcher {
8283 } ;
8384 }
8485}
85-
86- function dependencyVersionForCli ( cliVersion : string , fallback : string ) : string {
87- const prerelease = cliVersion . match ( / ^ \d + \. \d + \. \d + - ( [ 0 - 9 A - Z a - z ] + ) (?: [ . - ] | $ ) / ) ?. [ 1 ] ;
88- return prerelease ?? fallback ;
89- }
Original file line number Diff line number Diff line change 1+ import { npmDistTagForCliVersion } from "../../../../public-cli" ;
12import type { FileOp } from "../file-writer/types" ;
23import type { PatchContext , PatchView } from "../../types" ;
34import { AbstractRulePatcher } from "../base" ;
@@ -36,7 +37,7 @@ export class ReactPatcher extends AbstractRulePatcher implements ViteSupport {
3637 {
3738 kind : "add-dep" ,
3839 name : SDK_DEPENDENCY ,
39- version : dependencyVersionForCli ( ctx . cliVersion , "alpha" ) ,
40+ version : npmDistTagForCliVersion ( ctx . cliVersion ) ,
4041 } ,
4142 ] ;
4243 }
@@ -57,13 +58,3 @@ export class ReactPatcher extends AbstractRulePatcher implements ViteSupport {
5758 } ;
5859 }
5960}
60-
61- /**
62- * Pins the SDK to the CLI's own prerelease tag (e.g. a `0.1.0-alpha.N` CLI
63- * installs `@zitadel/sdk-react@alpha`), falling back to a stable range. Mirrors
64- * the Next patcher so the two cannot drift.
65- */
66- function dependencyVersionForCli ( cliVersion : string , fallback : string ) : string {
67- const prerelease = cliVersion . match ( / ^ \d + \. \d + \. \d + - ( [ 0 - 9 A - Z a - z ] + ) (?: [ . - ] | $ ) / ) ?. [ 1 ] ;
68- return prerelease ?? fallback ;
69- }
Original file line number Diff line number Diff line change 1+ import { npmDistTagForCliVersion } from "../../../../public-cli" ;
12import type { FileOp } from "../file-writer/types" ;
23import type { PatchContext , PatchView } from "../../types" ;
34import { AbstractRulePatcher } from "../base" ;
@@ -31,7 +32,7 @@ export class VuePatcher extends AbstractRulePatcher implements ViteSupport {
3132 {
3233 kind : "add-dep" ,
3334 name : SDK_DEPENDENCY ,
34- version : dependencyVersionForCli ( ctx . cliVersion , "alpha" ) ,
35+ version : npmDistTagForCliVersion ( ctx . cliVersion ) ,
3536 } ,
3637 ] ;
3738 }
@@ -51,8 +52,3 @@ export class VuePatcher extends AbstractRulePatcher implements ViteSupport {
5152 } ;
5253 }
5354}
54-
55- function dependencyVersionForCli ( cliVersion : string , fallback : string ) : string {
56- const prerelease = cliVersion . match ( / ^ \d + \. \d + \. \d + - ( [ 0 - 9 A - Z a - z ] + ) (?: [ . - ] | $ ) / ) ?. [ 1 ] ;
57- return prerelease ?? fallback ;
58- }
You can’t perform that action at this time.
0 commit comments