@mauroandre/velojs 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mauroandre/velojs",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "description": "Fullstack web framework built on Hono + Preact with Vite-powered AST transforms",
6
6
  "keywords": [
package/src/init.ts CHANGED
@@ -1,8 +1,16 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
3
4
 
4
5
  const PACKAGE_NAME = "@mauroandre/velojs";
5
6
 
7
+ function getPackageVersion(): string {
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+ const pkgPath = path.resolve(__dirname, "../package.json");
10
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
11
+ return pkg.version;
12
+ }
13
+
6
14
  const templates: Record<string, string> = {
7
15
  "package.json": `{
8
16
  "name": "my-velojs-app",
@@ -14,7 +22,7 @@ const templates: Record<string, string> = {
14
22
  "start": "velojs start"
15
23
  },
16
24
  "dependencies": {
17
- "${PACKAGE_NAME}": "latest"
25
+ "${PACKAGE_NAME}": "^${getPackageVersion()}"
18
26
  },
19
27
  "devDependencies": {
20
28
  "@types/node": "latest",