@infracraft/pulumi 1.1.0 → 1.2.0
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/dist/railway/deploy.cjs +1 -2
- package/dist/railway/deploy.cjs.map +1 -1
- package/dist/railway/deploy.d.cts +2 -4
- package/dist/railway/deploy.d.cts.map +1 -1
- package/dist/railway/deploy.d.mts +2 -4
- package/dist/railway/deploy.d.mts.map +1 -1
- package/dist/railway/deploy.mjs +1 -2
- package/dist/railway/deploy.mjs.map +1 -1
- package/dist/vercel/deploy.cjs +2 -14
- package/dist/vercel/deploy.cjs.map +1 -1
- package/dist/vercel/deploy.d.cts +2 -8
- package/dist/vercel/deploy.d.cts.map +1 -1
- package/dist/vercel/deploy.d.mts +2 -8
- package/dist/vercel/deploy.d.mts.map +1 -1
- package/dist/vercel/deploy.mjs +2 -13
- package/dist/vercel/deploy.mjs.map +1 -1
- package/package.json +1 -1
package/dist/railway/deploy.cjs
CHANGED
|
@@ -33,11 +33,10 @@ var RailwayDeploy = class extends _pulumi_pulumi.ComponentResource {
|
|
|
33
33
|
return dir;
|
|
34
34
|
}).join("\\n");
|
|
35
35
|
const setupLines = [ignorePatterns ? `printf '${ignorePatterns}\\n' > .railwayignore` : "", args.railpackConfig ? `printf '${JSON.stringify(args.railpackConfig).replace(/'/g, "\\'")}' > railpack.json` : ""].filter(Boolean).join("; ");
|
|
36
|
-
const envHash = _pulumi_pulumi.all(Object.entries(args.env).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => _pulumi_pulumi.output(v).apply((val) => `${k}=${val}`))).apply((parts) => parts.join(","));
|
|
37
36
|
const deployCmd = _pulumi_pulumi.interpolate`while ! mkdir ${LOCK_DIR} 2>/dev/null; do sleep 1; done; ${setupLines}; { sleep 5; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; } & railway up --ci --project ${project.id} --service ${service.id} --environment ${environment.id}; EXIT=$?; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; wait; exit $EXIT`;
|
|
38
37
|
new _pulumi_command.local.Command(`${name}-deploy`, {
|
|
39
38
|
create: deployCmd,
|
|
40
|
-
triggers:
|
|
39
|
+
triggers: args.triggers,
|
|
41
40
|
dir: args.directory,
|
|
42
41
|
environment: { RAILWAY_TOKEN: project.projectToken }
|
|
43
42
|
}, { parent: this });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.cjs","names":["pulumi","command"],"sources":["../../src/railway/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { RailwayEnvironment } from \"./environment.js\";\nimport type { RailwayProject } from \"./project.js\";\nimport type { RailwayProvider } from \"./provider.js\";\nimport type { RailwayService } from \"./service.js\";\n\n/** Build and deploy configuration for a Railway service. */\nexport interface RailwayDeployConfig {\n\t/** Build system: `\"RAILPACK\"`, `\"NIXPACKS\"`, or `\"DOCKERFILE\"`. */\n\tbuilder?: string;\n\n\t/** Shell command executed to start the service at runtime. */\n\tstartCommand?: string;\n\n\t/** Shell command executed before the main deploy (e.g. migrations). */\n\tpreDeployCommand?: string;\n}\n\n/** Args for RailwayDeploy. */\nexport interface RailwayDeployArgs {\n\t/** Absolute path to the monorepo root (working directory for `railway up`). */\n\tdirectory: string;\n\n\t/**
|
|
1
|
+
{"version":3,"file":"deploy.cjs","names":["pulumi","command"],"sources":["../../src/railway/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { RailwayEnvironment } from \"./environment.js\";\nimport type { RailwayProject } from \"./project.js\";\nimport type { RailwayProvider } from \"./provider.js\";\nimport type { RailwayService } from \"./service.js\";\n\n/** Build and deploy configuration for a Railway service. */\nexport interface RailwayDeployConfig {\n\t/** Build system: `\"RAILPACK\"`, `\"NIXPACKS\"`, or `\"DOCKERFILE\"`. */\n\tbuilder?: string;\n\n\t/** Shell command executed to start the service at runtime. */\n\tstartCommand?: string;\n\n\t/** Shell command executed before the main deploy (e.g. migrations). */\n\tpreDeployCommand?: string;\n}\n\n/** Args for RailwayDeploy. */\nexport interface RailwayDeployArgs {\n\t/** Absolute path to the monorepo root (working directory for `railway up`). */\n\tdirectory: string;\n\n\t/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\n\t/** Directories to exclude via `.railwayignore`. */\n\texcludePaths?: string[];\n\n\t/** Railpack configuration written to `railpack.json` before deploy. */\n\trailpackConfig?: Record<string, unknown>;\n}\n\n/** Options type for RailwayDeploy — replaces Pulumi's native `provider` field. */\ntype RailwayDeployOptions = Omit<\n\tpulumi.ComponentResourceOptions,\n\t\"provider\"\n> & {\n\t/** Railway authentication context. */\n\tprovider: RailwayProvider;\n\n\t/** Railway project context. */\n\tproject: RailwayProject;\n\n\t/** Railway environment context. */\n\tenvironment: RailwayEnvironment;\n\n\t/** Railway service context. */\n\tservice: RailwayService;\n};\n\nconst LOCK_DIR = \"/tmp/.railway-upload-lock\";\n\n/**\n * Deploys a Railway service and waits for the build to complete.\n *\n * Uses `railway up --ci` which blocks until the build finishes.\n * Multiple deploys run in parallel — a mkdir lock serializes only the\n * brief upload phase (~5s) when `.railwayignore` must be consistent,\n * then releases so builds stream concurrently.\n *\n * @example\n * ```typescript\n * new RailwayDeploy(\"api-deploy\", {\n * directory: monorepoRoot,\n * sourceHash,\n * env: { DATABASE_URL: dbUrl },\n * }, { provider, project, environment, service });\n * ```\n */\nexport class RailwayDeploy extends pulumi.ComponentResource {\n\tconstructor(\n\t\tname: string,\n\t\targs: RailwayDeployArgs,\n\t\topts: RailwayDeployOptions,\n\t) {\n\t\tconst { provider, project, environment, service, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:railway:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst ignorePatterns = (args.excludePaths ?? [])\n\t\t\t.map((dir) => {\n\t\t\t\tif (dir.startsWith(\"apps/\")) {\n\t\t\t\t\treturn `${dir}/**\\\\n!${dir}/package.json`;\n\t\t\t\t}\n\n\t\t\t\treturn dir;\n\t\t\t})\n\t\t\t.join(\"\\\\n\");\n\n\t\tconst writeIgnore = ignorePatterns\n\t\t\t? `printf '${ignorePatterns}\\\\n' > .railwayignore`\n\t\t\t: \"\";\n\n\t\tconst writeRailpack = args.railpackConfig\n\t\t\t? `printf '${JSON.stringify(args.railpackConfig).replace(/'/g, \"\\\\'\")}' > railpack.json`\n\t\t\t: \"\";\n\n\t\tconst setupLines = [writeIgnore, writeRailpack].filter(Boolean).join(\"; \");\n\n\t\tconst deployCmd = pulumi.interpolate`while ! mkdir ${LOCK_DIR} 2>/dev/null; do sleep 1; done; ${setupLines}; { sleep 5; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; } & railway up --ci --project ${project.id} --service ${service.id} --environment ${environment.id}; EXIT=$?; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; wait; exit $EXIT`;\n\n\t\tnew command.local.Command(\n\t\t\t`${name}-deploy`,\n\t\t\t{\n\t\t\t\tcreate: deployCmd,\n\t\t\t\ttriggers: args.triggers,\n\t\t\t\tdir: args.directory,\n\t\t\t\tenvironment: {\n\t\t\t\t\tRAILWAY_TOKEN: project.projectToken,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ parent: this },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;;;;AAoDA,MAAM,WAAW;;;;;;;;;;;;;;;;;;AAmBjB,IAAa,gBAAb,cAAmCA,eAAO,kBAAkB;CAC3D,YACC,MACA,MACA,MACC;EACD,MAAM,EAAE,UAAU,SAAS,aAAa,SAAS,GAAG,eAAe;EAEnE,MAAM,6BAA6B,MAAM,CAAC,GAAG,UAAU;EAEvD,MAAM,kBAAkB,KAAK,gBAAgB,CAAC,GAC5C,KAAK,QAAQ;GACb,IAAI,IAAI,WAAW,OAAO,GACzB,OAAO,GAAG,IAAI,SAAS,IAAI;GAG5B,OAAO;EACR,CAAC,EACA,KAAK,KAAK;EAUZ,MAAM,aAAa,CARC,iBACjB,WAAW,eAAe,yBAC1B,IAEmB,KAAK,iBACxB,WAAW,KAAK,UAAU,KAAK,cAAc,EAAE,QAAQ,MAAM,KAAK,EAAE,qBACpE,EAE2C,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;EAEzE,MAAM,YAAY,eAAO,WAAW,iBAAiB,SAAS,kCAAkC,WAAW,yDAAyD,SAAS,8CAA8C,QAAQ,GAAG,aAAa,QAAQ,GAAG,iBAAiB,YAAY,GAAG,uDAAuD,SAAS;EAE9V,IAAIC,gBAAQ,MAAM,QACjB,GAAG,KAAK,UACR;GACC,QAAQ;GACR,UAAU,KAAK;GACf,KAAK,KAAK;GACV,aAAa,EACZ,eAAe,QAAQ,aACxB;EACD,GACA,EAAE,QAAQ,KAAK,CAChB;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|
|
@@ -19,10 +19,8 @@ interface RailwayDeployConfig {
|
|
|
19
19
|
interface RailwayDeployArgs {
|
|
20
20
|
/** Absolute path to the monorepo root (working directory for `railway up`). */
|
|
21
21
|
directory: string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/** Env var map used as deploy trigger. */
|
|
25
|
-
env: Record<string, pulumi.Input<string>>;
|
|
22
|
+
/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */
|
|
23
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
26
24
|
/** Directories to exclude via `.railwayignore`. */
|
|
27
25
|
excludePaths?: string[];
|
|
28
26
|
/** Railpack configuration written to `railpack.json` before deploy. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/railway/deploy.ts"],"mappings":";;;;;;;;;UAQiB,mBAAA;;EAEhB,OAAA;EAFmC;EAKnC,YAAA;EALmC;EAQnC,gBAAA;AAAA;;UAIgB,iBAAA;EAJA;EAMhB,SAAA;EAFiC;EAKjC,
|
|
1
|
+
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/railway/deploy.ts"],"mappings":";;;;;;;;;UAQiB,mBAAA;;EAEhB,OAAA;EAFmC;EAKnC,YAAA;EALmC;EAQnC,gBAAA;AAAA;;UAIgB,iBAAA;EAJA;EAMhB,SAAA;EAFiC;EAKjC,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAAP;EAGvB,YAAA;EAGiB;EAAjB,cAAA,GAAiB,MAAA;AAAA;;KAIb,oBAAA,GAAuB,IAAA,CAC3B,MAAA,CAAO,wBAAA;EAXG,sCAeV,QAAA,EAAU,eAAA,EAfa;EAkBvB,OAAA,EAAS,cAAA,EAfT;EAkBA,WAAA,EAAa,kBAAA,EAfI;EAkBjB,OAAA,EAAS,cAAA;AAAA;AAjBT;;;;;;;;;;;;;;;;;AAAA,cAuCY,aAAA,SAAsB,MAAA,CAAO,iBAAA;cAExC,IAAA,UACA,IAAA,EAAM,iBAAA,EACN,IAAA,EAAM,oBAAA;AAAA"}
|
|
@@ -19,10 +19,8 @@ interface RailwayDeployConfig {
|
|
|
19
19
|
interface RailwayDeployArgs {
|
|
20
20
|
/** Absolute path to the monorepo root (working directory for `railway up`). */
|
|
21
21
|
directory: string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/** Env var map used as deploy trigger. */
|
|
25
|
-
env: Record<string, pulumi.Input<string>>;
|
|
22
|
+
/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */
|
|
23
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
26
24
|
/** Directories to exclude via `.railwayignore`. */
|
|
27
25
|
excludePaths?: string[];
|
|
28
26
|
/** Railpack configuration written to `railpack.json` before deploy. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/railway/deploy.ts"],"mappings":";;;;;;;;;UAQiB,mBAAA;;EAEhB,OAAA;EAFmC;EAKnC,YAAA;EALmC;EAQnC,gBAAA;AAAA;;UAIgB,iBAAA;EAJA;EAMhB,SAAA;EAFiC;EAKjC,
|
|
1
|
+
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/railway/deploy.ts"],"mappings":";;;;;;;;;UAQiB,mBAAA;;EAEhB,OAAA;EAFmC;EAKnC,YAAA;EALmC;EAQnC,gBAAA;AAAA;;UAIgB,iBAAA;EAJA;EAMhB,SAAA;EAFiC;EAKjC,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAAP;EAGvB,YAAA;EAGiB;EAAjB,cAAA,GAAiB,MAAA;AAAA;;KAIb,oBAAA,GAAuB,IAAA,CAC3B,MAAA,CAAO,wBAAA;EAXG,sCAeV,QAAA,EAAU,eAAA,EAfa;EAkBvB,OAAA,EAAS,cAAA,EAfT;EAkBA,WAAA,EAAa,kBAAA,EAfI;EAkBjB,OAAA,EAAS,cAAA;AAAA;AAjBT;;;;;;;;;;;;;;;;;AAAA,cAuCY,aAAA,SAAsB,MAAA,CAAO,iBAAA;cAExC,IAAA,UACA,IAAA,EAAM,iBAAA,EACN,IAAA,EAAM,oBAAA;AAAA"}
|
package/dist/railway/deploy.mjs
CHANGED
|
@@ -30,11 +30,10 @@ var RailwayDeploy = class extends pulumi.ComponentResource {
|
|
|
30
30
|
return dir;
|
|
31
31
|
}).join("\\n");
|
|
32
32
|
const setupLines = [ignorePatterns ? `printf '${ignorePatterns}\\n' > .railwayignore` : "", args.railpackConfig ? `printf '${JSON.stringify(args.railpackConfig).replace(/'/g, "\\'")}' > railpack.json` : ""].filter(Boolean).join("; ");
|
|
33
|
-
const envHash = pulumi.all(Object.entries(args.env).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => pulumi.output(v).apply((val) => `${k}=${val}`))).apply((parts) => parts.join(","));
|
|
34
33
|
const deployCmd = pulumi.interpolate`while ! mkdir ${LOCK_DIR} 2>/dev/null; do sleep 1; done; ${setupLines}; { sleep 5; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; } & railway up --ci --project ${project.id} --service ${service.id} --environment ${environment.id}; EXIT=$?; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; wait; exit $EXIT`;
|
|
35
34
|
new command.local.Command(`${name}-deploy`, {
|
|
36
35
|
create: deployCmd,
|
|
37
|
-
triggers:
|
|
36
|
+
triggers: args.triggers,
|
|
38
37
|
dir: args.directory,
|
|
39
38
|
environment: { RAILWAY_TOKEN: project.projectToken }
|
|
40
39
|
}, { parent: this });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/railway/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { RailwayEnvironment } from \"./environment.js\";\nimport type { RailwayProject } from \"./project.js\";\nimport type { RailwayProvider } from \"./provider.js\";\nimport type { RailwayService } from \"./service.js\";\n\n/** Build and deploy configuration for a Railway service. */\nexport interface RailwayDeployConfig {\n\t/** Build system: `\"RAILPACK\"`, `\"NIXPACKS\"`, or `\"DOCKERFILE\"`. */\n\tbuilder?: string;\n\n\t/** Shell command executed to start the service at runtime. */\n\tstartCommand?: string;\n\n\t/** Shell command executed before the main deploy (e.g. migrations). */\n\tpreDeployCommand?: string;\n}\n\n/** Args for RailwayDeploy. */\nexport interface RailwayDeployArgs {\n\t/** Absolute path to the monorepo root (working directory for `railway up`). */\n\tdirectory: string;\n\n\t/**
|
|
1
|
+
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/railway/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { RailwayEnvironment } from \"./environment.js\";\nimport type { RailwayProject } from \"./project.js\";\nimport type { RailwayProvider } from \"./provider.js\";\nimport type { RailwayService } from \"./service.js\";\n\n/** Build and deploy configuration for a Railway service. */\nexport interface RailwayDeployConfig {\n\t/** Build system: `\"RAILPACK\"`, `\"NIXPACKS\"`, or `\"DOCKERFILE\"`. */\n\tbuilder?: string;\n\n\t/** Shell command executed to start the service at runtime. */\n\tstartCommand?: string;\n\n\t/** Shell command executed before the main deploy (e.g. migrations). */\n\tpreDeployCommand?: string;\n}\n\n/** Args for RailwayDeploy. */\nexport interface RailwayDeployArgs {\n\t/** Absolute path to the monorepo root (working directory for `railway up`). */\n\tdirectory: string;\n\n\t/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\n\t/** Directories to exclude via `.railwayignore`. */\n\texcludePaths?: string[];\n\n\t/** Railpack configuration written to `railpack.json` before deploy. */\n\trailpackConfig?: Record<string, unknown>;\n}\n\n/** Options type for RailwayDeploy — replaces Pulumi's native `provider` field. */\ntype RailwayDeployOptions = Omit<\n\tpulumi.ComponentResourceOptions,\n\t\"provider\"\n> & {\n\t/** Railway authentication context. */\n\tprovider: RailwayProvider;\n\n\t/** Railway project context. */\n\tproject: RailwayProject;\n\n\t/** Railway environment context. */\n\tenvironment: RailwayEnvironment;\n\n\t/** Railway service context. */\n\tservice: RailwayService;\n};\n\nconst LOCK_DIR = \"/tmp/.railway-upload-lock\";\n\n/**\n * Deploys a Railway service and waits for the build to complete.\n *\n * Uses `railway up --ci` which blocks until the build finishes.\n * Multiple deploys run in parallel — a mkdir lock serializes only the\n * brief upload phase (~5s) when `.railwayignore` must be consistent,\n * then releases so builds stream concurrently.\n *\n * @example\n * ```typescript\n * new RailwayDeploy(\"api-deploy\", {\n * directory: monorepoRoot,\n * sourceHash,\n * env: { DATABASE_URL: dbUrl },\n * }, { provider, project, environment, service });\n * ```\n */\nexport class RailwayDeploy extends pulumi.ComponentResource {\n\tconstructor(\n\t\tname: string,\n\t\targs: RailwayDeployArgs,\n\t\topts: RailwayDeployOptions,\n\t) {\n\t\tconst { provider, project, environment, service, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:railway:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst ignorePatterns = (args.excludePaths ?? [])\n\t\t\t.map((dir) => {\n\t\t\t\tif (dir.startsWith(\"apps/\")) {\n\t\t\t\t\treturn `${dir}/**\\\\n!${dir}/package.json`;\n\t\t\t\t}\n\n\t\t\t\treturn dir;\n\t\t\t})\n\t\t\t.join(\"\\\\n\");\n\n\t\tconst writeIgnore = ignorePatterns\n\t\t\t? `printf '${ignorePatterns}\\\\n' > .railwayignore`\n\t\t\t: \"\";\n\n\t\tconst writeRailpack = args.railpackConfig\n\t\t\t? `printf '${JSON.stringify(args.railpackConfig).replace(/'/g, \"\\\\'\")}' > railpack.json`\n\t\t\t: \"\";\n\n\t\tconst setupLines = [writeIgnore, writeRailpack].filter(Boolean).join(\"; \");\n\n\t\tconst deployCmd = pulumi.interpolate`while ! mkdir ${LOCK_DIR} 2>/dev/null; do sleep 1; done; ${setupLines}; { sleep 5; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; } & railway up --ci --project ${project.id} --service ${service.id} --environment ${environment.id}; EXIT=$?; rm -f .railwayignore railpack.json; rmdir ${LOCK_DIR} 2>/dev/null; wait; exit $EXIT`;\n\n\t\tnew command.local.Command(\n\t\t\t`${name}-deploy`,\n\t\t\t{\n\t\t\t\tcreate: deployCmd,\n\t\t\t\ttriggers: args.triggers,\n\t\t\t\tdir: args.directory,\n\t\t\t\tenvironment: {\n\t\t\t\t\tRAILWAY_TOKEN: project.projectToken,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ parent: this },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;AAoDA,MAAM,WAAW;;;;;;;;;;;;;;;;;;AAmBjB,IAAa,gBAAb,cAAmC,OAAO,kBAAkB;CAC3D,YACC,MACA,MACA,MACC;EACD,MAAM,EAAE,UAAU,SAAS,aAAa,SAAS,GAAG,eAAe;EAEnE,MAAM,6BAA6B,MAAM,CAAC,GAAG,UAAU;EAEvD,MAAM,kBAAkB,KAAK,gBAAgB,CAAC,GAC5C,KAAK,QAAQ;GACb,IAAI,IAAI,WAAW,OAAO,GACzB,OAAO,GAAG,IAAI,SAAS,IAAI;GAG5B,OAAO;EACR,CAAC,EACA,KAAK,KAAK;EAUZ,MAAM,aAAa,CARC,iBACjB,WAAW,eAAe,yBAC1B,IAEmB,KAAK,iBACxB,WAAW,KAAK,UAAU,KAAK,cAAc,EAAE,QAAQ,MAAM,KAAK,EAAE,qBACpE,EAE2C,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;EAEzE,MAAM,YAAY,OAAO,WAAW,iBAAiB,SAAS,kCAAkC,WAAW,yDAAyD,SAAS,8CAA8C,QAAQ,GAAG,aAAa,QAAQ,GAAG,iBAAiB,YAAY,GAAG,uDAAuD,SAAS;EAE9V,IAAI,QAAQ,MAAM,QACjB,GAAG,KAAK,UACR;GACC,QAAQ;GACR,UAAU,KAAK;GACf,KAAK,KAAK;GACV,aAAa,EACZ,eAAe,QAAQ,aACxB;EACD,GACA,EAAE,QAAQ,KAAK,CAChB;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|
package/dist/vercel/deploy.cjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('../chunk-BVYJZCqc.cjs');
|
|
3
|
-
const require_hash = require('../hash.cjs');
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
node_path = require_chunk.__toESM(node_path, 1);
|
|
6
3
|
let _pulumi_command = require("@pulumi/command");
|
|
7
4
|
_pulumi_command = require_chunk.__toESM(_pulumi_command, 1);
|
|
8
5
|
let _pulumi_pulumi = require("@pulumi/pulumi");
|
|
@@ -33,25 +30,16 @@ var VercelDeploy = class extends _pulumi_pulumi.ComponentResource {
|
|
|
33
30
|
super("infracraft:vercel:Deploy", name, {}, pulumiOpts);
|
|
34
31
|
const projectId = project ? project.id : args.projectId;
|
|
35
32
|
if (!projectId) throw new Error("VercelDeploy: either `args.projectId` or `opts.project` must be provided");
|
|
36
|
-
const hashParts = [require_hash.hashDirectory(node_path.join(args.monorepoRoot, args.rootDirectory))];
|
|
37
|
-
for (const dir of args.additionalSourceDirs ?? []) hashParts.push(require_hash.hashDirectory(node_path.join(args.monorepoRoot, dir)));
|
|
38
|
-
const sourceHash = hashParts.join(",");
|
|
39
|
-
const commandOpts = { parent: this };
|
|
40
|
-
if (args.dependsOn && args.dependsOn.length > 0) commandOpts.dependsOn = args.dependsOn;
|
|
41
|
-
const envHash = _pulumi_pulumi.all(Object.entries(args.env).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => _pulumi_pulumi.output(v).apply((val) => `${k}=${val}`))).apply((parts) => parts.join(","));
|
|
42
33
|
new _pulumi_command.local.Command(`${name}-deploy`, {
|
|
43
34
|
create: "vercel deploy --prod --yes",
|
|
44
|
-
triggers:
|
|
35
|
+
triggers: args.triggers,
|
|
45
36
|
dir: args.monorepoRoot,
|
|
46
37
|
environment: {
|
|
47
38
|
VERCEL_TOKEN: provider.token,
|
|
48
39
|
VERCEL_ORG_ID: provider.teamId,
|
|
49
40
|
VERCEL_PROJECT_ID: projectId
|
|
50
41
|
}
|
|
51
|
-
}, {
|
|
52
|
-
parent: this,
|
|
53
|
-
...commandOpts.dependsOn ? { dependsOn: commandOpts.dependsOn } : {}
|
|
54
|
-
});
|
|
42
|
+
}, { parent: this });
|
|
55
43
|
this.registerOutputs({});
|
|
56
44
|
}
|
|
57
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.cjs","names":["pulumi","
|
|
1
|
+
{"version":3,"file":"deploy.cjs","names":["pulumi","command"],"sources":["../../src/vercel/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { VercelProject } from \"./project.js\";\nimport type { VercelProvider } from \"./provider.js\";\n\n/** Options type for VercelDeploy — replaces Pulumi's native `provider` field. */\ntype VercelDeployOptions = Omit<\n\tpulumi.ComponentResourceOptions,\n\t\"provider\"\n> & {\n\t/** Vercel authentication context. */\n\tprovider: VercelProvider;\n\n\t/**\n\t * VercelProject resource to source the project ID from.\n\t * When provided, `args.projectId` is optional and ignored if both are given.\n\t */\n\tproject?: VercelProject;\n};\n\n/** Args for VercelDeploy. */\nexport interface VercelDeployArgs {\n\t/**\n\t * Vercel project ID.\n\t * Required when `opts.project` is not provided.\n\t */\n\tprojectId?: pulumi.Input<string>;\n\n\t/** Absolute path to the monorepo root (working directory for `vercel deploy`). */\n\tmonorepoRoot: string;\n\n\t/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n}\n\n/**\n * Deploys a Vercel project via `vercel deploy --prod --yes` CLI.\n *\n * Triggers on source hash (computed from the app directory) and env content hash\n * (from `VercelVariable.contentHash`). When an env value changes — whether from\n * code, a new mesh URL, or a drift fix after `pulumi refresh` — the hash changes\n * and a redeploy is triggered.\n *\n * @example\n * ```typescript\n * new VercelDeploy(\"nexus-deploy\", {\n * projectId: vercelProject.id,\n * rootDirectory: \"apps/nexus\",\n * monorepoRoot,\n * env: { NEXT_PUBLIC_API_URL: meshUrl },\n * }, { provider });\n * ```\n */\nexport class VercelDeploy extends pulumi.ComponentResource {\n\tconstructor(\n\t\tname: string,\n\t\targs: VercelDeployArgs,\n\t\topts: VercelDeployOptions,\n\t) {\n\t\tconst { provider, project, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:vercel:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst projectId = project\n\t\t\t? project.id\n\t\t\t: (args.projectId as pulumi.Input<string>);\n\n\t\tif (!projectId) {\n\t\t\tthrow new Error(\n\t\t\t\t\"VercelDeploy: either `args.projectId` or `opts.project` must be provided\",\n\t\t\t);\n\t\t}\n\n\t\tnew command.local.Command(\n\t\t\t`${name}-deploy`,\n\t\t\t{\n\t\t\t\tcreate: \"vercel deploy --prod --yes\",\n\t\t\t\ttriggers: args.triggers,\n\t\t\t\tdir: args.monorepoRoot,\n\t\t\t\tenvironment: {\n\t\t\t\t\tVERCEL_TOKEN: provider.token,\n\t\t\t\t\tVERCEL_ORG_ID: provider.teamId,\n\t\t\t\t\tVERCEL_PROJECT_ID: projectId,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ parent: this },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAa,eAAb,cAAkCA,eAAO,kBAAkB;CAC1D,YACC,MACA,MACA,MACC;EACD,MAAM,EAAE,UAAU,SAAS,GAAG,eAAe;EAE7C,MAAM,4BAA4B,MAAM,CAAC,GAAG,UAAU;EAEtD,MAAM,YAAY,UACf,QAAQ,KACP,KAAK;EAET,IAAI,CAAC,WACJ,MAAM,IAAI,MACT,0EACD;EAGD,IAAIC,gBAAQ,MAAM,QACjB,GAAG,KAAK,UACR;GACC,QAAQ;GACR,UAAU,KAAK;GACf,KAAK,KAAK;GACV,aAAa;IACZ,cAAc,SAAS;IACvB,eAAe,SAAS;IACxB,mBAAmB;GACpB;EACD,GACA,EAAE,QAAQ,KAAK,CAChB;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|
package/dist/vercel/deploy.d.cts
CHANGED
|
@@ -20,16 +20,10 @@ interface VercelDeployArgs {
|
|
|
20
20
|
* Required when `opts.project` is not provided.
|
|
21
21
|
*/
|
|
22
22
|
projectId?: pulumi.Input<string>;
|
|
23
|
-
/** Relative path from monorepo root to the app directory (e.g. `"apps/nexus"`). */
|
|
24
|
-
rootDirectory: string;
|
|
25
23
|
/** Absolute path to the monorepo root (working directory for `vercel deploy`). */
|
|
26
24
|
monorepoRoot: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/** Additional directories (relative to monorepo root) to include in source hash. Changes in these trigger redeploy. */
|
|
30
|
-
additionalSourceDirs?: string[];
|
|
31
|
-
/** Resources that must complete before the deploy runs. */
|
|
32
|
-
dependsOn?: pulumi.Resource[];
|
|
25
|
+
/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */
|
|
26
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* Deploys a Vercel project via `vercel deploy --prod --yes` CLI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/vercel/deploy.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/vercel/deploy.ts"],"mappings":";;;;;;;KAMK,mBAAA,GAAsB,IAAA,CAC1B,MAAA,CAAO,wBAAA;uCAIP,QAAA,EAAU,cAAA;EALa;;;;EAWvB,OAAA,GAAU,aAAA;AAAA;;UAIM,gBAAA;EAfU;;;;EAoB1B,SAAA,GAAY,MAAA,CAAO,KAAA;EATnB;EAYA,YAAA;EAZuB;EAevB,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;AAAA;;;;;;;;;;;;;;;;;;AAAK;cAqBvB,YAAA,SAAqB,MAAA,CAAO,iBAAA;cAEvC,IAAA,UACA,IAAA,EAAM,gBAAA,EACN,IAAA,EAAM,mBAAA;AAAA"}
|
package/dist/vercel/deploy.d.mts
CHANGED
|
@@ -20,16 +20,10 @@ interface VercelDeployArgs {
|
|
|
20
20
|
* Required when `opts.project` is not provided.
|
|
21
21
|
*/
|
|
22
22
|
projectId?: pulumi.Input<string>;
|
|
23
|
-
/** Relative path from monorepo root to the app directory (e.g. `"apps/nexus"`). */
|
|
24
|
-
rootDirectory: string;
|
|
25
23
|
/** Absolute path to the monorepo root (working directory for `vercel deploy`). */
|
|
26
24
|
monorepoRoot: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/** Additional directories (relative to monorepo root) to include in source hash. Changes in these trigger redeploy. */
|
|
30
|
-
additionalSourceDirs?: string[];
|
|
31
|
-
/** Resources that must complete before the deploy runs. */
|
|
32
|
-
dependsOn?: pulumi.Resource[];
|
|
25
|
+
/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */
|
|
26
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* Deploys a Vercel project via `vercel deploy --prod --yes` CLI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/vercel/deploy.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/vercel/deploy.ts"],"mappings":";;;;;;;KAMK,mBAAA,GAAsB,IAAA,CAC1B,MAAA,CAAO,wBAAA;uCAIP,QAAA,EAAU,cAAA;EALa;;;;EAWvB,OAAA,GAAU,aAAA;AAAA;;UAIM,gBAAA;EAfU;;;;EAoB1B,SAAA,GAAY,MAAA,CAAO,KAAA;EATnB;EAYA,YAAA;EAZuB;EAevB,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;AAAA;;;;;;;;;;;;;;;;;;AAAK;cAqBvB,YAAA,SAAqB,MAAA,CAAO,iBAAA;cAEvC,IAAA,UACA,IAAA,EAAM,gBAAA,EACN,IAAA,EAAM,mBAAA;AAAA"}
|
package/dist/vercel/deploy.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { t as __name } from "../chunk-OPjESj5l.mjs";
|
|
2
|
-
import { hashDirectory } from "../hash.mjs";
|
|
3
|
-
import * as path from "node:path";
|
|
4
2
|
import * as command from "@pulumi/command";
|
|
5
3
|
import * as pulumi from "@pulumi/pulumi";
|
|
6
4
|
|
|
@@ -29,25 +27,16 @@ var VercelDeploy = class extends pulumi.ComponentResource {
|
|
|
29
27
|
super("infracraft:vercel:Deploy", name, {}, pulumiOpts);
|
|
30
28
|
const projectId = project ? project.id : args.projectId;
|
|
31
29
|
if (!projectId) throw new Error("VercelDeploy: either `args.projectId` or `opts.project` must be provided");
|
|
32
|
-
const hashParts = [hashDirectory(path.join(args.monorepoRoot, args.rootDirectory))];
|
|
33
|
-
for (const dir of args.additionalSourceDirs ?? []) hashParts.push(hashDirectory(path.join(args.monorepoRoot, dir)));
|
|
34
|
-
const sourceHash = hashParts.join(",");
|
|
35
|
-
const commandOpts = { parent: this };
|
|
36
|
-
if (args.dependsOn && args.dependsOn.length > 0) commandOpts.dependsOn = args.dependsOn;
|
|
37
|
-
const envHash = pulumi.all(Object.entries(args.env).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => pulumi.output(v).apply((val) => `${k}=${val}`))).apply((parts) => parts.join(","));
|
|
38
30
|
new command.local.Command(`${name}-deploy`, {
|
|
39
31
|
create: "vercel deploy --prod --yes",
|
|
40
|
-
triggers:
|
|
32
|
+
triggers: args.triggers,
|
|
41
33
|
dir: args.monorepoRoot,
|
|
42
34
|
environment: {
|
|
43
35
|
VERCEL_TOKEN: provider.token,
|
|
44
36
|
VERCEL_ORG_ID: provider.teamId,
|
|
45
37
|
VERCEL_PROJECT_ID: projectId
|
|
46
38
|
}
|
|
47
|
-
}, {
|
|
48
|
-
parent: this,
|
|
49
|
-
...commandOpts.dependsOn ? { dependsOn: commandOpts.dependsOn } : {}
|
|
50
|
-
});
|
|
39
|
+
}, { parent: this });
|
|
51
40
|
this.registerOutputs({});
|
|
52
41
|
}
|
|
53
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/vercel/deploy.ts"],"sourcesContent":["import * as
|
|
1
|
+
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/vercel/deploy.ts"],"sourcesContent":["import * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport type { VercelProject } from \"./project.js\";\nimport type { VercelProvider } from \"./provider.js\";\n\n/** Options type for VercelDeploy — replaces Pulumi's native `provider` field. */\ntype VercelDeployOptions = Omit<\n\tpulumi.ComponentResourceOptions,\n\t\"provider\"\n> & {\n\t/** Vercel authentication context. */\n\tprovider: VercelProvider;\n\n\t/**\n\t * VercelProject resource to source the project ID from.\n\t * When provided, `args.projectId` is optional and ignored if both are given.\n\t */\n\tproject?: VercelProject;\n};\n\n/** Args for VercelDeploy. */\nexport interface VercelDeployArgs {\n\t/**\n\t * Vercel project ID.\n\t * Required when `opts.project` is not provided.\n\t */\n\tprojectId?: pulumi.Input<string>;\n\n\t/** Absolute path to the monorepo root (working directory for `vercel deploy`). */\n\tmonorepoRoot: string;\n\n\t/** Values that trigger a redeploy when changed (e.g. source hashes, env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n}\n\n/**\n * Deploys a Vercel project via `vercel deploy --prod --yes` CLI.\n *\n * Triggers on source hash (computed from the app directory) and env content hash\n * (from `VercelVariable.contentHash`). When an env value changes — whether from\n * code, a new mesh URL, or a drift fix after `pulumi refresh` — the hash changes\n * and a redeploy is triggered.\n *\n * @example\n * ```typescript\n * new VercelDeploy(\"nexus-deploy\", {\n * projectId: vercelProject.id,\n * rootDirectory: \"apps/nexus\",\n * monorepoRoot,\n * env: { NEXT_PUBLIC_API_URL: meshUrl },\n * }, { provider });\n * ```\n */\nexport class VercelDeploy extends pulumi.ComponentResource {\n\tconstructor(\n\t\tname: string,\n\t\targs: VercelDeployArgs,\n\t\topts: VercelDeployOptions,\n\t) {\n\t\tconst { provider, project, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:vercel:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst projectId = project\n\t\t\t? project.id\n\t\t\t: (args.projectId as pulumi.Input<string>);\n\n\t\tif (!projectId) {\n\t\t\tthrow new Error(\n\t\t\t\t\"VercelDeploy: either `args.projectId` or `opts.project` must be provided\",\n\t\t\t);\n\t\t}\n\n\t\tnew command.local.Command(\n\t\t\t`${name}-deploy`,\n\t\t\t{\n\t\t\t\tcreate: \"vercel deploy --prod --yes\",\n\t\t\t\ttriggers: args.triggers,\n\t\t\t\tdir: args.monorepoRoot,\n\t\t\t\tenvironment: {\n\t\t\t\t\tVERCEL_TOKEN: provider.token,\n\t\t\t\t\tVERCEL_ORG_ID: provider.teamId,\n\t\t\t\t\tVERCEL_PROJECT_ID: projectId,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ parent: this },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAa,eAAb,cAAkC,OAAO,kBAAkB;CAC1D,YACC,MACA,MACA,MACC;EACD,MAAM,EAAE,UAAU,SAAS,GAAG,eAAe;EAE7C,MAAM,4BAA4B,MAAM,CAAC,GAAG,UAAU;EAEtD,MAAM,YAAY,UACf,QAAQ,KACP,KAAK;EAET,IAAI,CAAC,WACJ,MAAM,IAAI,MACT,0EACD;EAGD,IAAI,QAAQ,MAAM,QACjB,GAAG,KAAK,UACR;GACC,QAAQ;GACR,UAAU,KAAK;GACf,KAAK,KAAK;GACV,aAAa;IACZ,cAAc,SAAS;IACvB,eAAe,SAAS;IACxB,mBAAmB;GACpB;EACD,GACA,EAAE,QAAQ,KAAK,CAChB;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|