@aws-blocks/core 0.1.1 → 0.1.3

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.
Files changed (44) hide show
  1. package/dist/cdk/blocks-backend.d.ts.map +1 -1
  2. package/dist/cdk/blocks-backend.js +6 -2
  3. package/dist/cdk/index.d.ts.map +1 -1
  4. package/dist/cdk/index.js +8 -3
  5. package/dist/index.cdk.d.ts +1 -1
  6. package/dist/index.cdk.d.ts.map +1 -1
  7. package/dist/index.cdk.js +1 -1
  8. package/dist/pipeline/index.d.ts +2 -3
  9. package/dist/pipeline/index.d.ts.map +1 -1
  10. package/dist/pipeline/index.js +1 -1
  11. package/dist/scripts/deploy.d.ts.map +1 -1
  12. package/dist/scripts/deploy.js +2 -1
  13. package/dist/scripts/destroy.js +2 -2
  14. package/dist/scripts/external-migrations-step.js +2 -2
  15. package/dist/scripts/run-command.d.ts +9 -0
  16. package/dist/scripts/run-command.d.ts.map +1 -0
  17. package/dist/scripts/run-command.js +27 -0
  18. package/dist/scripts/sandbox.d.ts.map +1 -1
  19. package/dist/scripts/sandbox.js +6 -5
  20. package/dist/version.d.ts +1 -1
  21. package/dist/version.js +1 -1
  22. package/package.json +4 -1
  23. package/src/cdk/blocks-backend.ts +6 -2
  24. package/src/cdk/index.ts +8 -3
  25. package/src/index.cdk.ts +1 -0
  26. package/src/pipeline/index.ts +7 -3
  27. package/src/scripts/deploy.ts +2 -1
  28. package/src/scripts/destroy.ts +2 -2
  29. package/src/scripts/external-migrations-step.ts +2 -2
  30. package/src/scripts/run-command.ts +45 -0
  31. package/src/scripts/sandbox.ts +6 -5
  32. package/src/version.ts +1 -1
  33. package/dist/pipeline/pipeline-construct.d.ts +0 -130
  34. package/dist/pipeline/pipeline-construct.d.ts.map +0 -1
  35. package/dist/pipeline/pipeline-construct.js +0 -484
  36. package/dist/pipeline/pipeline.test.d.ts +0 -2
  37. package/dist/pipeline/pipeline.test.d.ts.map +0 -1
  38. package/dist/pipeline/pipeline.test.js +0 -1231
  39. package/dist/pipeline/types.d.ts +0 -351
  40. package/dist/pipeline/types.d.ts.map +0 -1
  41. package/dist/pipeline/types.js +0 -3
  42. package/src/pipeline/pipeline-construct.ts +0 -662
  43. package/src/pipeline/pipeline.test.ts +0 -1565
  44. package/src/pipeline/types.ts +0 -384
@@ -1 +1 @@
1
- {"version":3,"file":"blocks-backend.d.ts","sourceRoot":"","sources":["../../src/cdk/blocks-backend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAOvC;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAkB/C;AAED,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,MAAM;;;;EA0GxF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5C,SAAgB,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC;IAC9D,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,MAAM,IAAI,MAAM,CAUnB;IAED,OAAO;WAmBM,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CAmB5E"}
1
+ {"version":3,"file":"blocks-backend.d.ts","sourceRoot":"","sources":["../../src/cdk/blocks-backend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQvC;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAkB/C;AAED,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,MAAM;;;;EA0GxF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5C,SAAgB,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC;IAC9D,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,MAAM,IAAI,MAAM,CAUnB;IAED,OAAO;WAmBM,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CAsB5E"}
@@ -5,6 +5,7 @@ import * as lambda from 'aws-cdk-lib/aws-lambda-nodejs';
5
5
  import * as apigateway from 'aws-cdk-lib/aws-apigateway';
6
6
  import { CfnGroup } from 'aws-cdk-lib/aws-resourcegroups';
7
7
  import { Construct } from 'constructs';
8
+ import { pathToFileURL } from 'node:url';
8
9
  import { DEFAULT_NODE_RUNTIME } from './node-version.js';
9
10
  import { addBlocksStackMetadata } from './stack-metadata.js';
10
11
  import { finalizeConfigRegistry, registerConfig } from './config-registry.js';
@@ -196,8 +197,11 @@ export class BlocksBackend extends Construct {
196
197
  static async create(scope, id, props) {
197
198
  assertCdkConditionActive();
198
199
  const backend = new BlocksBackend(scope, id, props);
199
- // ESM caches modules by URL append a unique query string so each stage re-executes the module body
200
- const mod = await import(`${props.backendCDKPath}?stack=${id}`);
200
+ // file:// URL (not a raw path) so the cache-busting query works on Windows,
201
+ // where an absolute path like `D:\...` is rejected as URL scheme `d:`.
202
+ const backendUrl = pathToFileURL(props.backendCDKPath);
203
+ backendUrl.searchParams.set('stack', id);
204
+ const mod = await import(backendUrl.href);
201
205
  if (typeof mod.default === 'function') {
202
206
  try {
203
207
  await mod.default(backend);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cdk/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,qBAAa,WAAY,SAAQ,GAAG,CAAC,KAAM,YAAW,eAAe;IACnE,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,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AAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAKnD,wBAAwB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI;IACzD,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI;IACtD,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IACrH,IAAI,gBAAgB,IAAI,SAAS,MAAM,EAAE,CAAe;IACxD,IAAI,cAAc,IAAI,SAAS,MAAM,EAAE,CAAe;CACvD"}
package/dist/cdk/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import * as cdk from 'aws-cdk-lib';
4
4
  import { Construct } from 'constructs';
5
+ import { pathToFileURL } from 'node:url';
6
+ import { __PIPELINE_STAGE_SCOPE__ } from '@aws-blocks/pipeline';
5
7
  import { computeScopeFullId, } from '../common/index.js';
6
8
  import { setupBlocksInfra, BlocksBackend, assertCdkConditionActive } from './blocks-backend.js';
7
9
  import { addBlocksStackMetadata } from './stack-metadata.js';
@@ -32,11 +34,14 @@ export class BlocksStack extends cdk.Stack {
32
34
  static async create(scope, id, props) {
33
35
  assertCdkConditionActive();
34
36
  // Detect ambient pipeline stage scope set by Pipeline appFile imports
35
- const pipelineScope = globalThis.__PIPELINE_STAGE_SCOPE__;
37
+ const pipelineScope = globalThis[__PIPELINE_STAGE_SCOPE__];
36
38
  const actualScope = pipelineScope || scope;
37
39
  const stack = new BlocksStack(actualScope, id, props);
38
- // ESM caches modules by URL append a unique query string so each stage re-executes the module body
39
- const mod = await import(`${props.backendCDKPath}?stack=${id}`);
40
+ // file:// URL (not a raw path) so the cache-busting query works on Windows,
41
+ // where an absolute path like `D:\...` is rejected as URL scheme `d:`.
42
+ const backendUrl = pathToFileURL(props.backendCDKPath);
43
+ backendUrl.searchParams.set('stack', id);
44
+ const mod = await import(backendUrl.href);
40
45
  if (typeof mod.default === 'function') {
41
46
  try {
42
47
  await mod.default(stack);
@@ -9,5 +9,5 @@ export { BlocksStack, Scope, SandboxDisableDeletionProtection, BlocksBackend, re
9
9
  export { Hosting, type HostingProps, type BlocksStackApi, type FrameworkType, type ComputeConfig, type HostingDomainConfig, type HostingWafConfig, } from './hosting.js';
10
10
  export { RawRoute, RawRouteErrors, type RawRouteOptions, type HttpMethod, } from './raw-route.cdk.js';
11
11
  export { registerRoute, matchRoute, getRegisteredRoutes, clearRouteRegistry, lockRouteRegistry, unlockRouteRegistry, type RegisteredRoute, } from './raw-route.js';
12
- export { Pipeline, DeployStage, type DeployStageProps, type BranchConfig, type PipelineProps, type PipelineSourceConfig, type PipelineSynthConfig, type PipelineStageConfig, } from './pipeline/index.js';
12
+ export { Pipeline, DeployStage, __PIPELINE_STAGE_SCOPE__, type DeployStageProps, type BranchConfig, type PipelineProps, type PipelineSourceConfig, type PipelineSynthConfig, type PipelineStageConfig, } from './pipeline/index.js';
13
13
  //# sourceMappingURL=index.cdk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cdk.d.ts","sourceRoot":"","sources":["../src/index.cdk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC9H,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,sBAAsB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iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC9H,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxH,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,gCAAgC,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACxM,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC"}
package/dist/index.cdk.js CHANGED
@@ -10,4 +10,4 @@ export { BlocksStack, Scope, SandboxDisableDeletionProtection, BlocksBackend, re
10
10
  export { Hosting, } from './hosting.js';
11
11
  export { RawRoute, RawRouteErrors, } from './raw-route.cdk.js';
12
12
  export { registerRoute, matchRoute, getRegisteredRoutes, clearRouteRegistry, lockRouteRegistry, unlockRouteRegistry, } from './raw-route.js';
13
- export { Pipeline, DeployStage, } from './pipeline/index.js';
13
+ export { Pipeline, DeployStage, __PIPELINE_STAGE_SCOPE__, } from './pipeline/index.js';
@@ -1,4 +1,3 @@
1
- export { Pipeline, DeployStage } from './pipeline-construct.js';
2
- export type { DeployStageProps } from './pipeline-construct.js';
3
- export type { BranchConfig, PipelineProps, PipelineSourceConfig, PipelineSynthConfig, PipelineStageConfig, } from './types.js';
1
+ export { Pipeline, DeployStage, __PIPELINE_STAGE_SCOPE__, } from '@aws-blocks/pipeline';
2
+ export type { DeployStageProps, BranchConfig, PipelineProps, PipelineSourceConfig, PipelineSynthConfig, PipelineStageConfig, } from '@aws-blocks/pipeline';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { Pipeline, DeployStage } from './pipeline-construct.js';
3
+ export { Pipeline, DeployStage, __PIPELINE_STAGE_SCOPE__, } from '@aws-blocks/pipeline';
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/scripts/deploy.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,iBAwFlD"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/scripts/deploy.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,iBAwFlD"}
@@ -8,6 +8,7 @@ import { ensureSecrets, loadProductionEnv } from './ensure-secrets.js';
8
8
  import { applyExternalMigrations } from './external-migrations-step.js';
9
9
  import { trackCommand } from '../telemetry/trackCommand.js';
10
10
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
11
+ import { runSync } from './run-command.js';
11
12
  export async function deploy(options) {
12
13
  return trackCommand('deploy', async () => {
13
14
  console.log('🏗️ Preparing deployment...');
@@ -42,7 +43,7 @@ export async function deploy(options) {
42
43
  console.log(' - Backend API (Lambda + API Gateway)');
43
44
  console.log(' - Frontend hosting (S3 + CloudFront)');
44
45
  try {
45
- execFileSync("npx", [
46
+ runSync("npx", [
46
47
  "cdk", "deploy",
47
48
  "--require-approval", "never",
48
49
  "--outputs-file", ".blocks-sandbox/outputs.json",
@@ -1,13 +1,13 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { execFileSync } from 'node:child_process';
4
3
  import { trackCommand } from '../telemetry/trackCommand.js';
5
4
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
5
+ import { runSync } from './run-command.js';
6
6
  export async function destroy(options) {
7
7
  return trackCommand('destroy', async () => {
8
8
  console.log('🗑️ Destroying production stack...');
9
9
  try {
10
- execFileSync("npx", [
10
+ runSync("npx", [
11
11
  "cdk", "destroy",
12
12
  "--force",
13
13
  "--context", `projectRoot=${options.projectRoot}`,
@@ -22,10 +22,10 @@
22
22
  * exists. Aurora-managed databases run migrations via their in-VPC Lambda, not
23
23
  * here.
24
24
  */
25
- import { execFileSync } from 'node:child_process';
26
25
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
27
26
  import { findConnectionString } from './ensure-secrets.js';
28
27
  import { extractDbRef, dbConnectionParameterName } from '../db-naming.js';
28
+ import { runSync } from './run-command.js';
29
29
  const DEFAULT_MIGRATIONS_DIR = './migrations';
30
30
  /** Default output dir for db-pull generated files (database.types.ts / database.meta.ts). */
31
31
  const DEFAULT_GENERATED_DIR = './aws-blocks';
@@ -50,7 +50,7 @@ export function buildMigrateArgs(stage, migrationsDir, regenerateTypesDir) {
50
50
  return args;
51
51
  }
52
52
  function runMigrateSubprocess(connValue, stage, migrationsDir, regenerateTypesDir) {
53
- execFileSync('npx', buildMigrateArgs(stage, migrationsDir, regenerateTypesDir), {
53
+ runSync('npx', buildMigrateArgs(stage, migrationsDir, regenerateTypesDir), {
54
54
  stdio: 'inherit',
55
55
  env: { ...process.env, BLOCKS_MIGRATE_URL: connValue },
56
56
  });
@@ -0,0 +1,9 @@
1
+ import type { ChildProcess, SpawnOptions, SpawnSyncOptions } from 'node:child_process';
2
+ /**
3
+ * Run a command to completion (stdio inherited) and throw on failure — a
4
+ * cross-platform drop-in for `execFileSync` where only success/failure matters.
5
+ */
6
+ export declare function runSync(command: string, args: string[], options?: SpawnSyncOptions): void;
7
+ /** Spawn a long-running command and return the `ChildProcess` (e.g. `cdk watch`). */
8
+ export declare function spawnCommand(command: string, args: string[], options: SpawnOptions): ChildProcess;
9
+ //# sourceMappingURL=run-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../src/scripts/run-command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAQ5B;;;GAGG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,gBAAqB,GAC7B,IAAI,CAYN;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,YAAY,GACpB,YAAY,CAEd"}
@@ -0,0 +1,27 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import spawn from 'cross-spawn';
4
+ // `npm`/`npx`/`cdk`/`tsx` are `.cmd` shims on Windows, which Node's
5
+ // execFileSync/spawn can't resolve (spawnSync ENOENT) and won't run without a
6
+ // shell. cross-spawn resolves the shim and quotes args safely (array form, no
7
+ // shell injection), so these wrappers work on Windows too.
8
+ /**
9
+ * Run a command to completion (stdio inherited) and throw on failure — a
10
+ * cross-platform drop-in for `execFileSync` where only success/failure matters.
11
+ */
12
+ export function runSync(command, args, options = {}) {
13
+ const result = spawn.sync(command, args, { stdio: 'inherit', ...options });
14
+ if (result.error) {
15
+ throw result.error;
16
+ }
17
+ if (result.signal) {
18
+ throw new Error(`${command} was terminated by signal ${result.signal}`);
19
+ }
20
+ if (typeof result.status === 'number' && result.status !== 0) {
21
+ throw new Error(`${command} ${args.join(' ')} exited with code ${result.status}`);
22
+ }
23
+ }
24
+ /** Spawn a long-running command and return the `ChildProcess` (e.g. `cdk watch`). */
25
+ export function spawnCommand(command, args, options) {
26
+ return spawn(command, args, options);
27
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/scripts/sandbox.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,cAAc,+BAqJzD;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,iBAwCvD"}
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/scripts/sandbox.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,cAAc,+BAqJzD;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,iBAwCvD"}
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { execFileSync, spawn } from "node:child_process";
3
+ import { execFileSync } from "node:child_process";
4
4
  import { writeFileSync, mkdirSync, readFileSync } from "node:fs";
5
5
  import { join, resolve, dirname } from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -9,6 +9,7 @@ import { applyExternalMigrations } from './external-migrations-step.js';
9
9
  import { trackCommand } from '../telemetry/trackCommand.js';
10
10
  import { buildAndSendEvent } from '../telemetry/client.js';
11
11
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
12
+ import { runSync, spawnCommand } from './run-command.js';
12
13
  /**
13
14
  * Import the backend definition to populate the Scope BB registry.
14
15
  *
@@ -55,7 +56,7 @@ export async function startSandbox(options) {
55
56
  console.log("🚀 Deploying to AWS...");
56
57
  console.log(" (This may take a few minutes on first deploy)");
57
58
  try {
58
- execFileSync("npm", [
59
+ runSync("npm", [
59
60
  "exec", "cdk", "--", "deploy",
60
61
  "--require-approval", "never",
61
62
  "--outputs-file", `${outDir}/outputs.json`,
@@ -112,7 +113,7 @@ export async function startSandbox(options) {
112
113
  console.log("\n👀 Starting CDK watch mode...");
113
114
  console.log("🌐 Starting local dev server (proxying to AWS)...");
114
115
  console.log(`\n Open http://localhost:${clientPort}\n`);
115
- const cdkWatch = spawn("npx", [
116
+ const cdkWatch = spawnCommand("npx", [
116
117
  "cdk", "watch", "--hotswap",
117
118
  `--outputs-file`, `${outDir}/outputs.json`,
118
119
  `--context`, `projectRoot=${process.cwd()}`,
@@ -133,7 +134,7 @@ export async function startSandbox(options) {
133
134
  });
134
135
  const devServerCmd = devCommand || `npx tsx watch aws-blocks/scripts/server.ts`;
135
136
  const [cmd, ...args] = devServerCmd.split(' ');
136
- const devServer = spawn(cmd, args, {
137
+ const devServer = spawnCommand(cmd, args, {
137
138
  stdio: "inherit",
138
139
  shell: true,
139
140
  env: {
@@ -180,7 +181,7 @@ export async function destroySandbox(backendPath) {
180
181
  const retryDelays = [60_000, 120_000]; // 1min, then 2min
181
182
  for (let attempt = 0;; attempt++) {
182
183
  try {
183
- execFileSync("npm", cdkArgs, { stdio: "inherit", env: cdkEnv });
184
+ runSync("npm", cdkArgs, { stdio: "inherit", env: cdkEnv });
184
185
  console.log(attempt === 0 ? "\n✅ Sandbox destroyed!" : "\n✅ Sandbox destroyed on retry!");
185
186
  return;
186
187
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const CORE_VERSION = "0.1.1";
1
+ export declare const CORE_VERSION = "0.1.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by scripts/generate-version.mjs — do not edit manually
2
- export const CORE_VERSION = '0.1.1';
2
+ export const CORE_VERSION = '0.1.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-blocks/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "author": "Amazon Web Services",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -55,6 +55,7 @@
55
55
  "blocks-telemetry": "./dist/scripts/telemetry-cli.js"
56
56
  },
57
57
  "devDependencies": {
58
+ "@types/cross-spawn": "^6.0.6",
58
59
  "@types/http-proxy": "^1.17.16",
59
60
  "@types/node": "^20.0.0",
60
61
  "typescript": "^5.3.0",
@@ -62,8 +63,10 @@
62
63
  },
63
64
  "dependencies": {
64
65
  "@aws-blocks/hosting": "*",
66
+ "@aws-blocks/pipeline": "*",
65
67
  "@aws-sdk/client-s3": "^3.700.0",
66
68
  "@aws-sdk/client-ssm": "^3.700.0",
69
+ "cross-spawn": "^7.0.6",
67
70
  "http-proxy": "^1.18.1"
68
71
  },
69
72
  "peerDependencies": {
@@ -6,6 +6,7 @@ import * as lambda from 'aws-cdk-lib/aws-lambda-nodejs';
6
6
  import * as apigateway from 'aws-cdk-lib/aws-apigateway';
7
7
  import { CfnGroup } from 'aws-cdk-lib/aws-resourcegroups';
8
8
  import { Construct } from 'constructs';
9
+ import { pathToFileURL } from 'node:url';
9
10
  import { DEFAULT_NODE_RUNTIME } from './node-version.js';
10
11
  import { addBlocksStackMetadata } from './stack-metadata.js';
11
12
  import { finalizeConfigRegistry, registerConfig } from './config-registry.js';
@@ -230,8 +231,11 @@ export class BlocksBackend extends Construct {
230
231
  static async create(scope: Construct, id: string, props: BlocksBackendProps) {
231
232
  assertCdkConditionActive();
232
233
  const backend = new BlocksBackend(scope, id, props);
233
- // ESM caches modules by URL append a unique query string so each stage re-executes the module body
234
- const mod = await import(`${props.backendCDKPath}?stack=${id}`);
234
+ // file:// URL (not a raw path) so the cache-busting query works on Windows,
235
+ // where an absolute path like `D:\...` is rejected as URL scheme `d:`.
236
+ const backendUrl = pathToFileURL(props.backendCDKPath);
237
+ backendUrl.searchParams.set('stack', id);
238
+ const mod = await import(backendUrl.href);
235
239
  if (typeof mod.default === 'function') {
236
240
  try {
237
241
  await mod.default(backend);
package/src/cdk/index.ts CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
  import * as cdk from 'aws-cdk-lib';
5
5
  import { Construct } from 'constructs';
6
+ import { pathToFileURL } from 'node:url';
7
+ import { __PIPELINE_STAGE_SCOPE__ } from '@aws-blocks/pipeline';
6
8
  import {
7
9
  type BlocksStackProps,
8
10
  type BlocksStack as BaseBlocksStack,
@@ -47,12 +49,15 @@ export class BlocksStack extends cdk.Stack implements BaseBlocksStack {
47
49
  assertCdkConditionActive();
48
50
 
49
51
  // Detect ambient pipeline stage scope set by Pipeline appFile imports
50
- const pipelineScope = (globalThis as any).__PIPELINE_STAGE_SCOPE__;
52
+ const pipelineScope = (globalThis as any)[__PIPELINE_STAGE_SCOPE__];
51
53
  const actualScope = pipelineScope || scope;
52
54
 
53
55
  const stack = new BlocksStack(actualScope, id, props);
54
- // ESM caches modules by URL append a unique query string so each stage re-executes the module body
55
- const mod = await import(`${props.backendCDKPath}?stack=${id}`);
56
+ // file:// URL (not a raw path) so the cache-busting query works on Windows,
57
+ // where an absolute path like `D:\...` is rejected as URL scheme `d:`.
58
+ const backendUrl = pathToFileURL(props.backendCDKPath);
59
+ backendUrl.searchParams.set('stack', id);
60
+ const mod = await import(backendUrl.href);
56
61
  if (typeof mod.default === 'function') {
57
62
  try {
58
63
  await mod.default(stack);
package/src/index.cdk.ts CHANGED
@@ -36,6 +36,7 @@ export {
36
36
  export {
37
37
  Pipeline,
38
38
  DeployStage,
39
+ __PIPELINE_STAGE_SCOPE__,
39
40
  type DeployStageProps,
40
41
  type BranchConfig,
41
42
  type PipelineProps,
@@ -1,12 +1,16 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export { Pipeline, DeployStage } from './pipeline-construct.js';
5
- export type { DeployStageProps } from './pipeline-construct.js';
4
+ export {
5
+ Pipeline,
6
+ DeployStage,
7
+ __PIPELINE_STAGE_SCOPE__,
8
+ } from '@aws-blocks/pipeline';
6
9
  export type {
10
+ DeployStageProps,
7
11
  BranchConfig,
8
12
  PipelineProps,
9
13
  PipelineSourceConfig,
10
14
  PipelineSynthConfig,
11
15
  PipelineStageConfig,
12
- } from './types.js';
16
+ } from '@aws-blocks/pipeline';
@@ -9,6 +9,7 @@ import { ensureSecrets, loadProductionEnv } from './ensure-secrets.js';
9
9
  import { applyExternalMigrations } from './external-migrations-step.js';
10
10
  import { trackCommand } from '../telemetry/trackCommand.js';
11
11
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
12
+ import { runSync } from './run-command.js';
12
13
 
13
14
  export interface DeployOptions {
14
15
  cdkAppPath: string;
@@ -56,7 +57,7 @@ export async function deploy(options: DeployOptions) {
56
57
  console.log(' - Frontend hosting (S3 + CloudFront)');
57
58
 
58
59
  try {
59
- execFileSync(
60
+ runSync(
60
61
  "npx",
61
62
  [
62
63
  "cdk", "deploy",
@@ -1,9 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { execFileSync } from 'node:child_process';
5
4
  import { trackCommand } from '../telemetry/trackCommand.js';
6
5
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
6
+ import { runSync } from './run-command.js';
7
7
 
8
8
  export interface DestroyOptions {
9
9
  cdkAppPath: string;
@@ -15,7 +15,7 @@ export async function destroy(options: DestroyOptions) {
15
15
  console.log('🗑️ Destroying production stack...');
16
16
 
17
17
  try {
18
- execFileSync(
18
+ runSync(
19
19
  "npx",
20
20
  [
21
21
  "cdk", "destroy",
@@ -24,10 +24,10 @@
24
24
  * here.
25
25
  */
26
26
 
27
- import { execFileSync } from 'node:child_process';
28
27
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
29
28
  import { findConnectionString } from './ensure-secrets.js';
30
29
  import { extractDbRef, dbConnectionParameterName } from '../db-naming.js';
30
+ import { runSync } from './run-command.js';
31
31
 
32
32
  const DEFAULT_MIGRATIONS_DIR = './migrations';
33
33
  /** Default output dir for db-pull generated files (database.types.ts / database.meta.ts). */
@@ -59,7 +59,7 @@ function runMigrateSubprocess(
59
59
  migrationsDir: string,
60
60
  regenerateTypesDir?: string,
61
61
  ): void {
62
- execFileSync('npx', buildMigrateArgs(stage, migrationsDir, regenerateTypesDir), {
62
+ runSync('npx', buildMigrateArgs(stage, migrationsDir, regenerateTypesDir), {
63
63
  stdio: 'inherit',
64
64
  env: { ...process.env, BLOCKS_MIGRATE_URL: connValue },
65
65
  });
@@ -0,0 +1,45 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type {
5
+ ChildProcess,
6
+ SpawnOptions,
7
+ SpawnSyncOptions,
8
+ } from 'node:child_process';
9
+ import spawn from 'cross-spawn';
10
+
11
+ // `npm`/`npx`/`cdk`/`tsx` are `.cmd` shims on Windows, which Node's
12
+ // execFileSync/spawn can't resolve (spawnSync ENOENT) and won't run without a
13
+ // shell. cross-spawn resolves the shim and quotes args safely (array form, no
14
+ // shell injection), so these wrappers work on Windows too.
15
+
16
+ /**
17
+ * Run a command to completion (stdio inherited) and throw on failure — a
18
+ * cross-platform drop-in for `execFileSync` where only success/failure matters.
19
+ */
20
+ export function runSync(
21
+ command: string,
22
+ args: string[],
23
+ options: SpawnSyncOptions = {},
24
+ ): void {
25
+ const result = spawn.sync(command, args, { stdio: 'inherit', ...options });
26
+
27
+ if (result.error) {
28
+ throw result.error;
29
+ }
30
+ if (result.signal) {
31
+ throw new Error(`${command} was terminated by signal ${result.signal}`);
32
+ }
33
+ if (typeof result.status === 'number' && result.status !== 0) {
34
+ throw new Error(`${command} ${args.join(' ')} exited with code ${result.status}`);
35
+ }
36
+ }
37
+
38
+ /** Spawn a long-running command and return the `ChildProcess` (e.g. `cdk watch`). */
39
+ export function spawnCommand(
40
+ command: string,
41
+ args: string[],
42
+ options: SpawnOptions,
43
+ ): ChildProcess {
44
+ return spawn(command, args, options);
45
+ }
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { execFileSync, spawn } from "node:child_process";
4
+ import { execFileSync } from "node:child_process";
5
5
  import { writeFileSync, mkdirSync, readFileSync } from "node:fs";
6
6
  import { join, resolve, dirname } from "node:path";
7
7
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -10,6 +10,7 @@ import { applyExternalMigrations } from './external-migrations-step.js';
10
10
  import { trackCommand } from '../telemetry/trackCommand.js';
11
11
  import { buildAndSendEvent } from '../telemetry/client.js';
12
12
  import { getCdkTelemetryEnv } from './cdk-telemetry-env.js';
13
+ import { runSync, spawnCommand } from './run-command.js';
13
14
 
14
15
  /**
15
16
  * Import the backend definition to populate the Scope BB registry.
@@ -69,7 +70,7 @@ export async function startSandbox(options: SandboxOptions) {
69
70
  console.log(" (This may take a few minutes on first deploy)");
70
71
 
71
72
  try {
72
- execFileSync(
73
+ runSync(
73
74
  "npm",
74
75
  [
75
76
  "exec", "cdk", "--", "deploy",
@@ -138,7 +139,7 @@ export async function startSandbox(options: SandboxOptions) {
138
139
  console.log("🌐 Starting local dev server (proxying to AWS)...");
139
140
  console.log(`\n Open http://localhost:${clientPort}\n`);
140
141
 
141
- const cdkWatch = spawn("npx", [
142
+ const cdkWatch = spawnCommand("npx", [
142
143
  "cdk", "watch", "--hotswap",
143
144
  `--outputs-file`, `${outDir}/outputs.json`,
144
145
  `--context`, `projectRoot=${process.cwd()}`,
@@ -162,7 +163,7 @@ export async function startSandbox(options: SandboxOptions) {
162
163
  const devServerCmd = devCommand || `npx tsx watch aws-blocks/scripts/server.ts`;
163
164
  const [cmd, ...args] = devServerCmd.split(' ');
164
165
 
165
- const devServer = spawn(cmd, args, {
166
+ const devServer = spawnCommand(cmd, args, {
166
167
  stdio: "inherit",
167
168
  shell: true,
168
169
  env: {
@@ -212,7 +213,7 @@ export async function destroySandbox(backendPath: string) {
212
213
 
213
214
  for (let attempt = 0; ; attempt++) {
214
215
  try {
215
- execFileSync("npm", cdkArgs, { stdio: "inherit", env: cdkEnv });
216
+ runSync("npm", cdkArgs, { stdio: "inherit", env: cdkEnv });
216
217
  console.log(attempt === 0 ? "\n✅ Sandbox destroyed!" : "\n✅ Sandbox destroyed on retry!");
217
218
  return;
218
219
  } catch (error) {
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by scripts/generate-version.mjs — do not edit manually
2
- export const CORE_VERSION = '0.1.1';
2
+ export const CORE_VERSION = '0.1.3';