jitsu-cli 1.10.3 → 2.14.0-beta.4

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.
@@ -1,16 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadPackageJson = loadPackageJson;
4
- exports.loadPackageJson0 = loadPackageJson0;
5
- const tslib_1 = require("tslib");
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
- const fs_1 = require("fs");
9
- const chalk_code_highlight_1 = require("../lib/chalk-code-highlight");
10
- async function loadPackageJson(projectDir) {
1
+ import path from "path";
2
+ import inquirer from "inquirer";
3
+ import { existsSync, readFileSync } from "fs";
4
+ import { b, red } from "../lib/chalk-code-highlight";
5
+ export async function loadPackageJson(projectDir) {
11
6
  let packageJson = loadPackageJson0(projectDir);
12
7
  if (!packageJson) {
13
- projectDir = (await inquirer_1.default.prompt([
8
+ projectDir = (await inquirer.prompt([
14
9
  {
15
10
  type: "input",
16
11
  name: "dir",
@@ -24,15 +19,15 @@ async function loadPackageJson(projectDir) {
24
19
  }
25
20
  return { projectDir, packageJson };
26
21
  }
27
- function loadPackageJson0(projectDir) {
28
- const packageJsonPath = path_1.default.resolve(projectDir, "package.json");
29
- if (!(0, fs_1.existsSync)(packageJsonPath)) {
30
- console.error((0, chalk_code_highlight_1.red)(`Can't find node.js project in: ${(0, chalk_code_highlight_1.b)(projectDir)}`));
22
+ export function loadPackageJson0(projectDir) {
23
+ const packageJsonPath = path.resolve(projectDir, "package.json");
24
+ if (!existsSync(packageJsonPath)) {
25
+ console.error(red(`Can't find node.js project in: ${b(projectDir)}`));
31
26
  return undefined;
32
27
  }
33
- const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, "utf-8"));
28
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
34
29
  if (!packageJson.devDependencies?.["jitsu-cli"]) {
35
- console.error((0, chalk_code_highlight_1.red)(`directory ${(0, chalk_code_highlight_1.b)(projectDir)} doesn't contain jitsu-cli managed project`));
30
+ console.error(red(`directory ${b(projectDir)} doesn't contain jitsu-cli managed project`));
36
31
  return undefined;
37
32
  }
38
33
  return packageJson;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.test = test;
4
- const jest_cli_1 = require("jest-cli");
5
- const shared_1 = require("./shared");
6
- const chalk_code_highlight_1 = require("../lib/chalk-code-highlight");
7
- async function test({ dir }) {
8
- const { packageJson, projectDir } = await (0, shared_1.loadPackageJson)(dir || process.cwd());
9
- console.log(`Running tests for ${(0, chalk_code_highlight_1.b)(packageJson.name)}`);
1
+ import { run as jest } from "jest-cli";
2
+ import { loadPackageJson } from "./shared";
3
+ import { b } from "../lib/chalk-code-highlight";
4
+ export async function test({ dir }) {
5
+ const { packageJson, projectDir } = await loadPackageJson(dir || process.cwd());
6
+ console.log(`Running tests for ${b(packageJson.name)}`);
10
7
  const jestArgs = ["--passWithNoTests", "--projects", projectDir, "--preset", "ts-jest"];
11
- await (0, jest_cli_1.run)(jestArgs);
8
+ await jest(jestArgs);
12
9
  }
@@ -1,19 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.whoami = whoami;
4
- const tslib_1 = require("tslib");
5
- const os_1 = require("os");
6
- const fs = tslib_1.__importStar(require("fs"));
7
- const fs_1 = require("fs");
8
- const chalk_code_highlight_1 = require("../lib/chalk-code-highlight");
9
- async function whoami({ host, apikey, force }) {
1
+ import { homedir } from "os";
2
+ import * as fs from "fs";
3
+ import { readFileSync } from "fs";
4
+ import { b } from "../lib/chalk-code-highlight";
5
+ export async function whoami({ host, apikey, force }) {
10
6
  if (!apikey) {
11
- const jitsuFile = `${(0, os_1.homedir)()}/.jitsu/jitsu-cli.json`;
7
+ const jitsuFile = `${homedir()}/.jitsu/jitsu-cli.json`;
12
8
  if (!fs.existsSync(jitsuFile)) {
13
9
  console.log("You are not logged in. Log in with `jitsu-cli login` or provide --apikey option");
14
10
  return;
15
11
  }
16
- const loginInfo = JSON.parse((0, fs_1.readFileSync)(jitsuFile, { encoding: "utf-8" }));
12
+ const loginInfo = JSON.parse(readFileSync(jitsuFile, { encoding: "utf-8" }));
17
13
  if (loginInfo.host) {
18
14
  host = loginInfo.host;
19
15
  }
@@ -40,5 +36,5 @@ async function whoami({ host, apikey, force }) {
40
36
  if (!me.auth) {
41
37
  console.error(`Login is invalid. Please login once again with \`jitsu-cli login -f\`, or provide a valid --apikey option`);
42
38
  }
43
- console.log(`You are logged in as ${(0, chalk_code_highlight_1.b)(me.user.email)} at ${host}. Internal userId: ${(0, chalk_code_highlight_1.b)(me.user.internalId)}`);
39
+ console.log(`You are logged in as ${b(me.user.email)} at ${host}. Internal userId: ${b(me.user.internalId)}`);
44
40
  }
@@ -1,44 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const figlet_1 = tslib_1.__importDefault(require("figlet"));
5
- const commander_1 = require("commander");
6
- const login_1 = require("./commands/login");
7
- const deploy_1 = require("./commands/deploy");
8
- const init_1 = require("./commands/init");
9
- const build_1 = require("./commands/build");
10
- const test_1 = require("./commands/test");
11
- const version_1 = require("./lib/version");
12
- const whoami_1 = require("./commands/whoami");
13
- console.log(figlet_1.default.textSync("Jitsu CLI", { horizontalLayout: "full" }));
14
- const p = new commander_1.Command();
15
- p.name(version_1.jitsuCliPackageName).description("CLI command to create, test and deploy extensions for Jitsu Next");
1
+ import figlet from "figlet";
2
+ import { Command } from "commander";
3
+ import { login, logout } from "./commands/login";
4
+ import { deploy } from "./commands/deploy";
5
+ import { init } from "./commands/init";
6
+ import { build } from "./commands/build";
7
+ import { test } from "./commands/test";
8
+ import { jitsuCliVersion, jitsuCliPackageName } from "./lib/version";
9
+ import { whoami } from "./commands/whoami";
10
+ console.log(figlet.textSync("Jitsu CLI", { horizontalLayout: "full" }));
11
+ const p = new Command();
12
+ p.name(jitsuCliPackageName).description("CLI command to create, test and deploy extensions for Jitsu Next");
16
13
  p.command("init")
17
14
  .description("Initialize a new Jitsu extension project")
18
15
  .arguments("[dir]")
19
16
  .option("-j, --jitsu-version <version>", "Jitsu version to use in package.json. (Optional)")
20
17
  .option("--allow-non-empty-dir", "Allow to create project in non-empty directory. (Optional)")
21
- .action(init_1.init);
18
+ .action(init);
22
19
  p.command("build")
23
20
  .description("Build the extension")
24
21
  .option("-d, --dir <dir>", "the directory of project. (Optional). By default, current directory is used")
25
- .action(build_1.build);
22
+ .action(build);
26
23
  p.command("test")
27
24
  .description("Run test provided with the extension")
28
25
  .option("-d, --dir <dir>", "the directory of project. (Optional). By default, current directory is used")
29
- .action(test_1.test);
26
+ .action(test);
30
27
  p.command("whoami")
31
28
  .description("Check if current user is logged in. Shows user's info if logged in")
32
29
  .option("-h, --host <host>", "Jitsu host or base url", "https://use.jitsu.com")
33
30
  .option("-k, --apikey <api-key>", "Jitsu user's Api Key. (Optional). Disables interactive login.")
34
- .action(whoami_1.whoami);
31
+ .action(whoami);
35
32
  p.command("login")
36
33
  .description("Login to Jitsu and remember credentials in `~/.jitsu/jitsu-cli.json` file")
37
34
  .option("-f, --force", "If user already logged in, replace existing session")
38
35
  .option("-h, --host <host>", "Jitsu host or base url", "https://use.jitsu.com")
39
36
  .option("-k, --apikey <api-key>", "Jitsu user's Api Key. (Optional). Disables interactive login.")
40
- .action(login_1.login);
41
- p.command("logout").description("Logout").option("-f, --force", "Do not ask for confirmation").action(login_1.logout);
37
+ .action(login);
38
+ p.command("logout").description("Logout").option("-f, --force", "Do not ask for confirmation").action(logout);
42
39
  p.command("deploy")
43
40
  .description("Deploy functions to Jitsu project")
44
41
  .option("-d, --dir <dir>", "the directory of project. (Optional). By default, current directory is used")
@@ -47,7 +44,7 @@ p.command("deploy")
47
44
  .option("-w, --workspace <workspace-id>", "Id of workspace where to deploy function (Optional). By default, interactive prompt is shown to select workspace")
48
45
  .option("-t, --type <type>", "entity type to deploy", "function")
49
46
  .option("-n, --name <name...>", "limit deploy to provided entities only. (Optional)")
50
- .action(deploy_1.deploy);
51
- p.version(version_1.jitsuCliPackageName + " " + version_1.jitsuCliVersion, "-v, --version");
47
+ .action(deploy);
48
+ p.version(jitsuCliPackageName + " " + jitsuCliVersion, "-v, --version");
52
49
  p.helpOption("--help", "display help for command");
53
50
  p.parse();
@@ -1,31 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.yellow = exports.green = exports.red = exports.b = exports.defaultColorScheme = void 0;
4
- exports.chalkCode = chalkCode;
5
- const tslib_1 = require("tslib");
6
- const prismjs_1 = tslib_1.__importDefault(require("prismjs"));
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- exports.defaultColorScheme = {
1
+ import Prism from "prismjs";
2
+ import chalk from "chalk";
3
+ export const defaultColorScheme = {
9
4
  punctuation: "#999",
10
5
  operator: "#9a6e3a",
11
6
  string: "#9a6e3a",
12
7
  keyword: "b#07a",
13
8
  "function-variable": null,
14
9
  };
15
- exports.b = chalk_1.default.bold;
16
- exports.red = chalk_1.default.red;
17
- exports.green = chalk_1.default.green;
18
- exports.yellow = chalk_1.default.yellow;
10
+ export const b = chalk.bold;
11
+ export const red = chalk.red;
12
+ export const green = chalk.green;
13
+ export const yellow = chalk.yellow;
19
14
  function chalkString(expr, str) {
20
15
  if (expr.startsWith("b")) {
21
- return (0, exports.b)(chalkString(expr.substring(1), str));
16
+ return b(chalkString(expr.substring(1), str));
22
17
  }
23
18
  else {
24
- return chalk_1.default.hex(expr)(str);
19
+ return chalk.hex(expr)(str);
25
20
  }
26
21
  }
27
- function chalkCode(code, lang, colorScheme = exports.defaultColorScheme) {
28
- return prismjs_1.default.tokenize(code, prismjs_1.default.languages.javascript)
22
+ export function chalkCode(code, lang, colorScheme = defaultColorScheme) {
23
+ return Prism.tokenize(code, Prism.languages.javascript)
29
24
  .map(element => {
30
25
  if (typeof element === "string") {
31
26
  return element;
@@ -37,9 +32,9 @@ function chalkCode(code, lang, colorScheme = exports.defaultColorScheme) {
37
32
  })
38
33
  .join("");
39
34
  }
40
- chalkCode.typescript = (code, colorScheme = exports.defaultColorScheme) => {
41
- return chalkCode(typeof code === "string" ? code : code.join("\n"), prismjs_1.default.languages.typescript, colorScheme);
35
+ chalkCode.typescript = (code, colorScheme = defaultColorScheme) => {
36
+ return chalkCode(typeof code === "string" ? code : code.join("\n"), Prism.languages.typescript, colorScheme);
42
37
  };
43
- chalkCode.json = (code, colorScheme = exports.defaultColorScheme) => {
44
- return chalkCode(typeof code === "string" ? code : code.join("\n"), prismjs_1.default.languages.json, colorScheme);
38
+ chalkCode.json = (code, colorScheme = defaultColorScheme) => {
39
+ return chalkCode(typeof code === "string" ? code : code.join("\n"), Prism.languages.json, colorScheme);
45
40
  };
@@ -1,21 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFunctionFromFilePath = getFunctionFromFilePath;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const rollup_1 = require("rollup");
7
- const juava_1 = require("juava");
1
+ import fs from "fs";
2
+ import { rollup } from "rollup";
3
+ import { assertDefined, assertTrue } from "juava";
8
4
  function getSlug(filePath) {
9
5
  return filePath.split("/").pop()?.replace(".ts", "");
10
6
  }
11
- async function getFunctionFromFilePath(filePath, kind, profileBuilders = []) {
12
- if (!fs_1.default.existsSync(filePath)) {
7
+ export async function getFunctionFromFilePath(filePath, kind, profileBuilders = []) {
8
+ if (!fs.existsSync(filePath)) {
13
9
  throw new Error(`Cannot load function from file ${filePath}: file doesn't exist`);
14
10
  }
15
- else if (!fs_1.default.statSync(filePath).isFile()) {
11
+ else if (!fs.statSync(filePath).isFile()) {
16
12
  throw new Error(`Cannot load function from file ${filePath}: path is not a file`);
17
13
  }
18
- const bundle = await (0, rollup_1.rollup)({
14
+ const bundle = await rollup({
19
15
  input: [filePath],
20
16
  external: ["@jitsu/functions-lib"],
21
17
  logLevel: "silent",
@@ -26,8 +22,8 @@ async function getFunctionFromFilePath(filePath, kind, profileBuilders = []) {
26
22
  });
27
23
  const exports = {};
28
24
  eval(output.output[0].code);
29
- (0, juava_1.assertDefined)(exports.default, `Function from ${filePath} doesn't have default export. Exported symbols: ${Object.keys(exports)}`);
30
- (0, juava_1.assertTrue)(typeof exports.default === "function", `Default export from ${filePath} is not a function`);
25
+ assertDefined(exports.default, `Function from ${filePath} doesn't have default export. Exported symbols: ${Object.keys(exports)}`);
26
+ assertTrue(typeof exports.default === "function", `Default export from ${filePath} is not a function`);
31
27
  let name = exports.config?.name || exports.config?.slug || getSlug(filePath);
32
28
  let id = exports.config?.id;
33
29
  if (kind === "profile") {
@@ -1,14 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeIndentation = removeIndentation;
4
- exports.align = align;
5
- exports.jsonify = jsonify;
6
1
  function getIndentSize(line) {
7
2
  let idx = 0;
8
3
  for (; line.charAt(idx) === " " && idx < line.length; idx++) { }
9
4
  return idx;
10
5
  }
11
- function removeIndentation(text, { trimLines = true } = {}) {
6
+ export function removeIndentation(text, { trimLines = true } = {}) {
12
7
  let lines = text.split("\n");
13
8
  if (trimLines) {
14
9
  let start = 0, end = lines.length - 1;
@@ -19,7 +14,7 @@ function removeIndentation(text, { trimLines = true } = {}) {
19
14
  let commonIndent = Math.min(...lines.filter(ln => ln.trim().length > 0).map(getIndentSize));
20
15
  return lines.map(ln => ln.substring(commonIndent)).join("\n");
21
16
  }
22
- function align(text, { indent = 0, lnBefore = 0, lnAfter = 0 } = {}) {
17
+ export function align(text, { indent = 0, lnBefore = 0, lnAfter = 0 } = {}) {
23
18
  const cleanText = removeIndentation(text, { trimLines: true });
24
19
  return [
25
20
  ...new Array(lnBefore).fill(""),
@@ -27,7 +22,7 @@ function align(text, { indent = 0, lnBefore = 0, lnAfter = 0 } = {}) {
27
22
  ...new Array(lnAfter).fill(""),
28
23
  ].join("\n");
29
24
  }
30
- function jsonify(obj) {
25
+ export function jsonify(obj) {
31
26
  if (typeof obj === "string") {
32
27
  try {
33
28
  return JSON.parse(obj);
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.write = write;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const fs = tslib_1.__importStar(require("fs"));
7
- const indent_1 = require("./indent");
1
+ import path from "path";
2
+ import * as fs from "fs";
3
+ import { removeIndentation } from "./indent";
8
4
  function toTemplateFunction(template) {
9
5
  if (template === null || template === undefined) {
10
6
  return () => undefined;
@@ -16,10 +12,10 @@ function toTemplateFunction(template) {
16
12
  return () => template;
17
13
  }
18
14
  }
19
- function write(dir, template, vars) {
15
+ export function write(dir, template, vars) {
20
16
  Object.entries(template(vars)).forEach(([fileName, template]) => {
21
- let filePath = path_1.default.resolve(dir, fileName);
22
- let fileDir = path_1.default.dirname(filePath);
17
+ let filePath = path.resolve(dir, fileName);
18
+ let fileDir = path.dirname(filePath);
23
19
  if (!fs.existsSync(fileDir)) {
24
20
  fs.mkdirSync(fileDir, { recursive: true });
25
21
  }
@@ -28,7 +24,7 @@ function write(dir, template, vars) {
28
24
  content = JSON.stringify(content, null, 2);
29
25
  }
30
26
  if (content) {
31
- let data = (0, indent_1.removeIndentation)(content);
27
+ let data = removeIndentation(content);
32
28
  fs.writeFileSync(filePath, data);
33
29
  }
34
30
  });
@@ -1,35 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jitsuCliPackageName = exports.jitsuCliVersion = void 0;
4
- exports.getUpgradeMessage = getUpgradeMessage;
5
- exports.box = box;
6
- exports.hasNewerVersion = hasNewerVersion;
7
- const tslib_1 = require("tslib");
8
- const package_json_1 = tslib_1.__importDefault(require("../../package.json"));
9
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
- const preload_1 = tslib_1.__importDefault(require("semver/preload"));
11
- const chalk_code_highlight_1 = require("./chalk-code-highlight");
1
+ import pkg from "../../package.json";
2
+ import chalk from "chalk";
3
+ import semver from "semver/preload";
4
+ import { b } from "./chalk-code-highlight";
12
5
  const fetch = require("cross-fetch");
13
- exports.jitsuCliVersion = package_json_1.default.version;
14
- exports.jitsuCliPackageName = package_json_1.default.name;
6
+ export const jitsuCliVersion = pkg.version;
7
+ export const jitsuCliPackageName = pkg.name;
15
8
  let newVersion = undefined;
16
- function getUpgradeMessage(newVersion, oldVersion) {
17
- return box(`🚀 New version of Jitsu CLI is available: ${oldVersion} → ${chalk_1.default.green(newVersion)} \n Run ${(0, chalk_code_highlight_1.b)("npm install -g " + exports.jitsuCliPackageName)} or ${(0, chalk_code_highlight_1.b)("yarn global install " + exports.jitsuCliPackageName)}`);
9
+ export function getUpgradeMessage(newVersion, oldVersion) {
10
+ return box(`🚀 New version of Jitsu CLI is available: ${oldVersion} → ${chalk.green(newVersion)} \n Run ${b("npm install -g " + jitsuCliPackageName)} or ${b("yarn global install " + jitsuCliPackageName)}`);
18
11
  }
19
12
  function padRight(str, minLen, symbol = " ") {
20
13
  return str.length >= minLen ? str : str + symbol.repeat(minLen - str.length);
21
14
  }
22
- function box(msg) {
15
+ export function box(msg) {
23
16
  let lines = msg.split("\n");
24
17
  return ["──".repeat(80), ...lines.map(ln => ` ${ln}`), "──".repeat(80)].join("\n");
25
18
  }
26
- async function hasNewerVersion() {
19
+ export async function hasNewerVersion() {
27
20
  try {
28
- let json = (await (await fetch(`https://registry.npmjs.org/-/package/${exports.jitsuCliPackageName}/dist-tags`)).json());
21
+ let json = (await (await fetch(`https://registry.npmjs.org/-/package/${jitsuCliPackageName}/dist-tags`)).json());
29
22
  let latestVersion = json.latest;
30
- return preload_1.default.gt(latestVersion, exports.jitsuCliVersion) ? latestVersion : undefined;
23
+ return semver.gt(latestVersion, jitsuCliVersion) ? latestVersion : undefined;
31
24
  }
32
25
  catch (e) {
33
- console.debug(`Failed to fetch latest version of ${exports.jitsuCliPackageName}: ${e?.message}`);
26
+ console.debug(`Failed to fetch latest version of ${jitsuCliPackageName}: ${e?.message}`);
34
27
  }
35
28
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.functionProjectTemplate = exports.packageJsonTemplate = void 0;
4
- const version_1 = require("../lib/version");
5
- const juava_1 = require("juava");
6
- const packageJsonTemplate = ({ packageName, license = "MIT", jitsuVersion = undefined }) => ({
1
+ import { jitsuCliVersion, jitsuCliPackageName } from "../lib/version";
2
+ import { sanitize } from "juava";
3
+ export const packageJsonTemplate = ({ packageName, license = "MIT", jitsuVersion = undefined }) => ({
7
4
  name: `${packageName}`,
8
5
  version: "0.0.1",
9
6
  description: `Jitsu extension - ${packageName}`,
@@ -11,23 +8,22 @@ const packageJsonTemplate = ({ packageName, license = "MIT", jitsuVersion = unde
11
8
  keywords: ["jitsu", "jitsu-cli", "function", `jitsu-extension`],
12
9
  scripts: {
13
10
  clean: "rm -rf ./dist",
14
- build: `${version_1.jitsuCliPackageName} build`,
15
- test: `${version_1.jitsuCliPackageName} test`,
16
- deploy: `${version_1.jitsuCliPackageName} deploy`,
11
+ build: `${jitsuCliPackageName} build`,
12
+ test: `${jitsuCliPackageName} test`,
13
+ deploy: `${jitsuCliPackageName} deploy`,
17
14
  },
18
15
  devDependencies: {
19
- "jitsu-cli": `${jitsuVersion || "^" + version_1.jitsuCliVersion}`,
20
- "@jitsu/protocols": `${jitsuVersion || "^" + version_1.jitsuCliVersion}`,
21
- "@jitsu/functions-lib": `${jitsuVersion || "^" + version_1.jitsuCliVersion}`,
16
+ "jitsu-cli": `${jitsuVersion || "^" + jitsuCliVersion}`,
17
+ "@jitsu/protocols": `${jitsuVersion || "^" + jitsuCliVersion}`,
18
+ "@jitsu/functions-lib": `${jitsuVersion || "^" + jitsuCliVersion}`,
22
19
  "@types/jest": "^29.5.5",
23
20
  "ts-jest": "^29.1.1",
24
21
  },
25
22
  dependencies: {},
26
23
  });
27
- exports.packageJsonTemplate = packageJsonTemplate;
28
24
  let functionTest = ({ packageName }) => {
29
25
  return `
30
- test("${(0, juava_1.sanitize)(packageName)} test", () => {
26
+ test("${sanitize(packageName)} test", () => {
31
27
  //TODO: implement test
32
28
  });
33
29
  `;
@@ -55,7 +51,7 @@ export default helloWorldFunction;
55
51
  };
56
52
  let profileTest = ({ packageName }) => {
57
53
  return `
58
- test("${(0, juava_1.sanitize)(packageName)} test", () => {
54
+ test("${sanitize(packageName)} test", () => {
59
55
  //TODO: implement test
60
56
  });
61
57
  `;
@@ -85,12 +81,12 @@ const profileExample: ProfileFunction = async (events, user, context) => {
85
81
  export default profileExample;
86
82
  `;
87
83
  };
88
- const functionProjectTemplate = ({ packageName }) => ({
84
+ export const functionProjectTemplate = ({ packageName }) => ({
89
85
  [`__tests__/profiles/profile-example.test.ts`]: profileTest,
90
86
  [`__tests__/functions/hello.test.ts`]: functionTest,
91
87
  [`src/profiles/profile-example.ts`]: profileCode,
92
88
  [`src/functions/hello.ts`]: functionCode,
93
- "package.json": exports.packageJsonTemplate,
89
+ "package.json": packageJsonTemplate,
94
90
  "tsconfig.json": {
95
91
  compilerOptions: {
96
92
  rootDir: "./src",
@@ -108,4 +104,3 @@ const functionProjectTemplate = ({ packageName }) => ({
108
104
  exclude: ["__tests__", "node_modules", "dist"],
109
105
  },
110
106
  });
111
- exports.functionProjectTemplate = functionProjectTemplate;
package/dist/140.js CHANGED
@@ -3,14 +3,14 @@ exports.id = 140;
3
3
  exports.ids = [140];
4
4
  exports.modules = {
5
5
 
6
- /***/ 7140:
6
+ /***/ 77140:
7
7
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8
8
 
9
9
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
10
  /* harmony export */ toFormData: () => (/* binding */ toFormData)
11
11
  /* harmony export */ });
12
- /* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9605);
13
- /* harmony import */ var formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4055);
12
+ /* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49605);
13
+ /* harmony import */ var formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14055);
14
14
 
15
15
 
16
16