Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerDuball committed Jul 5, 2023
2 parents 077c408 + 90c0f76 commit c36bc48
Show file tree
Hide file tree
Showing 40 changed files with 426 additions and 158 deletions.
5 changes: 0 additions & 5 deletions .changeset/forty-bats-fry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twelve-flowers-glow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wet-dolphins-rest.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/rest-api-python/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
},
stacks(app) {
app.setDefaultFunctionProps({
runtime: "python3.9",
runtime: "python3.10",
});
app.stack(function Stack({ stack }) {
const api = new Api(stack, "api", {
Expand Down
10 changes: 10 additions & 0 deletions packages/astro-sst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# astro-sst

## 2.18.4

## 2.18.3

## 2.18.2

## 2.18.1

## 2.18.0

## 2.17.8

## 2.17.7
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-sst/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "astro-sst",
"description": "Adapter for Astro apps to work on AWS Lambda and AWS Lambda@Edge.",
"version": "2.17.8",
"version": "2.18.4",
"type": "module",
"license": "MIT",
"author": {
Expand Down
10 changes: 10 additions & 0 deletions packages/console/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @serverless-stack/console

## 2.18.4

## 2.18.3

## 2.18.2

## 2.18.1

## 2.18.0

## 2.17.8

## 2.17.7
Expand Down
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serverless-stack/console",
"private": true,
"version": "2.17.8",
"version": "2.18.4",
"scripts": {
"dev": "vite",
"typecheck": "tsc --noEmit",
Expand Down
14 changes: 14 additions & 0 deletions packages/create-sst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# create-sst

## 2.18.4

## 2.18.3

## 2.18.2

## 2.18.1

## 2.18.0

### Patch Changes

- [#3054](https://github.com/serverless-stack/sst/pull/3054) [`966d3b0d3`](https://github.com/serverless-stack/sst/commit/966d3b0d3adf367c5416277b8e5c63183f1f1954) Thanks [@berenddeboer](https://github.com/berenddeboer)! - Function: support java17 runtime

## 2.17.8

## 2.17.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
},
stacks(app) {
app.setDefaultFunctionProps({
runtime: "java11",
runtime: "java17",
});
app.stack(function Stack({ stack }) {
const api = new Api(stack, "api", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
},
stacks(app) {
app.setDefaultFunctionProps({
runtime: "python3.9",
runtime: "python3.10",
});
app.stack(function Stack({ stack }) {
const api = new Api(stack, "api", {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-sst/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-sst",
"version": "2.17.8",
"version": "2.18.4",
"homepage": "https://serverless-stack.com",
"description": "Create Serverless Stack apps.",
"main": "src/index.mjs",
Expand Down
10 changes: 10 additions & 0 deletions packages/solid-start-sst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# solid-start-sst

## 2.18.4

## 2.18.3

## 2.18.2

## 2.18.1

## 2.18.0

## 2.17.8

## 2.17.7
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-start-sst/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-start-sst",
"version": "2.17.8",
"version": "2.18.4",
"description": "Adapter for Solid apps to work on AWS Lambda and AWS Lambda@Edge.",
"main": "./index.mjs",
"types": "./index.d.ts",
Expand Down
52 changes: 52 additions & 0 deletions packages/sst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# @serverless-stack/cli2

## 2.18.4

### Patch Changes

- [#3083](https://github.com/serverless-stack/sst/pull/3083) [`6effd7d35`](https://github.com/serverless-stack/sst/commit/6effd7d351f2a101394845b9acfbb9cbbc2c522e) Thanks [@khuezy](https://github.com/khuezy)! - NextjsSite: update OpenNext 2.0.4

- [#3083](https://github.com/serverless-stack/sst/pull/3083) [`6effd7d35`](https://github.com/serverless-stack/sst/commit/6effd7d351f2a101394845b9acfbb9cbbc2c522e) Thanks [@khuezy](https://github.com/khuezy)! - SsrSite: fix multiple s3 origins created for static assets

- [#3076](https://github.com/serverless-stack/sst/pull/3076) [`f1249013d`](https://github.com/serverless-stack/sst/commit/f1249013d8476856558d2e6baaf25e55b76523b9) Thanks [@alex-klyuchnikov](https://github.com/alex-klyuchnikov)! - Function: await fs.writeFile for nodejs runtime

## 2.18.3

### Patch Changes

- [`dd8ec0191`](https://github.com/serverless-stack/sst/commit/dd8ec0191947314b5b4a07cb8514cbba594a5022) Thanks [@fwang](https://github.com/fwang)! - Fix type file is incomplete

## 2.18.2

### Patch Changes

- [#3055](https://github.com/serverless-stack/sst/pull/3055) [`c1d4fe461`](https://github.com/serverless-stack/sst/commit/c1d4fe461a3534365f22e07b48c97e5c4067ba77) Thanks [@juliankrispel](https://github.com/juliankrispel)! - Remove deprecated rds engine

- [`eebe301c3`](https://github.com/serverless-stack/sst/commit/eebe301c3e0879b87fa58be5c04b8de6922afaf6) Thanks [@thdxr](https://github.com/thdxr)! - cli: fix issue where function invocation when cli starts crashes the whole thing

- [`e2015c456`](https://github.com/serverless-stack/sst/commit/e2015c4569d53e68e52a65abb7b031fdb4b53abb) Thanks [@fwang](https://github.com/fwang)! - SsrSite: fix static assets CloudFront distribution path

## 2.18.1

### Patch Changes

- [`150680d80`](https://github.com/serverless-stack/sst/commit/150680d80733dd85eed26407b647b2440188b8a0) Thanks [@fwang](https://github.com/fwang)! - SsrSite: add static file cache behaviors lazily

- [#3056](https://github.com/serverless-stack/sst/pull/3056) [`06ccb9a9c`](https://github.com/serverless-stack/sst/commit/06ccb9a9c52c408d08ddb50ab64902eed8153d3d) Thanks [@khuezy](https://github.com/khuezy)! - SsrSite: fix s3 assets not setting cache-control

- [`5fff7262d`](https://github.com/serverless-stack/sst/commit/5fff7262d982cd2b791e523930444ae22a7983d0) Thanks [@fwang](https://github.com/fwang)! - SsrSite: fix "sst dev" access denied error

## 2.18.0

### Minor Changes

- [`7c71978fa`](https://github.com/serverless-stack/sst/commit/7c71978fa1cd461c6a192a7385c3ca26afbbfdf1) Thanks [@fwang](https://github.com/fwang)! - SsrSite: set cookie behavior to NONE in server cache policy

### Patch Changes

- [`e5fc4de81`](https://github.com/serverless-stack/sst/commit/e5fc4de81b640be37d76862f52aa54d9259fee0b) Thanks [@fwang](https://github.com/fwang)! - NextjsSite: update to OpenNext 2.0.3

- [#3051](https://github.com/serverless-stack/sst/pull/3051) [`2b824b13e`](https://github.com/serverless-stack/sst/commit/2b824b13e4a7a7ffc5864b2e43511ab26e3fd0cb) Thanks [@khuezy](https://github.com/khuezy)! - SsrSite: fix s3 assets cache-control header not set

- [#3054](https://github.com/serverless-stack/sst/pull/3054) [`966d3b0d3`](https://github.com/serverless-stack/sst/commit/966d3b0d3adf367c5416277b8e5c63183f1f1954) Thanks [@berenddeboer](https://github.com/berenddeboer)! - Function: support java17 runtime

- [`a734123f7`](https://github.com/serverless-stack/sst/commit/a734123f718ef12b95834928c14d29e564933bcc) Thanks [@fwang](https://github.com/fwang)! - StaticSite & SsrSite: lazy build

## 2.17.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"sideEffects": false,
"name": "sst",
"version": "2.17.8",
"version": "2.18.4",
"bin": {
"sst": "cli/sst.js"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sst/src/cli/commands/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ export const dev = (program: Program) =>

clear();
await printHeader({ console: true, hint: "ready!" });
await useStackBuilder();
await Promise.all([
useDisconnector(),
useRuntimeWorkers(),
Expand All @@ -398,7 +399,6 @@ export const dev = (program: Program) =>
useKyselyTypeGenerator(),
useRDSWarmer(),
useFunctionLogger(),
useStackBuilder(),
]);
}
);
Expand Down
95 changes: 53 additions & 42 deletions packages/sst/src/constructs/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type AppProps = CDKAppProps;
*/
export class App extends CDKApp {
/**
* Whether or not the app is running locally under `sst start`
* Whether or not the app is running locally under `sst dev`
*/
public readonly local: boolean = false;

Expand Down Expand Up @@ -575,52 +575,63 @@ export class App extends CDKApp {
].join("\n")
);

class CodegenTypes implements IAspect {
public visit(c: IConstruct): void {
if (!isSSTConstruct(c)) {
return;
}
if (c instanceof Function && c._doNotAllowOthersToBind) {
return;
}
this.foreachConstruct((c) => {
if (!isSSTConstruct(c)) {
return;
}
if (c instanceof Function && c._doNotAllowOthersToBind) {
return;
}

const binding = bindType(c);
if (!binding) {
return;
}
const binding = bindType(c);
if (!binding) {
return;
}

const className = c.constructor.name;
const id = c.id;
const className = c.constructor.name;
const id = c.id;

// Case 1: variable does not have properties, ie. Secrets and Parameters

fs.appendFileSync(
`${typesPath}/index.ts`,
(binding.variables[0] === "."
? [
`import "sst/node/${binding.clientPackage}";`,
`declare module "sst/node/${binding.clientPackage}" {`,
` export interface ${className}Resources {`,
` "${id}": string;`,
` }`,
`}`,
]
: [
`import "sst/node/${binding.clientPackage}";`,
`declare module "sst/node/${binding.clientPackage}" {`,
` export interface ${className}Resources {`,
` "${id}": {`,
...binding.variables.map((p) => ` ${p}: string;`),
` }`,
` }`,
`}`,
]
).join("\n")
);
});
}

// Case 1: variable does not have properties, ie. Secrets and Parameters

fs.appendFileSync(
`${typesPath}/index.ts`,
(binding.variables[0] === "."
? [
`import "sst/node/${binding.clientPackage}";`,
`declare module "sst/node/${binding.clientPackage}" {`,
` export interface ${className}Resources {`,
` "${id}": string;`,
` }`,
`}`,
]
: [
`import "sst/node/${binding.clientPackage}";`,
`declare module "sst/node/${binding.clientPackage}" {`,
` export interface ${className}Resources {`,
` "${id}": {`,
...binding.variables.map((p) => ` ${p}: string;`),
` }`,
` }`,
`}`,
]
).join("\n")
);
private foreachConstruct(fn: (c: IConstruct) => void) {
const loop = (parent: IConstruct) => {
for (const child of parent.node.children) {
fn(child);
loop(child);
}
}
};

Aspects.of(this).add(new CodegenTypes());
for (const child of this.node.children) {
if (child instanceof Stack) {
loop(child);
}
}
}

// Functional Stack
Expand Down
2 changes: 2 additions & 0 deletions packages/sst/src/constructs/Function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ const supportedRuntimes = {
"python3.7": CDKRuntime.PYTHON_3_7,
"python3.8": CDKRuntime.PYTHON_3_8,
"python3.9": CDKRuntime.PYTHON_3_9,
"python3.10": CDKRuntime.PYTHON_3_10,
"dotnetcore1.0": CDKRuntime.DOTNET_CORE_1,
"dotnetcore2.0": CDKRuntime.DOTNET_CORE_2,
"dotnetcore2.1": CDKRuntime.DOTNET_CORE_2_1,
"dotnetcore3.1": CDKRuntime.DOTNET_CORE_3_1,
dotnet6: CDKRuntime.DOTNET_6,
java8: CDKRuntime.JAVA_8,
java11: CDKRuntime.JAVA_11,
java17: CDKRuntime.JAVA_17,
"go1.x": CDKRuntime.PROVIDED_AL2,
go: CDKRuntime.PROVIDED_AL2,
};
Expand Down

0 comments on commit c36bc48

Please sign in to comment.