Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Jan 12, 2024
1 parent 1ba65b9 commit 2a471d5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions examples/test/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"sst": "3.0.1-6"
"type": "module",
"devDependencies": {
"sst": "3.0.1-7"
}
}
12 changes: 6 additions & 6 deletions examples/test/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions examples/test/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default $config({
const queue = new aws.sqs.Queue("MyQueue");
const secret = new sst.Secret("StripeKey");

const worker = new sst.Worker("MyWorker", {
handler: "./src/index.ts",
});

const fn = new sst.Function("MyFunction", {
url: true,
link: [queue, bucket, secret],
Expand Down
2 changes: 1 addition & 1 deletion internal/components/src/components/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function registerLinkType(reg: TypeRegistration) {
await fs.promises.writeFile(
path,
[
`declare module "sst/resource" {`,
`declare module "sst" {`,
` export interface Resource {`,
...Object.entries(file).map(([key, value]) => ` ${key}: ${value};`),
` [key: string]: any`,
Expand Down
7 changes: 5 additions & 2 deletions internal/components/src/runtime/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function build(name: string, input: pulumi.Unwrap<WorkerArgs>) {
!relative.startsWith("..") && !path.isAbsolute(input.handler!)
? relative
: "",
isESM ? "index.mjs" : "index.cjs"
isESM ? "index.mjs" : "index.cjs",
);

// Rebuilt using existing esbuild context
Expand All @@ -37,6 +37,9 @@ export async function build(name: string, input: pulumi.Unwrap<WorkerArgs>) {
keepNames: true,
bundle: true,
logLevel: "silent",
define: {
$SST_LINKS: JSON.stringify({}),
},
metafile: true,
...(isESM
? {
Expand Down Expand Up @@ -69,7 +72,7 @@ export async function build(name: string, input: pulumi.Unwrap<WorkerArgs>) {
if (nodejs.sourcemap) return;

const map = Object.keys(result.metafile?.outputs || {}).find((item) =>
item.endsWith(".map")
item.endsWith(".map"),
);
if (!map) return;

Expand Down
3 changes: 2 additions & 1 deletion sdk/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "https://json.schemastore.org/package.json",
"name": "sst",
"type": "module",
"version": "3.0.1-6",
"version": "3.0.1-7",
"main": "./dist/index.js",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js"
Expand Down

0 comments on commit 2a471d5

Please sign in to comment.