@erwininteractive/mvc 0.1.1 → 0.1.2

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/cli.js CHANGED
@@ -9,7 +9,7 @@ const program = new commander_1.Command();
9
9
  program
10
10
  .name("erwinmvc")
11
11
  .description("CLI for @erwininteractive/mvc framework")
12
- .version("0.1.1");
12
+ .version("0.1.2");
13
13
  // Init command - scaffold a new application
14
14
  program
15
15
  .command("init <dir>")
@@ -8,6 +8,17 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const child_process_1 = require("child_process");
10
10
  const paths_1 = require("./paths");
11
+ // Get version from package.json
12
+ function getFrameworkVersion() {
13
+ try {
14
+ const pkgPath = path_1.default.join((0, paths_1.getPackageRoot)(), "package.json");
15
+ const pkg = JSON.parse(fs_1.default.readFileSync(pkgPath, "utf-8"));
16
+ return pkg.version || "0.1.1";
17
+ }
18
+ catch {
19
+ return "0.1.1";
20
+ }
21
+ }
11
22
  /**
12
23
  * Scaffold a new MVC application.
13
24
  */
@@ -21,21 +32,24 @@ async function initApp(dir, options = {}) {
21
32
  }
22
33
  // Copy app scaffold templates
23
34
  copyDirRecursive(templateDir, targetDir);
35
+ // Rename dotfiles (npm doesn't publish .gitignore, so we use gitignore.txt)
36
+ const gitignoreSrc = path_1.default.join(targetDir, "gitignore.txt");
37
+ const gitignoreDest = path_1.default.join(targetDir, ".gitignore");
38
+ if (fs_1.default.existsSync(gitignoreSrc)) {
39
+ fs_1.default.renameSync(gitignoreSrc, gitignoreDest);
40
+ }
24
41
  // Copy .env.example
25
42
  const envExample = (0, paths_1.getEnvExamplePath)();
26
43
  if (fs_1.default.existsSync(envExample)) {
27
44
  fs_1.default.copyFileSync(envExample, path_1.default.join(targetDir, ".env.example"));
28
45
  }
29
- // Update package.json with app name and framework path
46
+ // Update package.json with app name and framework version
30
47
  const appPackageJson = path_1.default.join(targetDir, "package.json");
31
48
  if (fs_1.default.existsSync(appPackageJson)) {
32
49
  const pkg = JSON.parse(fs_1.default.readFileSync(appPackageJson, "utf-8"));
33
50
  pkg.name = path_1.default.basename(dir);
34
- // Use relative path to framework for local development
35
- // When published, this would be the npm package version
36
- const frameworkRoot = (0, paths_1.getPackageRoot)();
37
- const relativePath = path_1.default.relative(targetDir, frameworkRoot);
38
- pkg.dependencies["@erwininteractive/mvc"] = `file:${relativePath}`;
51
+ // Use npm package version (not file path)
52
+ pkg.dependencies["@erwininteractive/mvc"] = `^${getFrameworkVersion()}`;
39
53
  fs_1.default.writeFileSync(appPackageJson, JSON.stringify(pkg, null, 2));
40
54
  }
41
55
  console.log("Application scaffolded successfully!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erwininteractive/mvc",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A lightweight, full-featured MVC framework for Node.js with Express, Prisma, and EJS",
5
5
  "main": "dist/framework/index.js",
6
6
  "types": "dist/framework/index.d.ts",
@@ -0,0 +1,8 @@
1
+ node_modules/
2
+ dist/
3
+ .env
4
+ .env.*
5
+ !.env.example
6
+ coverage/
7
+ npm-debug.log*
8
+ .DS_Store