create-faas-app 6.6.0 → 6.7.0

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.
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ var enquirer = require('enquirer');
10
10
 
11
11
  // package.json
12
12
  var package_default = {
13
- version: "6.5.0"};
13
+ version: "6.6.0"};
14
14
  var Validator = {
15
15
  name(input) {
16
16
  const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
@@ -129,7 +129,7 @@ coverage/
129
129
  `import { useFunc } from '@faasjs/func'
130
130
  import { useHttp } from '@faasjs/http'
131
131
 
132
- export default useFunc(() => {
132
+ export const func = useFunc(() => {
133
133
  const http = useHttp<{ name: string }>()
134
134
 
135
135
  return async () => \`Hello, \${http.params.name}\`
@@ -140,13 +140,13 @@ export default useFunc(() => {
140
140
  fs.writeFileSync(
141
141
  path.join(answers.name, "__tests__", "index.test.ts"),
142
142
  `import { test } from '@faasjs/test'
143
- import Func from '../index.func'
143
+ import { func } from '../index.func'
144
144
 
145
145
  describe('hello', () => {
146
146
  it('should work', async () => {
147
- const func = test(Func)
147
+ const testFunc = test(func)
148
148
 
149
- const { statusCode, data } = await func.JSONhandler<string>({ name: 'world' })
149
+ const { statusCode, data } = await testFunc.JSONhandler<string>({ name: 'world' })
150
150
 
151
151
  expect(statusCode).toEqual(200)
152
152
  expect(data).toEqual('Hello, world')
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import { prompt } from 'enquirer';
8
8
 
9
9
  // package.json
10
10
  var package_default = {
11
- version: "6.5.0"};
11
+ version: "6.6.0"};
12
12
  var Validator = {
13
13
  name(input) {
14
14
  const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
@@ -127,7 +127,7 @@ coverage/
127
127
  `import { useFunc } from '@faasjs/func'
128
128
  import { useHttp } from '@faasjs/http'
129
129
 
130
- export default useFunc(() => {
130
+ export const func = useFunc(() => {
131
131
  const http = useHttp<{ name: string }>()
132
132
 
133
133
  return async () => \`Hello, \${http.params.name}\`
@@ -138,13 +138,13 @@ export default useFunc(() => {
138
138
  writeFileSync(
139
139
  join(answers.name, "__tests__", "index.test.ts"),
140
140
  `import { test } from '@faasjs/test'
141
- import Func from '../index.func'
141
+ import { func } from '../index.func'
142
142
 
143
143
  describe('hello', () => {
144
144
  it('should work', async () => {
145
- const func = test(Func)
145
+ const testFunc = test(func)
146
146
 
147
- const { statusCode, data } = await func.JSONhandler<string>({ name: 'world' })
147
+ const { statusCode, data } = await testFunc.JSONhandler<string>({ name: 'world' })
148
148
 
149
149
  expect(statusCode).toEqual(200)
150
150
  expect(data).toEqual('Hello, world')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-faas-app",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",