@awsless/awsless 0.0.51 → 0.0.53

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.
Files changed (2) hide show
  1. package/dist/bin.js +8 -6
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -803,7 +803,7 @@ import json from "@rollup/plugin-json";
803
803
  import commonjs from "@rollup/plugin-commonjs";
804
804
  import nodeResolve from "@rollup/plugin-node-resolve";
805
805
  import { dirname } from "path";
806
- var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "index.default" } = {}) => {
806
+ var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "default" } = {}) => {
807
807
  return async (input) => {
808
808
  const bundle = await rollup({
809
809
  input,
@@ -850,7 +850,9 @@ var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "index.d
850
850
  if (item.type !== "chunk") {
851
851
  continue;
852
852
  }
853
- const name = item.isEntry ? format2 === "esm" ? "index.mjs" : "index.js" : item.fileName;
853
+ const base = item.isEntry ? "index" : item.name;
854
+ const ext = format2 === "esm" ? "mjs" : "js";
855
+ const name = `${base}.${ext}`;
854
856
  const code = Buffer.from(item.code, "utf8");
855
857
  const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
856
858
  hash.update(code);
@@ -861,7 +863,7 @@ var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "index.d
861
863
  });
862
864
  }
863
865
  return {
864
- handler,
866
+ handler: `index.${handler}`,
865
867
  hash: hash.digest("hex"),
866
868
  files
867
869
  };
@@ -905,7 +907,7 @@ var Code = class {
905
907
  const file = join(root2, `features/${id}.js`);
906
908
  return new FileCode(id, file, rollupBundle({
907
909
  minify: false,
908
- handler: "index.handler"
910
+ handler: "handler"
909
911
  }));
910
912
  }
911
913
  static fromInlineFeature(id) {
@@ -914,7 +916,7 @@ var Code = class {
914
916
  return new InlineFileCode(id, file, rollupBundle({
915
917
  format: "cjs",
916
918
  minify: false,
917
- handler: "index.handler"
919
+ handler: "handler"
918
920
  }));
919
921
  }
920
922
  };
@@ -1320,7 +1322,7 @@ var schema = z6.object({
1320
1322
  /** The name of the exported method within your code that Lambda calls to run your function.
1321
1323
  * @default 'default'
1322
1324
  */
1323
- handler: z6.string().default("index.default"),
1325
+ handler: z6.string().default("default"),
1324
1326
  /** Minify the function code.
1325
1327
  * @default true
1326
1328
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@awsless/lambda": "^0.0.6",
27
- "@awsless/sqs": "^0.0.6",
28
27
  "@awsless/sns": "^0.0.6",
28
+ "@awsless/sqs": "^0.0.6",
29
29
  "@awsless/ssm": "^0.0.7"
30
30
  },
31
31
  "dependencies": {