shipd 0.1.2 → 0.1.3

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/dist/index.js +21 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -89,25 +89,25 @@ import { existsSync as existsSync2 } from "fs";
89
89
  import { join, resolve as resolve2, dirname } from "path";
90
90
  import { fileURLToPath } from "url";
91
91
  var __filename = fileURLToPath(import.meta.url);
92
- var __dirname2 = dirname(__filename);
92
+ var __dirname = dirname(__filename);
93
93
  function getTemplatePath() {
94
94
  const triedPaths = [];
95
- const bundledPath = resolve2(__dirname2, "../template");
95
+ const bundledPath = resolve2(__dirname, "../template");
96
96
  triedPaths.push(bundledPath);
97
97
  if (existsSync2(bundledPath)) {
98
98
  return bundledPath;
99
99
  }
100
- const distPath = resolve2(__dirname2, "../../template");
100
+ const distPath = resolve2(__dirname, "../../template");
101
101
  triedPaths.push(distPath);
102
102
  if (existsSync2(distPath)) {
103
103
  return distPath;
104
104
  }
105
- const srcPath = resolve2(__dirname2, "../../../template");
105
+ const srcPath = resolve2(__dirname, "../../../template");
106
106
  triedPaths.push(srcPath);
107
107
  if (existsSync2(srcPath)) {
108
108
  return srcPath;
109
109
  }
110
- let currentDir = __dirname2;
110
+ let currentDir = __dirname;
111
111
  for (let i = 0; i < 10; i++) {
112
112
  const pkgJsonPath = join(currentDir, "package.json");
113
113
  if (existsSync2(pkgJsonPath)) {
@@ -124,7 +124,7 @@ function getTemplatePath() {
124
124
  }
125
125
  currentDir = parentDir;
126
126
  }
127
- const absolutePath = resolve2(__dirname2, "../../../../packages/template");
127
+ const absolutePath = resolve2(__dirname, "../../../../packages/template");
128
128
  triedPaths.push(absolutePath);
129
129
  if (existsSync2(absolutePath)) {
130
130
  return absolutePath;
@@ -1026,9 +1026,12 @@ function createLogoutCommand() {
1026
1026
  // src/commands/append.ts
1027
1027
  import inquirer2 from "inquirer";
1028
1028
  import { existsSync as existsSync5 } from "fs";
1029
- import { join as join7, resolve as resolve4 } from "path";
1029
+ import { join as join7, resolve as resolve4, dirname as dirname2 } from "path";
1030
+ import { fileURLToPath as fileURLToPath2 } from "url";
1030
1031
  import ora3 from "ora";
1031
1032
  import fs4 from "fs-extra";
1033
+ var __filename2 = fileURLToPath2(import.meta.url);
1034
+ var __dirname2 = dirname2(__filename2);
1032
1035
  async function detectProject(cwd) {
1033
1036
  const pkgPath = join7(cwd, "package.json");
1034
1037
  if (!existsSync5(pkgPath)) {
@@ -1063,9 +1066,18 @@ async function detectProject(cwd) {
1063
1066
  };
1064
1067
  }
1065
1068
  async function appendDocsFeature(targetPath, dryRun = false) {
1066
- const docsSourcePath = resolve4(__dirname, "../../../docs-template");
1069
+ let docsSourcePath = resolve4(__dirname2, "../docs-template");
1067
1070
  if (!existsSync5(docsSourcePath)) {
1068
- throw new Error("Docs template not found. This might be a development environment issue.");
1071
+ docsSourcePath = resolve4(__dirname2, "../../docs-template");
1072
+ }
1073
+ if (!existsSync5(docsSourcePath)) {
1074
+ docsSourcePath = resolve4(__dirname2, "../../../docs-template");
1075
+ }
1076
+ if (!existsSync5(docsSourcePath)) {
1077
+ throw new Error(`Docs template not found. Tried paths:
1078
+ - ${resolve4(__dirname2, "../docs-template")}
1079
+ - ${resolve4(__dirname2, "../../docs-template")}
1080
+ - ${resolve4(__dirname2, "../../../docs-template")}`);
1069
1081
  }
1070
1082
  const spinner = ora3("Copying docs feature (pages + components)...").start();
1071
1083
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipd",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Generate production-ready SaaS applications with authentication, billing, and more",
5
5
  "type": "module",
6
6
  "bin": {