rastack 0.0.36 → 0.0.37
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/CHANGELOG.md +2 -0
- package/dist/deploy/config.d.ts +3 -6
- package/dist/deploy/config.js +13 -18
- package/package.json +1 -1
- package/src/deploy/config.ts +14 -18
- package/test/deploy.spec.ts +7 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.37](https://github.com/theserverkid/reactapistack/compare/v0.0.36...v0.0.37) (2026-07-11)
|
|
6
|
+
|
|
5
7
|
### [0.0.36](https://github.com/theserverkid/reactapistack/compare/v0.0.35...v0.0.36) (2026-07-11)
|
|
6
8
|
|
|
7
9
|
### [0.0.35](https://github.com/theserverkid/reactapistack/compare/v0.0.34...v0.0.35) (2026-07-11)
|
package/dist/deploy/config.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export interface DeployConfig {
|
|
|
64
64
|
resourcesDir: string;
|
|
65
65
|
/** Where `rastack compile` writes the manifest + OpenAPI. */
|
|
66
66
|
outDir: string;
|
|
67
|
-
/** Bootstrap templates bucket that hosts `app.yaml` (for
|
|
67
|
+
/** Bootstrap templates bucket that hosts `app.yaml` (recorded for reference). */
|
|
68
68
|
templatesBucket?: string;
|
|
69
69
|
/** Bootstrap artifacts bucket holding the Lambda placeholder bundle. */
|
|
70
70
|
artifactsBucket?: string;
|
|
@@ -115,8 +115,6 @@ export interface StackParameter {
|
|
|
115
115
|
* `ArtifactsBucket` (which has no template default) is included only when set.
|
|
116
116
|
*/
|
|
117
117
|
export declare function stackParameters(cfg: DeployConfig): StackParameter[];
|
|
118
|
-
/** The S3 URL app.yaml is launched from, when the templates bucket is known. */
|
|
119
|
-
export declare function templateUrl(cfg: DeployConfig): string | null;
|
|
120
118
|
/** The in-repo CloudFormation templates `rastack init` deploys from. */
|
|
121
119
|
export declare const APP_TEMPLATE_FILE = "deploy/cloudformation/app.yaml";
|
|
122
120
|
export declare const BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.yaml";
|
|
@@ -124,9 +122,8 @@ export declare const BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.
|
|
|
124
122
|
export declare function deployStackArgs(cfg: DeployConfig): string[];
|
|
125
123
|
/**
|
|
126
124
|
* The one-time `aws cloudformation deploy` command that creates the app's
|
|
127
|
-
* infrastructure (app.yaml)
|
|
128
|
-
*
|
|
129
|
-
* runs this for you; it is also printed by `--print` so it can be run by hand.
|
|
125
|
+
* infrastructure (app.yaml), from the in-repo template. `rastack init` runs this
|
|
126
|
+
* for you; it is also printed by `--print` so it can be run by hand.
|
|
130
127
|
*/
|
|
131
128
|
export declare function deployStackCommand(cfg: DeployConfig): string;
|
|
132
129
|
/**
|
package/dist/deploy/config.js
CHANGED
|
@@ -24,7 +24,6 @@ exports.validateConfig = validateConfig;
|
|
|
24
24
|
exports.mergeConfig = mergeConfig;
|
|
25
25
|
exports.parseGitHubRemote = parseGitHubRemote;
|
|
26
26
|
exports.stackParameters = stackParameters;
|
|
27
|
-
exports.templateUrl = templateUrl;
|
|
28
27
|
exports.deployStackArgs = deployStackArgs;
|
|
29
28
|
exports.deployStackCommand = deployStackCommand;
|
|
30
29
|
exports.bootstrapStackName = bootstrapStackName;
|
|
@@ -168,12 +167,6 @@ function stackParameters(cfg) {
|
|
|
168
167
|
params.push({ key: "ArtifactsBucket", value: cfg.artifactsBucket });
|
|
169
168
|
return params;
|
|
170
169
|
}
|
|
171
|
-
/** The S3 URL app.yaml is launched from, when the templates bucket is known. */
|
|
172
|
-
function templateUrl(cfg) {
|
|
173
|
-
if (!cfg.templatesBucket)
|
|
174
|
-
return null;
|
|
175
|
-
return `https://${cfg.templatesBucket}.s3.${cfg.region}.amazonaws.com/app.yaml`;
|
|
176
|
-
}
|
|
177
170
|
/** The in-repo CloudFormation templates `rastack init` deploys from. */
|
|
178
171
|
exports.APP_TEMPLATE_FILE = "deploy/cloudformation/app.yaml";
|
|
179
172
|
exports.BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.yaml";
|
|
@@ -181,15 +174,19 @@ exports.BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.yaml";
|
|
|
181
174
|
* The argv (after `aws`) for an `aws cloudformation deploy`. `init` feeds this to
|
|
182
175
|
* `execFileSync` (no shell), and the printed command string is just this joined
|
|
183
176
|
* with spaces — so what is shown is exactly what runs.
|
|
177
|
+
*
|
|
178
|
+
* Always `--template-file`: the high-level `aws cloudformation deploy` command
|
|
179
|
+
* accepts *only* a local template file. `--template-url` is exclusive to the
|
|
180
|
+
* low-level `create-stack`/`update-stack`/`create-change-set` commands, so
|
|
181
|
+
* pairing it with `deploy` fails with `the following arguments are required:
|
|
182
|
+
* --template-file`. `init` runs in the repo, where both templates are present.
|
|
184
183
|
*/
|
|
185
|
-
function cfnDeployArgs(
|
|
186
|
-
const t = template.url
|
|
187
|
-
? ["--template-url", template.url]
|
|
188
|
-
: ["--template-file", template.file];
|
|
184
|
+
function cfnDeployArgs(templateFile, stackName, region, params) {
|
|
189
185
|
return [
|
|
190
186
|
"cloudformation",
|
|
191
187
|
"deploy",
|
|
192
|
-
|
|
188
|
+
"--template-file",
|
|
189
|
+
templateFile,
|
|
193
190
|
"--stack-name",
|
|
194
191
|
stackName,
|
|
195
192
|
"--capabilities",
|
|
@@ -212,14 +209,12 @@ function awsCommand(args) {
|
|
|
212
209
|
}
|
|
213
210
|
/** The argv that creates the app's infrastructure (app.yaml). */
|
|
214
211
|
function deployStackArgs(cfg) {
|
|
215
|
-
|
|
216
|
-
return cfnDeployArgs(src ? { url: src } : { file: exports.APP_TEMPLATE_FILE }, cfg.stackName, cfg.region, stackParameters(cfg));
|
|
212
|
+
return cfnDeployArgs(exports.APP_TEMPLATE_FILE, cfg.stackName, cfg.region, stackParameters(cfg));
|
|
217
213
|
}
|
|
218
214
|
/**
|
|
219
215
|
* The one-time `aws cloudformation deploy` command that creates the app's
|
|
220
|
-
* infrastructure (app.yaml)
|
|
221
|
-
*
|
|
222
|
-
* runs this for you; it is also printed by `--print` so it can be run by hand.
|
|
216
|
+
* infrastructure (app.yaml), from the in-repo template. `rastack init` runs this
|
|
217
|
+
* for you; it is also printed by `--print` so it can be run by hand.
|
|
223
218
|
*/
|
|
224
219
|
function deployStackCommand(cfg) {
|
|
225
220
|
return awsCommand(deployStackArgs(cfg));
|
|
@@ -251,7 +246,7 @@ function bootstrapStackParameters(cfg, reuseOidc = false) {
|
|
|
251
246
|
}
|
|
252
247
|
/** The argv that creates the bootstrap stack (bootstrap.yaml). */
|
|
253
248
|
function bootstrapStackArgs(cfg, reuseOidc = false) {
|
|
254
|
-
return cfnDeployArgs(
|
|
249
|
+
return cfnDeployArgs(exports.BOOTSTRAP_TEMPLATE_FILE, bootstrapStackName(cfg), cfg.region, bootstrapStackParameters(cfg, reuseOidc));
|
|
255
250
|
}
|
|
256
251
|
/** The one-time `aws cloudformation deploy` command that creates the bootstrap stack. */
|
|
257
252
|
function bootstrapStackCommand(cfg, reuseOidc = false) {
|
package/package.json
CHANGED
package/src/deploy/config.ts
CHANGED
|
@@ -63,7 +63,7 @@ export interface DeployConfig {
|
|
|
63
63
|
resourcesDir: string;
|
|
64
64
|
/** Where `rastack compile` writes the manifest + OpenAPI. */
|
|
65
65
|
outDir: string;
|
|
66
|
-
/** Bootstrap templates bucket that hosts `app.yaml` (for
|
|
66
|
+
/** Bootstrap templates bucket that hosts `app.yaml` (recorded for reference). */
|
|
67
67
|
templatesBucket?: string;
|
|
68
68
|
/** Bootstrap artifacts bucket holding the Lambda placeholder bundle. */
|
|
69
69
|
artifactsBucket?: string;
|
|
@@ -246,12 +246,6 @@ export function stackParameters(cfg: DeployConfig): StackParameter[] {
|
|
|
246
246
|
return params;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
/** The S3 URL app.yaml is launched from, when the templates bucket is known. */
|
|
250
|
-
export function templateUrl(cfg: DeployConfig): string | null {
|
|
251
|
-
if (!cfg.templatesBucket) return null;
|
|
252
|
-
return `https://${cfg.templatesBucket}.s3.${cfg.region}.amazonaws.com/app.yaml`;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
249
|
/** The in-repo CloudFormation templates `rastack init` deploys from. */
|
|
256
250
|
export const APP_TEMPLATE_FILE = "deploy/cloudformation/app.yaml";
|
|
257
251
|
export const BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.yaml";
|
|
@@ -260,20 +254,24 @@ export const BOOTSTRAP_TEMPLATE_FILE = "deploy/cloudformation/bootstrap.yaml";
|
|
|
260
254
|
* The argv (after `aws`) for an `aws cloudformation deploy`. `init` feeds this to
|
|
261
255
|
* `execFileSync` (no shell), and the printed command string is just this joined
|
|
262
256
|
* with spaces — so what is shown is exactly what runs.
|
|
257
|
+
*
|
|
258
|
+
* Always `--template-file`: the high-level `aws cloudformation deploy` command
|
|
259
|
+
* accepts *only* a local template file. `--template-url` is exclusive to the
|
|
260
|
+
* low-level `create-stack`/`update-stack`/`create-change-set` commands, so
|
|
261
|
+
* pairing it with `deploy` fails with `the following arguments are required:
|
|
262
|
+
* --template-file`. `init` runs in the repo, where both templates are present.
|
|
263
263
|
*/
|
|
264
264
|
function cfnDeployArgs(
|
|
265
|
-
|
|
265
|
+
templateFile: string,
|
|
266
266
|
stackName: string,
|
|
267
267
|
region: string,
|
|
268
268
|
params: StackParameter[],
|
|
269
269
|
): string[] {
|
|
270
|
-
const t = template.url
|
|
271
|
-
? ["--template-url", template.url]
|
|
272
|
-
: ["--template-file", template.file!];
|
|
273
270
|
return [
|
|
274
271
|
"cloudformation",
|
|
275
272
|
"deploy",
|
|
276
|
-
|
|
273
|
+
"--template-file",
|
|
274
|
+
templateFile,
|
|
277
275
|
"--stack-name",
|
|
278
276
|
stackName,
|
|
279
277
|
"--capabilities",
|
|
@@ -298,9 +296,8 @@ function awsCommand(args: string[]): string {
|
|
|
298
296
|
|
|
299
297
|
/** The argv that creates the app's infrastructure (app.yaml). */
|
|
300
298
|
export function deployStackArgs(cfg: DeployConfig): string[] {
|
|
301
|
-
const src = templateUrl(cfg);
|
|
302
299
|
return cfnDeployArgs(
|
|
303
|
-
|
|
300
|
+
APP_TEMPLATE_FILE,
|
|
304
301
|
cfg.stackName,
|
|
305
302
|
cfg.region,
|
|
306
303
|
stackParameters(cfg),
|
|
@@ -309,9 +306,8 @@ export function deployStackArgs(cfg: DeployConfig): string[] {
|
|
|
309
306
|
|
|
310
307
|
/**
|
|
311
308
|
* The one-time `aws cloudformation deploy` command that creates the app's
|
|
312
|
-
* infrastructure (app.yaml)
|
|
313
|
-
*
|
|
314
|
-
* runs this for you; it is also printed by `--print` so it can be run by hand.
|
|
309
|
+
* infrastructure (app.yaml), from the in-repo template. `rastack init` runs this
|
|
310
|
+
* for you; it is also printed by `--print` so it can be run by hand.
|
|
315
311
|
*/
|
|
316
312
|
export function deployStackCommand(cfg: DeployConfig): string {
|
|
317
313
|
return awsCommand(deployStackArgs(cfg));
|
|
@@ -352,7 +348,7 @@ export function bootstrapStackArgs(
|
|
|
352
348
|
reuseOidc = false,
|
|
353
349
|
): string[] {
|
|
354
350
|
return cfnDeployArgs(
|
|
355
|
-
|
|
351
|
+
BOOTSTRAP_TEMPLATE_FILE,
|
|
356
352
|
bootstrapStackName(cfg),
|
|
357
353
|
cfg.region,
|
|
358
354
|
bootstrapStackParameters(cfg, reuseOidc),
|
package/test/deploy.spec.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
repoVariables,
|
|
20
20
|
scaffoldFiles,
|
|
21
21
|
stackParameters,
|
|
22
|
-
templateUrl,
|
|
23
22
|
validateConfig,
|
|
24
23
|
zipStore,
|
|
25
24
|
renderCiWorkflow,
|
|
@@ -187,25 +186,21 @@ describe("stack parameters + launch command", () => {
|
|
|
187
186
|
);
|
|
188
187
|
});
|
|
189
188
|
|
|
190
|
-
it("
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
);
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("launches by URL when hosted, else from the in-repo template", () => {
|
|
189
|
+
it("always launches from the in-repo --template-file (deploy takes no URL)", () => {
|
|
190
|
+
// `aws cloudformation deploy` accepts ONLY `--template-file`; `--template-url`
|
|
191
|
+
// is exclusive to create-stack/update-stack and makes deploy reject the
|
|
192
|
+
// command. Even with a known templates bucket, the local file is used.
|
|
198
193
|
const hosted = deployStackCommand(
|
|
199
194
|
base({ templatesBucket: "tpl", artifactsBucket: "art" }),
|
|
200
195
|
);
|
|
201
|
-
expect(hosted).toContain(
|
|
202
|
-
|
|
203
|
-
);
|
|
196
|
+
expect(hosted).toContain("--template-file deploy/cloudformation/app.yaml");
|
|
197
|
+
expect(hosted).not.toContain("--template-url");
|
|
204
198
|
expect(hosted).toContain("--stack-name rastack-airline");
|
|
205
199
|
expect(hosted).toContain("ArtifactsBucket=art");
|
|
206
200
|
|
|
207
201
|
const local = deployStackCommand(base());
|
|
208
202
|
expect(local).toContain("--template-file deploy/cloudformation/app.yaml");
|
|
203
|
+
expect(local).not.toContain("--template-url");
|
|
209
204
|
});
|
|
210
205
|
|
|
211
206
|
it("emits ONE line (PowerShell-safe — no backslash continuations)", () => {
|