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 +1 -1
- package/README.md +1 -1
- package/dist/index.js +23 -14
- package/dist/templates/lib/api-client.ts +1 -1
- package/dist/templates/server/config/env.config.ts +1 -1
- package/dist/templates/server/entities/config.ts +1 -1
- package/dist/templates/server/entities/example.entity.ts +1 -1
- package/dist/templates/server/repositories/example.repository.ts +1 -1
- package/dist/templates/server/router.ts +2 -3
- package/dist/templates/server/routes/examples.ts +1 -1
- package/dist/templates/server/routes/health.ts +1 -1
- package/dist/templates/server/routes/root.ts +1 -1
- package/dist/templates/server/server.config.ts +2 -2
- package/package.json +3 -3
package/LICENSE
CHANGED
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
|
|
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.
|
|
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
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
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("
|
|
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)");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { examples } from './example.entity';
|
|
1
|
+
export { examples } from './example.entity';
|
|
@@ -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;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Server Configuration
|
|
3
3
|
*/
|
|
4
4
|
import { defineServerConfig } from '@spfn/core/server';
|
|
5
|
-
import { appRouter } from
|
|
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.
|
|
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@
|
|
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.
|
|
81
|
+
"@spfn/core": "0.2.0-beta.50"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "tsup && node scripts/copy-templates.js",
|