@continuous-excellence/ze-great-dashboard-aws 0.20.0 → 0.22.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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Ze Great Dashboard on AWS
2
2
 
3
3
  `@continuous-excellence/ze-great-dashboard-aws` packages a board for a private AWS Lambda or ECS
4
- deployment. It includes the Lambda runtime, matching browser client, deployment CLI, and
5
- CloudFormation templates.
4
+ deployment. It includes the Lambda runtime, deployment CLI, and CloudFormation templates; browser
5
+ assets are published separately as `@continuous-excellence/ze-great-dashboard-client`.
6
6
 
7
7
  Deployment mode is persisted in `dashboard-bootstrap.json` and generated application parameters
8
8
  as `ComputeMode`. Existing files without that field mean `lambda`. Choose `--mode ecs` during
@@ -95,7 +95,7 @@ Changing `board.yaml` or upgrading the pinned package uses this same path.
95
95
  | The package owns | You own |
96
96
  | --- | --- |
97
97
  | Board validation and Lambda packaging | Board content and source access |
98
- | Compatible immutable browser assets | The protected gateway and authentication |
98
+ | Server runtime and CloudFormation templates | The immutable browser asset host and authentication |
99
99
  | Private application CloudFormation template | AWS account administration |
100
100
  | Restricted bootstrap templates | Secret values and the credential-map ARN |
101
101
  | Read-only preflight and consistency checks | Reviewing and executing AWS changes |
package/dist/cli.js CHANGED
@@ -1,16 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // packages/aws/src/cli.ts
4
- import { execFile as execFile3 } from "node:child_process";
4
+ import { execFile as execFile2 } from "node:child_process";
5
5
  import { readFile as readFile6, writeFile as writeFile4 } from "node:fs/promises";
6
- import { fileURLToPath as fileURLToPath3 } from "node:url";
7
- import { promisify as promisify3 } from "node:util";
6
+ import { promisify as promisify2 } from "node:util";
8
7
  import { parse as parse3 } from "yaml";
9
8
 
10
9
  // packages/aws/src/doctor.ts
11
- import { execFile as execFile2 } from "node:child_process";
10
+ import { execFile } from "node:child_process";
12
11
  import { readFile as readFile5 } from "node:fs/promises";
13
- import { promisify as promisify2 } from "node:util";
12
+ import { promisify } from "node:util";
14
13
  import { parse as parse2 } from "yaml";
15
14
 
16
15
  // packages/aws/src/bootstrap.ts
@@ -911,11 +910,9 @@ function requiredBootstrapParameters(kind, values) {
911
910
  }
912
911
 
913
912
  // packages/aws/src/index.ts
914
- import { execFile } from "node:child_process";
915
913
  import { cp, mkdir as mkdir2, readFile as readFile4, rm, writeFile as writeFile3 } from "node:fs/promises";
916
914
  import { join as join2, resolve as resolve2 } from "node:path";
917
915
  import { fileURLToPath as fileURLToPath2 } from "node:url";
918
- import { promisify } from "node:util";
919
916
 
920
917
  // node_modules/fflate/esm/index.mjs
921
918
  import { createRequire } from "module";
@@ -2725,7 +2722,6 @@ async function bootstrapGuideReport(input) {
2725
2722
  }
2726
2723
 
2727
2724
  // packages/aws/src/index.ts
2728
- var run = promisify(execFile);
2729
2725
  function requireImageDigest(image) {
2730
2726
  if (!/^[^\s@]+@sha256:[a-f0-9]{64}$/.test(image))
2731
2727
  throw new Error(
@@ -2865,30 +2861,6 @@ async function packageEcs(options) {
2865
2861
  );
2866
2862
  return packagedRelease;
2867
2863
  }
2868
- async function publishClientAssets(options) {
2869
- const assetsDir = resolve2(options.assetsDir);
2870
- await readFile4(join2(assetsDir, "index.html"));
2871
- const assetPath = `${options.assetsBaseUrl.replace(/\/+$/, "")}/dashboard/${options.version}`;
2872
- await run("aws", [
2873
- "s3",
2874
- "sync",
2875
- assetsDir,
2876
- `s3://${options.assetsBucket}/dashboard/${options.version}/`,
2877
- "--exclude",
2878
- "index.html",
2879
- "--cache-control",
2880
- "public, max-age=31536000, immutable"
2881
- ]);
2882
- await run("aws", [
2883
- "s3",
2884
- "cp",
2885
- join2(assetsDir, "index.html"),
2886
- `s3://${options.assetsBucket}/dashboard/${options.version}/index.html`,
2887
- "--cache-control",
2888
- "public, max-age=60"
2889
- ]);
2890
- return assetPath;
2891
- }
2892
2864
  async function cloudFormationTemplate(mode = "lambda") {
2893
2865
  return readFile4(
2894
2866
  fileURLToPath2(
@@ -2899,10 +2871,10 @@ async function cloudFormationTemplate(mode = "lambda") {
2899
2871
  }
2900
2872
 
2901
2873
  // packages/aws/src/doctor.ts
2902
- var run2 = promisify2(execFile2);
2874
+ var run = promisify(execFile);
2903
2875
  var actualDependencies = {
2904
2876
  async execute(command, args2) {
2905
- return (await run2(command, args2)).stdout.trim();
2877
+ return (await run(command, args2)).stdout.trim();
2906
2878
  },
2907
2879
  async fetch(url) {
2908
2880
  return fetch(url);
@@ -3066,7 +3038,7 @@ async function runDoctor(options, dependencies = actualDependencies) {
3066
3038
 
3067
3039
  // packages/aws/src/cli.ts
3068
3040
  var args = process.argv.slice(2);
3069
- var runCommand = promisify3(execFile3);
3041
+ var runCommand = promisify2(execFile2);
3070
3042
  var option = (name, fallback) => {
3071
3043
  const i2 = args.indexOf(name);
3072
3044
  return i2 >= 0 ? args[i2 + 1] : fallback;
@@ -3291,17 +3263,7 @@ function copyableCommand(command) {
3291
3263
  }
3292
3264
  try {
3293
3265
  const packageVersion2 = await installedPackageVersion();
3294
- const bundledAssets = fileURLToPath3(new URL("../client", import.meta.url));
3295
- if (args[0] === "publish-assets") {
3296
- const version = requiredOption("--version", packageVersion2);
3297
- const assetPath = await publishClientAssets({
3298
- assetsDir: option("--assets-dir", bundledAssets) ?? bundledAssets,
3299
- assetsBucket: requiredOption("--assets-bucket"),
3300
- assetsBaseUrl: requiredOption("--assets-base-url"),
3301
- version
3302
- });
3303
- console.log(JSON.stringify({ published: true, version, assetPath }));
3304
- } else if (args[0] === "doctor") {
3266
+ if (args[0] === "doctor") {
3305
3267
  const parametersPath = option("--parameters", "aws-dashboard-parameters.json") ?? "aws-dashboard-parameters.json";
3306
3268
  const region2 = option("--region", process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? "us-east-1") ?? "us-east-1";
3307
3269
  const checks = await runDoctor(
@@ -3652,9 +3614,7 @@ ${shellCommand(awsCommand)}`,
3652
3614
  }
3653
3615
  }
3654
3616
  } else if (args[0] !== "package")
3655
- throw new Error(
3656
- "Usage: ze-great-dashboard-aws package|parameters|bootstrap|publish-assets|doctor [options]"
3657
- );
3617
+ throw new Error("Usage: ze-great-dashboard-aws package|parameters|bootstrap|doctor [options]");
3658
3618
  else {
3659
3619
  const boardConfig = option("--board-config");
3660
3620
  const version = option("--version", process.env.DASHBOARD_VERSION ?? packageVersion2);
package/dist/index.d.ts CHANGED
@@ -36,12 +36,4 @@ export type EcsPackageOptions = Omit<LambdaPackageOptions, 'secretReference'> &
36
36
  export declare function packageLambda(options: LambdaPackageOptions): Promise<PackagedRelease>;
37
37
  /** Packages the published container reference and ECS CloudFormation handoff. */
38
38
  export declare function packageEcs(options: EcsPackageOptions): Promise<PackagedRelease>;
39
- export type PublishClientAssetsOptions = {
40
- assetsDir: string;
41
- assetsBucket: string;
42
- assetsBaseUrl: string;
43
- version: string;
44
- };
45
- /** Publishes the versioned client half of a provider-managed release. */
46
- export declare function publishClientAssets(options: PublishClientAssetsOptions): Promise<string>;
47
39
  export declare function cloudFormationTemplate(mode?: ComputeMode): Promise<string>;
package/dist/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  // packages/aws/src/index.ts
2
- import { execFile } from "node:child_process";
3
2
  import { cp, mkdir as mkdir2, readFile as readFile4, rm, writeFile as writeFile3 } from "node:fs/promises";
4
3
  import { join as join2, resolve as resolve2 } from "node:path";
5
4
  import { fileURLToPath as fileURLToPath2 } from "node:url";
6
- import { promisify } from "node:util";
7
5
 
8
6
  // node_modules/fflate/esm/index.mjs
9
7
  import { createRequire } from "module";
@@ -2713,7 +2711,6 @@ async function bootstrapGuide(input) {
2713
2711
  }
2714
2712
 
2715
2713
  // packages/aws/src/index.ts
2716
- var run = promisify(execFile);
2717
2714
  function requireImageDigest(image) {
2718
2715
  if (!/^[^\s@]+@sha256:[a-f0-9]{64}$/.test(image))
2719
2716
  throw new Error(
@@ -2853,30 +2850,6 @@ async function packageEcs(options) {
2853
2850
  );
2854
2851
  return packagedRelease;
2855
2852
  }
2856
- async function publishClientAssets(options) {
2857
- const assetsDir = resolve2(options.assetsDir);
2858
- await readFile4(join2(assetsDir, "index.html"));
2859
- const assetPath = `${options.assetsBaseUrl.replace(/\/+$/, "")}/dashboard/${options.version}`;
2860
- await run("aws", [
2861
- "s3",
2862
- "sync",
2863
- assetsDir,
2864
- `s3://${options.assetsBucket}/dashboard/${options.version}/`,
2865
- "--exclude",
2866
- "index.html",
2867
- "--cache-control",
2868
- "public, max-age=31536000, immutable"
2869
- ]);
2870
- await run("aws", [
2871
- "s3",
2872
- "cp",
2873
- join2(assetsDir, "index.html"),
2874
- `s3://${options.assetsBucket}/dashboard/${options.version}/index.html`,
2875
- "--cache-control",
2876
- "public, max-age=60"
2877
- ]);
2878
- return assetPath;
2879
- }
2880
2853
  async function cloudFormationTemplate(mode = "lambda") {
2881
2854
  return readFile4(
2882
2855
  fileURLToPath2(
@@ -2909,7 +2882,6 @@ export {
2909
2882
  mergeBootstrapParameters,
2910
2883
  packageEcs,
2911
2884
  packageLambda,
2912
- publishClientAssets,
2913
2885
  requireComputeMode,
2914
2886
  requiredBootstrapParameters,
2915
2887
  resolveComputeMode,