sst 2.0.7 → 2.0.9
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/cli/commands/plugins/kysely.js +1 -1
- package/cli/ui/deploy.js +1 -1
- package/constructs/Function.d.ts +29 -0
- package/package.json +1 -1
- package/runtime/handlers/python.js +5 -0
- package/sst.mjs +7 -2
|
@@ -55,7 +55,7 @@ export const useKyselyTypeGenerator = Context.memo(async () => {
|
|
|
55
55
|
const transformer = new Transformer();
|
|
56
56
|
const nodes = transformer.transform({
|
|
57
57
|
dialect: new PostgresDialect(),
|
|
58
|
-
camelCase: db.types.camelCase ===
|
|
58
|
+
camelCase: db.types.camelCase === true,
|
|
59
59
|
metadata: new DatabaseMetadata(metadata, new EnumCollection()),
|
|
60
60
|
});
|
|
61
61
|
const lastIndex = nodes.length - 1;
|
package/cli/ui/deploy.js
CHANGED
|
@@ -109,7 +109,7 @@ function stackNameToId(stack) {
|
|
|
109
109
|
return stack.startsWith(prefix) ? stack.substring(prefix.length) : stack;
|
|
110
110
|
}
|
|
111
111
|
function logicalIdToCdkPath(assembly, stack, logicalId) {
|
|
112
|
-
const found = Object.entries(assembly.manifest.artifacts?.[stack]
|
|
112
|
+
const found = Object.entries(assembly.manifest.artifacts?.[stack]?.metadata || {}).find(([_key, value]) => value[0]?.type === "aws:cdk:logicalId" && value[0]?.data === logicalId)?.[0];
|
|
113
113
|
if (!found) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
package/constructs/Function.d.ts
CHANGED
|
@@ -68,6 +68,10 @@ export interface FunctionProps extends Omit<lambda.FunctionOptions, "functionNam
|
|
|
68
68
|
* Used to configure java function properties
|
|
69
69
|
*/
|
|
70
70
|
java?: JavaProps;
|
|
71
|
+
/**
|
|
72
|
+
* Used to configure python function properties
|
|
73
|
+
*/
|
|
74
|
+
python?: PythonProps;
|
|
71
75
|
/**
|
|
72
76
|
* Hooks to run before and after function builds
|
|
73
77
|
*/
|
|
@@ -431,6 +435,31 @@ export interface NodeJSProps {
|
|
|
431
435
|
*/
|
|
432
436
|
sourcemap?: boolean;
|
|
433
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Used to configure Python bundling options
|
|
440
|
+
*/
|
|
441
|
+
export interface PythonProps {
|
|
442
|
+
/**
|
|
443
|
+
* A list of commands to override the [default installing behavior](Function#bundle) for Python dependencies.
|
|
444
|
+
*
|
|
445
|
+
* Each string in the array is a command that'll be run. For example:
|
|
446
|
+
*
|
|
447
|
+
* @default "[]"
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```js
|
|
451
|
+
* new Function(stack, "Function", {
|
|
452
|
+
* python: {
|
|
453
|
+
* installCommands: [
|
|
454
|
+
* 'export VARNAME="my value"',
|
|
455
|
+
* 'pip install --index-url https://domain.com/pypi/myprivatemodule/simple/ --extra-index-url https://pypi.org/simple -r requirements.txt .',
|
|
456
|
+
* ]
|
|
457
|
+
* }
|
|
458
|
+
* })
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
461
|
+
installCommands?: string[];
|
|
462
|
+
}
|
|
434
463
|
/**
|
|
435
464
|
* Used to configure Java package build options
|
|
436
465
|
*/
|
package/package.json
CHANGED
|
@@ -79,6 +79,11 @@ export const usePythonHandler = Context.memo(async () => {
|
|
|
79
79
|
await fs.cp(src, input.out, {
|
|
80
80
|
recursive: true,
|
|
81
81
|
});
|
|
82
|
+
if (input.props.python?.installCommands) {
|
|
83
|
+
for (const cmd of input.props.python.installCommands) {
|
|
84
|
+
await execAsync(cmd);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
82
87
|
const result = {
|
|
83
88
|
type: "success",
|
|
84
89
|
handler: path.relative(src, path.resolve(input.props.handler)),
|
package/sst.mjs
CHANGED
|
@@ -5066,6 +5066,11 @@ var init_python = __esm({
|
|
|
5066
5066
|
await fs12.cp(src, input.out, {
|
|
5067
5067
|
recursive: true
|
|
5068
5068
|
});
|
|
5069
|
+
if (input.props.python?.installCommands) {
|
|
5070
|
+
for (const cmd of input.props.python.installCommands) {
|
|
5071
|
+
await execAsync3(cmd);
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5069
5074
|
const result = {
|
|
5070
5075
|
type: "success",
|
|
5071
5076
|
handler: path12.relative(src, path12.resolve(input.props.handler))
|
|
@@ -5482,7 +5487,7 @@ function stackNameToId(stack) {
|
|
|
5482
5487
|
}
|
|
5483
5488
|
function logicalIdToCdkPath(assembly, stack, logicalId) {
|
|
5484
5489
|
const found = Object.entries(
|
|
5485
|
-
assembly.manifest.artifacts?.[stack]
|
|
5490
|
+
assembly.manifest.artifacts?.[stack]?.metadata || {}
|
|
5486
5491
|
).find(
|
|
5487
5492
|
([_key, value]) => value[0]?.type === "aws:cdk:logicalId" && value[0]?.data === logicalId
|
|
5488
5493
|
)?.[0];
|
|
@@ -5872,7 +5877,7 @@ var init_kysely = __esm({
|
|
|
5872
5877
|
const transformer = new Transformer();
|
|
5873
5878
|
const nodes = transformer.transform({
|
|
5874
5879
|
dialect: new PostgresDialect(),
|
|
5875
|
-
camelCase: db.types.camelCase ===
|
|
5880
|
+
camelCase: db.types.camelCase === true,
|
|
5876
5881
|
metadata: new DatabaseMetadata(metadata3, new EnumCollection())
|
|
5877
5882
|
});
|
|
5878
5883
|
const lastIndex = nodes.length - 1;
|