spfn 0.2.0-beta.48 → 0.2.0-beta.49

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 INFLIKE Inc.
3
+ Copyright (c) 2025 FXY Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -18,7 +18,7 @@ pnpm dlx spfn@beta <command>
18
18
  Or add it as a project dependency (`spfn init`/`spfn create` do this for you), then
19
19
  call it via `pnpm spfn <command>` / `npm run spfn:<script>`.
20
20
 
21
- Requirements: Node.js 22+, Next.js 15+ (App Router, `src/` dir), PostgreSQL (Redis optional).
21
+ Requirements: Node.js 18.18+, Next.js 15+ (App Router, `src/` dir), PostgreSQL (Redis optional).
22
22
 
23
23
  ## Usage
24
24
 
package/dist/index.js CHANGED
@@ -789,7 +789,7 @@ var init_deployment_config = __esm({
789
789
 
790
790
  // src/utils/version.ts
791
791
  function getCliVersion() {
792
- return "0.2.0-beta.48";
792
+ return "0.2.0-beta.49";
793
793
  }
794
794
  function getTagFromVersion(version) {
795
795
  const match = version.match(/-([a-z]+)\./i);
@@ -2050,20 +2050,29 @@ async function initCodegen(options) {
2050
2050
  logger.info("Edit manually to add custom generators");
2051
2051
  process.exit(0);
2052
2052
  }
2053
- const config = {
2054
- codegen: {
2055
- generators: [
2056
- {
2057
- name: "@spfn/core:contract",
2058
- enabled: true
2059
- }
2060
- ]
2061
- }
2062
- };
2063
- writeFileSync9(rcPath, JSON.stringify(config, null, 2) + "\n");
2053
+ const content = `import { defineConfig, defineGenerator } from '@spfn/core/codegen';
2054
+
2055
+ /**
2056
+ * SPFN Codegen Configuration
2057
+ *
2058
+ * Configure code generators here. Generators run during \`spfn dev\` and \`spfn codegen run\`.
2059
+ */
2060
+
2061
+ export default defineConfig({
2062
+ generators: [
2063
+ // Route map generator - generates routeName \u2192 {method, path} mappings
2064
+ // Used by RPC proxy to resolve routes without importing server code
2065
+ defineGenerator({
2066
+ name: '@spfn/core:route-map',
2067
+ routerPath: './src/server/router.ts',
2068
+ outputPath: './src/generated/route-map.ts',
2069
+ }),
2070
+ ],
2071
+ });
2072
+ `;
2073
+ writeFileSync9(rcPath, content);
2064
2074
  console.log("\n" + chalk7.green.bold("\u2713 Created .spfnrc.ts\n"));
2065
- console.log("Configuration:");
2066
- console.log(chalk7.gray(JSON.stringify(config, null, 2)));
2075
+ console.log(chalk7.gray("Configured the @spfn/core:route-map generator."));
2067
2076
  if (options.withExample) {
2068
2077
  console.log("\n" + chalk7.yellow("\u{1F4DD} To add custom generators:"));
2069
2078
  console.log(" 1. Create your generator file (e.g., src/generators/my-generator.ts)");
@@ -77,4 +77,4 @@ export const api = createApi<AppRouter>({
77
77
  * @default false
78
78
  */
79
79
  debug: process.env.NODE_ENV === 'development',
80
- });
80
+ });
@@ -55,4 +55,4 @@ export const envSchema = defineEnvSchema({
55
55
  */
56
56
  export const env = createEnvRegistry(envSchema).validate();
57
57
 
58
- export default env;
58
+ export default env;
@@ -1 +1 @@
1
- export { examples } from './example.entity';
1
+ export { examples } from './example.entity';
@@ -9,4 +9,4 @@ export const examples = pgTable('examples', {
9
9
  });
10
10
 
11
11
  export type Example = typeof examples.$inferSelect;
12
- export type NewExample = typeof examples.$inferInsert;
12
+ export type NewExample = typeof examples.$inferInsert;
@@ -37,4 +37,4 @@ export class ExampleRepository extends BaseRepository
37
37
  {
38
38
  return await this._count(examples);
39
39
  }
40
- }
40
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Application Router
4
3
  *
@@ -20,10 +19,10 @@ export const appRouter = defineRouter({
20
19
  getExample,
21
20
  createExample,
22
21
  updateExample,
23
- deleteExample
22
+ deleteExample,
24
23
  });
25
24
 
26
25
  /**
27
26
  * Router type for client usage
28
27
  */
29
- export type AppRouter = typeof appRouter;
28
+ export type AppRouter = typeof appRouter;
@@ -127,4 +127,4 @@ export const deleteExample = route.delete('/examples/:id')
127
127
  success: true,
128
128
  id: params.id,
129
129
  };
130
- });
130
+ });
@@ -15,4 +15,4 @@ export const getHealth = route.get('/health')
15
15
  timestamp: Date.now(),
16
16
  uptime: process.uptime(),
17
17
  };
18
- });
18
+ });
@@ -19,4 +19,4 @@ export const getRoot = route.get('/')
19
19
  },
20
20
  message: 'Welcome to SPFN! Visit /examples for usage examples.',
21
21
  };
22
- });
22
+ });
@@ -2,10 +2,10 @@
2
2
  * Server Configuration
3
3
  */
4
4
  import { defineServerConfig } from '@spfn/core/server';
5
- import { appRouter } from "@/server/router";
5
+ import { appRouter } from '@/server/router';
6
6
 
7
7
  export default defineServerConfig()
8
8
  .port(8790)
9
9
  .host('0.0.0.0')
10
10
  .routes(appRouter)
11
- .build();
11
+ .build();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spfn",
3
- "version": "0.2.0-beta.48",
3
+ "version": "0.2.0-beta.49",
4
4
  "description": "Superfunction CLI - Add SPFN to your Next.js project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "typescript",
28
28
  "type-safe"
29
29
  ],
30
- "author": "Ray Im <rayim@inflike.com>",
30
+ "author": "Ray Im <rayim@fxy.global>",
31
31
  "license": "MIT",
32
32
  "repository": {
33
33
  "type": "git",
@@ -78,7 +78,7 @@
78
78
  "concurrently": "^9.2.1",
79
79
  "tsx": "^4.20.6",
80
80
  "typescript": "^5.3.3",
81
- "@spfn/core": "0.2.0-beta.49"
81
+ "@spfn/core": "0.2.0-beta.50"
82
82
  },
83
83
  "scripts": {
84
84
  "build": "tsup && node scripts/copy-templates.js",