create-faas-app 8.0.0-beta.4 → 8.0.0-beta.5

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: "v8.0.0-beta.3"};
13
+ version: "v8.0.0-beta.4"};
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 -_";
@@ -34,13 +34,14 @@ function buildPackageJSON(name) {
34
34
  type: "module",
35
35
  version: "1.0.0",
36
36
  scripts: {
37
- dev: "faas dev",
38
- build: "faas build",
39
- start: "faas start",
40
- check: "faas check",
37
+ dev: "vite",
38
+ build: "vite build",
39
+ start: "node server.ts",
40
+ check: "tsc --noEmit && biome check .",
41
41
  test: "vitest run"
42
42
  },
43
43
  dependencies: {
44
+ "@faasjs/func": "*",
44
45
  "@faasjs/http": "*",
45
46
  faasjs: "*",
46
47
  react: "*",
@@ -49,9 +50,8 @@ function buildPackageJSON(name) {
49
50
  },
50
51
  devDependencies: {
51
52
  "@biomejs/biome": "*",
53
+ "@faasjs/dev": "*",
52
54
  "@faasjs/lint": "*",
53
- "@faasjs/test": "*",
54
- "@faasjs/vite": "*",
55
55
  "@types/node": "*",
56
56
  "@types/react": "*",
57
57
  "@types/react-dom": "*",
@@ -115,7 +115,7 @@ coverage/
115
115
  );
116
116
  writeFile(
117
117
  path.join(rootPath, "vite.config.ts"),
118
- `import { viteFaasJsServer } from '@faasjs/vite'
118
+ `import { viteFaasJsServer } from '@faasjs/dev'
119
119
  import react from '@vitejs/plugin-react'
120
120
  import { defineConfig } from 'vite'
121
121
 
@@ -231,7 +231,7 @@ export default function HomePage() {
231
231
  );
232
232
  writeFile(
233
233
  path.join(rootPath, "src", "pages", "home", "api", "hello.func.ts"),
234
- `import { useHttpFunc } from '@faasjs/http'
234
+ `import { defineFunc } from '@faasjs/func'
235
235
  import { z } from 'zod'
236
236
 
237
237
  const schema = z
@@ -240,9 +240,9 @@ const schema = z
240
240
  })
241
241
  .required()
242
242
 
243
- export const func = useHttpFunc<z.infer<typeof schema>>(() => {
244
- return async ({ params }) => {
245
- const parsed = schema.parse(params || {})
243
+ export const func = defineFunc<{ params?: z.infer<typeof schema> }>(
244
+ async ({ event }) => {
245
+ const parsed = schema.parse(event.params || {})
246
246
 
247
247
  return {
248
248
  ok: true,
@@ -250,12 +250,12 @@ export const func = useHttpFunc<z.infer<typeof schema>>(() => {
250
250
  error: null,
251
251
  }
252
252
  }
253
- })
253
+ )
254
254
  `
255
255
  );
256
256
  writeFile(
257
257
  path.join(rootPath, "src", "pages", "home", "api", "__tests__", "hello.test.ts"),
258
- `import { test } from '@faasjs/test'
258
+ `import { test } from '@faasjs/dev'
259
259
  import { func } from '../hello.func'
260
260
 
261
261
  describe('home/api/hello', () => {
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: "v8.0.0-beta.3"};
11
+ version: "v8.0.0-beta.4"};
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 -_";
@@ -32,13 +32,14 @@ function buildPackageJSON(name) {
32
32
  type: "module",
33
33
  version: "1.0.0",
34
34
  scripts: {
35
- dev: "faas dev",
36
- build: "faas build",
37
- start: "faas start",
38
- check: "faas check",
35
+ dev: "vite",
36
+ build: "vite build",
37
+ start: "node server.ts",
38
+ check: "tsc --noEmit && biome check .",
39
39
  test: "vitest run"
40
40
  },
41
41
  dependencies: {
42
+ "@faasjs/func": "*",
42
43
  "@faasjs/http": "*",
43
44
  faasjs: "*",
44
45
  react: "*",
@@ -47,9 +48,8 @@ function buildPackageJSON(name) {
47
48
  },
48
49
  devDependencies: {
49
50
  "@biomejs/biome": "*",
51
+ "@faasjs/dev": "*",
50
52
  "@faasjs/lint": "*",
51
- "@faasjs/test": "*",
52
- "@faasjs/vite": "*",
53
53
  "@types/node": "*",
54
54
  "@types/react": "*",
55
55
  "@types/react-dom": "*",
@@ -113,7 +113,7 @@ coverage/
113
113
  );
114
114
  writeFile(
115
115
  join(rootPath, "vite.config.ts"),
116
- `import { viteFaasJsServer } from '@faasjs/vite'
116
+ `import { viteFaasJsServer } from '@faasjs/dev'
117
117
  import react from '@vitejs/plugin-react'
118
118
  import { defineConfig } from 'vite'
119
119
 
@@ -229,7 +229,7 @@ export default function HomePage() {
229
229
  );
230
230
  writeFile(
231
231
  join(rootPath, "src", "pages", "home", "api", "hello.func.ts"),
232
- `import { useHttpFunc } from '@faasjs/http'
232
+ `import { defineFunc } from '@faasjs/func'
233
233
  import { z } from 'zod'
234
234
 
235
235
  const schema = z
@@ -238,9 +238,9 @@ const schema = z
238
238
  })
239
239
  .required()
240
240
 
241
- export const func = useHttpFunc<z.infer<typeof schema>>(() => {
242
- return async ({ params }) => {
243
- const parsed = schema.parse(params || {})
241
+ export const func = defineFunc<{ params?: z.infer<typeof schema> }>(
242
+ async ({ event }) => {
243
+ const parsed = schema.parse(event.params || {})
244
244
 
245
245
  return {
246
246
  ok: true,
@@ -248,12 +248,12 @@ export const func = useHttpFunc<z.infer<typeof schema>>(() => {
248
248
  error: null,
249
249
  }
250
250
  }
251
- })
251
+ )
252
252
  `
253
253
  );
254
254
  writeFile(
255
255
  join(rootPath, "src", "pages", "home", "api", "__tests__", "hello.test.ts"),
256
- `import { test } from '@faasjs/test'
256
+ `import { test } from '@faasjs/dev'
257
257
  import { func } from '../hello.func'
258
258
 
259
259
  describe('home/api/hello', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-faas-app",
3
- "version": "v8.0.0-beta.4",
3
+ "version": "v8.0.0-beta.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",