@topogram/cli 0.3.69 → 0.3.70
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/package.json
CHANGED
|
@@ -92,7 +92,7 @@ function diagnosticForTemplateCreateFailure(message, templateSpec, step) {
|
|
|
92
92
|
step
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
if (message.includes("is missing topo/")
|
|
95
|
+
if (message.includes("is missing topo/")) {
|
|
96
96
|
return templateCheckDiagnostic({
|
|
97
97
|
code: "template_topogram_missing",
|
|
98
98
|
message,
|
|
@@ -53,7 +53,7 @@ export function createNewProject({
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
ensureCreatableProjectRoot(projectRoot);
|
|
56
|
-
|
|
56
|
+
copyTopogramWorkspace(template.root, projectRoot);
|
|
57
57
|
const projectConfig = writeProjectTemplateMetadata(projectRoot, template, templateProvenance);
|
|
58
58
|
writeProjectPackage(projectRoot, engineRoot, template);
|
|
59
59
|
writeExplainScript(projectRoot);
|
|
@@ -64,12 +64,6 @@ export function createNewProject({
|
|
|
64
64
|
writeGeneratorPolicy(projectRoot, defaultGeneratorPolicy());
|
|
65
65
|
|
|
66
66
|
const warnings = [];
|
|
67
|
-
if (workspaceCopy.legacyWorkspace) {
|
|
68
|
-
warnings.push(
|
|
69
|
-
`Template '${template.manifest.id}' still ships legacy topogram/ source. Copied it into this project as ${DEFAULT_TOPO_FOLDER_NAME}/. ` +
|
|
70
|
-
"This one-release package-ingress bridge will be removed after first-party packages migrate."
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
67
|
if (template.manifest.includesExecutableImplementation) {
|
|
74
68
|
writeTemplateTrustRecord(projectRoot, projectConfig);
|
|
75
69
|
warnings.push(
|
|
@@ -55,7 +55,7 @@ export function ensureCreatableProjectRoot(projectRoot) {
|
|
|
55
55
|
/**
|
|
56
56
|
* @param {string} templateRoot
|
|
57
57
|
* @param {string} projectRoot
|
|
58
|
-
* @returns {
|
|
58
|
+
* @returns {void}
|
|
59
59
|
*/
|
|
60
60
|
export function copyTopogramWorkspace(templateRoot, projectRoot) {
|
|
61
61
|
const templateWorkspace = resolvePackageWorkspace(templateRoot);
|
|
@@ -74,7 +74,6 @@ export function copyTopogramWorkspace(templateRoot, projectRoot) {
|
|
|
74
74
|
{ recursive: true }
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
return { legacyWorkspace: templateWorkspace.legacy };
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
/**
|
|
@@ -6,7 +6,7 @@ import os from "node:os";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
|
|
8
8
|
import { assertSafeNpmSpec, localNpmrcEnv } from "../npm-safety.js";
|
|
9
|
-
import { DEFAULT_TOPO_FOLDER_NAME,
|
|
9
|
+
import { DEFAULT_TOPO_FOLDER_NAME, resolvePackageWorkspace } from "../workspace-paths.js";
|
|
10
10
|
import { GENERATOR_LABELS, SURFACE_ORDER, TEMPLATE_MANIFEST, unsupportedTemplateSymlinkMessage } from "./constants.js";
|
|
11
11
|
import { isLocalTemplateSpec, packageNameFromSpec } from "./package-spec.js";
|
|
12
12
|
|
|
@@ -111,7 +111,7 @@ export function validateTemplateRoot(templateRoot) {
|
|
|
111
111
|
const topogramRoot = workspace.root;
|
|
112
112
|
const projectConfigPath = path.join(templateRoot, "topogram.project.json");
|
|
113
113
|
if (fs.existsSync(topogramRoot) && fs.lstatSync(topogramRoot).isSymbolicLink()) {
|
|
114
|
-
throw new Error(unsupportedTemplateSymlinkMessage(manifest.id,
|
|
114
|
+
throw new Error(unsupportedTemplateSymlinkMessage(manifest.id, DEFAULT_TOPO_FOLDER_NAME));
|
|
115
115
|
}
|
|
116
116
|
if (fs.existsSync(projectConfigPath) && fs.lstatSync(projectConfigPath).isSymbolicLink()) {
|
|
117
117
|
throw new Error(unsupportedTemplateSymlinkMessage(manifest.id, "topogram.project.json"));
|
|
@@ -122,7 +122,7 @@ export function validateTemplateRoot(templateRoot) {
|
|
|
122
122
|
if (!fs.existsSync(projectConfigPath) || !fs.statSync(projectConfigPath).isFile()) {
|
|
123
123
|
throw new Error(`Template '${manifest.id}' is missing topogram.project.json.`);
|
|
124
124
|
}
|
|
125
|
-
assertTemplateTreeHasNoSymlinks(templateRoot, topogramRoot,
|
|
125
|
+
assertTemplateTreeHasNoSymlinks(templateRoot, topogramRoot, DEFAULT_TOPO_FOLDER_NAME, manifest.id);
|
|
126
126
|
if (manifest.includesExecutableImplementation) {
|
|
127
127
|
const implementationRoot = path.join(templateRoot, "implementation");
|
|
128
128
|
if (fs.existsSync(implementationRoot) && fs.lstatSync(implementationRoot).isSymbolicLink()) {
|
package/src/workspace-paths.js
CHANGED
|
@@ -313,16 +313,12 @@ export function resolveTopoRoot(inputPath = ".") {
|
|
|
313
313
|
|
|
314
314
|
/**
|
|
315
315
|
* @param {string} packageRoot
|
|
316
|
-
* @returns {{ root: string
|
|
316
|
+
* @returns {{ root: string }}
|
|
317
317
|
*/
|
|
318
318
|
export function resolvePackageWorkspace(packageRoot) {
|
|
319
319
|
const topoRoot = path.join(packageRoot, DEFAULT_TOPO_FOLDER_NAME);
|
|
320
320
|
if (isDirectory(topoRoot)) {
|
|
321
|
-
return { root: topoRoot
|
|
322
|
-
}
|
|
323
|
-
const legacyRoot = path.join(packageRoot, LEGACY_TOPOGRAM_FOLDER_NAME);
|
|
324
|
-
if (isDirectory(legacyRoot)) {
|
|
325
|
-
return { root: legacyRoot, legacy: true };
|
|
321
|
+
return { root: topoRoot };
|
|
326
322
|
}
|
|
327
323
|
throw new Error(`Package is missing ${DEFAULT_TOPO_FOLDER_NAME}/.`);
|
|
328
324
|
}
|