@byaga/cdk-patterns 0.11.3 → 0.11.5

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.
@@ -154,6 +154,5 @@ export class StaticWebSite {
154
154
  ]
155
155
  }
156
156
  }]
157
- }
158
- }
157
+ } }
159
158
  }
@@ -8,6 +8,8 @@ const child_process_1 = require("child_process");
8
8
  const duration_1 = __importDefault(require("../../tools/duration"));
9
9
  const fs_extra_1 = require("fs-extra");
10
10
  const install_node_modules_1 = require("./install-node-modules");
11
+ const copy_files_1 = require("../copy-files");
12
+ const path_1 = require("path");
11
13
  /**
12
14
  * Builds TypeScript source code.
13
15
  * Ensures the build directory exists, installs necessary node modules, and compiles the TypeScript code.
@@ -27,6 +29,12 @@ function buildTypeScript(srcDir, buildDir) {
27
29
  cwd: srcDir,
28
30
  stdio: 'inherit'
29
31
  });
32
+ // Manually Move the package.json and install prod dependencies
33
+ (0, copy_files_1.copyFiles)([
34
+ (0, path_1.resolve)(srcDir, 'package.json'),
35
+ (0, path_1.resolve)(srcDir, 'package-lock.json'),
36
+ ], srcDir, buildDir);
37
+ (0, install_node_modules_1.installNodeModules)(buildDir, ['dev', 'optional', 'peer']);
30
38
  // Log the duration of the build process
31
39
  console.log('NPM Install Duration (ms)', done());
32
40
  }
@@ -21,7 +21,7 @@ function installNodeModules(dir, omit = []) {
21
21
  // Start measuring the duration of the `npm install` command
22
22
  const installComplete = (0, duration_1.default)();
23
23
  // Run the `npm install` command in the specified directory, omitting certain types of dependencies if specified
24
- (0, child_process_1.execSync)(`npm i${omit.join(' --omit=')} --quite`, {
24
+ (0, child_process_1.execSync)(`npm i${omit.map(o => ` --omit=${o}`).join('')} --quite`, {
25
25
  cwd: dir
26
26
  });
27
27
  // Log the duration of the `npm install` command
@@ -13,14 +13,14 @@ export interface StackArguments extends StackProps {
13
13
  region: string;
14
14
  }
15
15
  /**
16
- * Interface for the deploy stack.
16
+ * Interface for the stack.
17
17
  */
18
- export interface DeployStack {
18
+ export interface DeployStack<T extends StackConfiguration> {
19
19
  stack: Stack;
20
20
  name: string;
21
21
  stage: string;
22
22
  project: string;
23
- config: StackConfiguration;
23
+ config: Partial<T>;
24
24
  }
25
25
  /**
26
26
  * Creates a new stack.
@@ -28,13 +28,13 @@ export interface DeployStack {
28
28
  * @param {StackArguments} props - The arguments for creating the stack.
29
29
  * @returns {DeployStack} The created stack.
30
30
  */
31
- export declare function createStack(scope: IConstruct, props: StackArguments): DeployStack;
31
+ export declare function createStack<T extends StackConfiguration>(scope: IConstruct, props: StackArguments): DeployStack<T>;
32
32
  /**
33
33
  * Helpful method to get the 'current' stack that is being defined. Hopefully this will reduce the need to pass the stack around everywhere.
34
34
  */
35
- export declare function getCurrentStack(): DeployStack;
35
+ export declare function getCurrentStack<T extends StackConfiguration>(): DeployStack<T>;
36
36
  /**
37
37
  * This sets the 'current' stack. This should be automatic everywhere, but in case something goes wrong here is a way to force the issue
38
38
  * @param stack
39
39
  */
40
- export declare function setCurrentStack(stack: DeployStack): DeployStack;
40
+ export declare function setCurrentStack<T extends StackConfiguration>(stack: DeployStack<T>): DeployStack<T>;
@@ -9,4 +9,4 @@ export interface StackConfiguration {
9
9
  * @param {string} stage - The stage for which to load the configuration. Defaults to the value of the STAGE environment variable, or "develop" if STAGE is not set.
10
10
  * @returns {StackConfiguration} The loaded configuration.
11
11
  */
12
- export declare function loadConfiguration(stage?: string): StackConfiguration;
12
+ export declare function loadConfiguration<T extends StackConfiguration>(stage?: string): Partial<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byaga/cdk-patterns",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "Collection of common patterns used when making AWS CloudFormation templates using CDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",