create-faas-app 0.0.3-beta.86 → 0.0.3-beta.88

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.
@@ -0,0 +1,3 @@
1
+ declare const _default: Promise<void>;
2
+
3
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,41 +1,18 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
19
2
 
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- default: () => src_default
24
- });
25
- module.exports = __toCommonJS(src_exports);
26
- var import_commander = require("commander");
3
+ var commander$1 = require('commander');
4
+ var enquirer = require('enquirer');
5
+ var fs = require('fs');
6
+ var path = require('path');
7
+ var child_process = require('child_process');
27
8
 
28
- // src/action.ts
29
- var import_enquirer = require("enquirer");
30
- var import_fs = require("fs");
31
- var import_path = require("path");
32
- var import_child_process = require("child_process");
9
+ // src/index.ts
33
10
  var Validator = {
34
11
  name(input) {
35
12
  const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
36
13
  if (match !== true)
37
14
  return match;
38
- if ((0, import_fs.existsSync)(input))
15
+ if (fs.existsSync(input))
39
16
  return `${input} folder exists, please try another name`;
40
17
  return true;
41
18
  }
@@ -43,7 +20,7 @@ var Validator = {
43
20
  async function action(options = {}) {
44
21
  const answers = Object.assign(options, {});
45
22
  if (!options.name || Validator.name(options.name) !== true)
46
- answers.name = await (0, import_enquirer.prompt)({
23
+ answers.name = await enquirer.prompt({
47
24
  type: "input",
48
25
  name: "value",
49
26
  message: "Project name",
@@ -51,7 +28,7 @@ async function action(options = {}) {
51
28
  validate: Validator.name
52
29
  }).then((res) => res.value);
53
30
  if (typeof answers.example === "undefined")
54
- answers.example = await (0, import_enquirer.prompt)({
31
+ answers.example = await enquirer.prompt({
55
32
  type: "confirm",
56
33
  name: "value",
57
34
  message: "Add example files",
@@ -59,9 +36,9 @@ async function action(options = {}) {
59
36
  }).then((res) => res.value);
60
37
  if (!answers.name)
61
38
  return;
62
- (0, import_fs.mkdirSync)(answers.name);
63
- (0, import_fs.writeFileSync)(
64
- (0, import_path.join)(answers.name, "faas.yaml"),
39
+ fs.mkdirSync(answers.name);
40
+ fs.writeFileSync(
41
+ path.join(answers.name, "faas.yaml"),
65
42
  `defaults:
66
43
  plugins:
67
44
  development:
@@ -70,8 +47,8 @@ staging:
70
47
  production:
71
48
  `
72
49
  );
73
- (0, import_fs.writeFileSync)(
74
- (0, import_path.join)(answers.name, "package.json"),
50
+ fs.writeFileSync(
51
+ path.join(answers.name, "package.json"),
75
52
  `{
76
53
  "name": "${answers.name}",
77
54
  "version": "0.0.0",
@@ -113,7 +90,7 @@ production:
113
90
  }
114
91
  }`
115
92
  );
116
- (0, import_fs.writeFileSync)((0, import_path.join)(answers.name, "tsconfig.json"), `{
93
+ fs.writeFileSync(path.join(answers.name, "tsconfig.json"), `{
117
94
  "compilerOptions": {
118
95
  "downlevelIteration": true,
119
96
  "esModuleInterop": true,
@@ -124,14 +101,14 @@ production:
124
101
  }
125
102
  }
126
103
  `);
127
- (0, import_fs.writeFileSync)((0, import_path.join)(answers.name, ".gitignore"), `node_modules/
104
+ fs.writeFileSync(path.join(answers.name, ".gitignore"), `node_modules/
128
105
  tmp/
129
106
  coverage/
130
107
  *.tmp.js
131
108
  `);
132
- (0, import_fs.mkdirSync)((0, import_path.join)(answers.name, ".vscode"));
133
- (0, import_fs.writeFileSync)(
134
- (0, import_path.join)(answers.name, ".vscode", "settings.json"),
109
+ fs.mkdirSync(path.join(answers.name, ".vscode"));
110
+ fs.writeFileSync(
111
+ path.join(answers.name, ".vscode", "settings.json"),
135
112
  `{
136
113
  "editor.detectIndentation": true,
137
114
  "editor.insertSpaces": true,
@@ -147,8 +124,8 @@ coverage/
147
124
  }
148
125
  `
149
126
  );
150
- (0, import_fs.writeFileSync)(
151
- (0, import_path.join)(answers.name, ".vscode", "extensions.json"),
127
+ fs.writeFileSync(
128
+ path.join(answers.name, ".vscode", "extensions.json"),
152
129
  `{
153
130
  "recommendations": [
154
131
  "dbaeumer.vscode-eslint",
@@ -157,10 +134,10 @@ coverage/
157
134
  }
158
135
  `
159
136
  );
160
- (0, import_child_process.execSync)(`cd ${answers.name} && npm install`, { stdio: "inherit" });
137
+ child_process.execSync(`cd ${answers.name} && npm install`, { stdio: "inherit" });
161
138
  if (answers.example) {
162
- (0, import_fs.writeFileSync)(
163
- (0, import_path.join)(answers.name, "index.func.ts"),
139
+ fs.writeFileSync(
140
+ path.join(answers.name, "index.func.ts"),
164
141
  `import { useFunc } from '@faasjs/func'
165
142
  import { useHttp } from '@faasjs/http'
166
143
 
@@ -173,9 +150,9 @@ export default useFunc(function () {
173
150
  })
174
151
  `
175
152
  );
176
- (0, import_fs.mkdirSync)((0, import_path.join)(answers.name, "__tests__"));
177
- (0, import_fs.writeFileSync)(
178
- (0, import_path.join)(answers.name, "__tests__", "index.test.ts"),
153
+ fs.mkdirSync(path.join(answers.name, "__tests__"));
154
+ fs.writeFileSync(
155
+ path.join(answers.name, "__tests__", "index.test.ts"),
179
156
  `import { test } from '@faasjs/test'
180
157
 
181
158
  describe('hello', function () {
@@ -190,7 +167,7 @@ describe('hello', function () {
190
167
  })
191
168
  `
192
169
  );
193
- (0, import_child_process.execSync)(`cd ${answers.name} && npm exec jest`, { stdio: "inherit" });
170
+ child_process.execSync(`cd ${answers.name} && npm exec jest`, { stdio: "inherit" });
194
171
  }
195
172
  }
196
173
  function action_default(program) {
@@ -202,7 +179,7 @@ Examples:
202
179
  }
203
180
 
204
181
  // src/index.ts
205
- var commander = new import_commander.Command();
182
+ var commander = new commander$1.Command();
206
183
  commander.storeOptionsAsProperties(false).allowUnknownOption(true).version("beta").name("create-faas-app");
207
184
  action_default(commander);
208
185
  async function main() {
@@ -215,5 +192,5 @@ async function main() {
215
192
  }
216
193
  }
217
194
  var src_default = main();
218
- // Annotate the CommonJS export names for ESM import in node:
219
- 0 && (module.exports = {});
195
+
196
+ module.exports = src_default;
package/dist/index.mjs CHANGED
@@ -1,15 +1,10 @@
1
- // src/index.ts
2
- import { Command } from "commander";
1
+ import { Command } from 'commander';
2
+ import { prompt } from 'enquirer';
3
+ import { mkdirSync, writeFileSync, existsSync } from 'fs';
4
+ import { join } from 'path';
5
+ import { execSync } from 'child_process';
3
6
 
4
- // src/action.ts
5
- import { prompt } from "enquirer";
6
- import {
7
- mkdirSync,
8
- writeFileSync,
9
- existsSync
10
- } from "fs";
11
- import { join } from "path";
12
- import { execSync } from "child_process";
7
+ // src/index.ts
13
8
  var Validator = {
14
9
  name(input) {
15
10
  const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
@@ -195,6 +190,5 @@ async function main() {
195
190
  }
196
191
  }
197
192
  var src_default = main();
198
- export {
199
- src_default as default
200
- };
193
+
194
+ export { src_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-faas-app",
3
- "version": "0.0.3-beta.86",
3
+ "version": "0.0.3-beta.88",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "funding": "https://github.com/sponsors/faasjs",
19
19
  "scripts": {
20
- "build": "tsup-node src/index.ts --format esm,cjs --dts --clean"
20
+ "build": "tsup-node src/index.ts --config ../../tsup.config.json"
21
21
  },
22
22
  "files": [
23
23
  "dist",