@podosoft/podokit 0.12.0 → 0.12.1

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/update.js +19 -1
  2. package/package.json +1 -1
package/dist/update.js CHANGED
@@ -124,6 +124,20 @@ function planUpdate(projectRoot, templatesDir) {
124
124
  changes,
125
125
  };
126
126
  }
127
+ function assertPreviousExternalModulesInstalled(projectRoot, templatesDir, modules) {
128
+ const modulesDir = (0, node_path_1.join)(templatesDir, "modules");
129
+ for (const module of modules) {
130
+ if (!module.packageName || !module.moduleVersion)
131
+ continue;
132
+ const resolved = (0, add_1.resolveModule)(module.packageName, modulesDir, projectRoot);
133
+ if (!resolved?.moduleVersion || resolved.moduleVersion === module.moduleVersion)
134
+ continue;
135
+ throw new Error(`Cannot use --from while external module "${module.packageName}" is installed at ` +
136
+ `${resolved.moduleVersion} but the project records ${module.moduleVersion}. Restore ` +
137
+ `${module.packageName}@${module.moduleVersion}, update PodoKit with --from, then upgrade ` +
138
+ "external modules separately.");
139
+ }
140
+ }
127
141
  function writeFile(projectRoot, path, content) {
128
142
  const abs = (0, node_path_1.join)(projectRoot, path);
129
143
  (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(abs), { recursive: true });
@@ -188,7 +202,11 @@ function applyUpdate(projectRoot, templatesDir, options = {}) {
188
202
  });
189
203
  const managedOverrides = targetManagedOverrides(projectRoot, templatesDir, modules, manifest.managedOverrides);
190
204
  const ownedGlobs = targetOwnedGlobs(projectRoot, templatesDir, modules, manifest.ownedGlobs);
191
- const oldTree = options.oldTemplatesDir
205
+ const needsMergeBase = plan.changes.some((change) => change.action === "conflict");
206
+ if (options.oldTemplatesDir && needsMergeBase) {
207
+ assertPreviousExternalModulesInstalled(projectRoot, templatesDir, modules);
208
+ }
209
+ const oldTree = options.oldTemplatesDir && needsMergeBase
192
210
  ? (0, assemble_1.assembleProject)({
193
211
  templatesDir: options.oldTemplatesDir,
194
212
  template: manifest.template,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podosoft/podokit",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "An opinionated but extensible starter toolkit and CLI for full-stack TypeScript apps with NestJS, SvelteKit, TailwindCSS, shadcn-svelte, Docker, and k3s.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {