@tscircuit/cli 0.1.514 → 0.1.515
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/main.js +15 -15
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -72387,7 +72387,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
72387
72387
|
import { execSync as execSync2 } from "node:child_process";
|
|
72388
72388
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
72389
72389
|
// package.json
|
|
72390
|
-
var version = "0.1.
|
|
72390
|
+
var version = "0.1.514";
|
|
72391
72391
|
var package_default = {
|
|
72392
72392
|
name: "@tscircuit/cli",
|
|
72393
72393
|
version,
|
|
@@ -76783,6 +76783,7 @@ var pushSnippet = async ({
|
|
|
76783
76783
|
filePath,
|
|
76784
76784
|
isPrivate,
|
|
76785
76785
|
versionTag,
|
|
76786
|
+
log = console.log,
|
|
76786
76787
|
onExit = (code) => process.exit(code),
|
|
76787
76788
|
onError = (message) => console.error(message),
|
|
76788
76789
|
onSuccess = (message) => console.log(message)
|
|
@@ -76873,13 +76874,11 @@ var pushSnippet = async ({
|
|
|
76873
76874
|
packageVersion = lastKnownVersion;
|
|
76874
76875
|
}
|
|
76875
76876
|
const updatePackageJsonVersion = (newVersion) => {
|
|
76876
|
-
|
|
76877
|
-
|
|
76878
|
-
|
|
76879
|
-
|
|
76880
|
-
|
|
76881
|
-
onError(`Failed to update package.json version: ${error}`);
|
|
76882
|
-
}
|
|
76877
|
+
try {
|
|
76878
|
+
packageJson.version = newVersion ?? `${packageVersion}`;
|
|
76879
|
+
fs16.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
76880
|
+
} catch (error) {
|
|
76881
|
+
onError(`Failed to update package.json version: ${error}`);
|
|
76883
76882
|
}
|
|
76884
76883
|
};
|
|
76885
76884
|
const doesPackageExist = await ky2.post("packages/get", {
|
|
@@ -76922,7 +76921,7 @@ var pushSnippet = async ({
|
|
|
76922
76921
|
headers: { Authorization: `Bearer ${sessionToken}` }
|
|
76923
76922
|
}).json().then((response) => {
|
|
76924
76923
|
debug("createPackage", response);
|
|
76925
|
-
|
|
76924
|
+
log(`Package created`);
|
|
76926
76925
|
}).catch((error) => {
|
|
76927
76926
|
onError(`Error creating package: ${error}`);
|
|
76928
76927
|
return onExit(1);
|
|
@@ -76960,7 +76959,7 @@ var pushSnippet = async ({
|
|
|
76960
76959
|
onError(`Failed to increment version from ${packageVersion}`);
|
|
76961
76960
|
return onExit(1);
|
|
76962
76961
|
}
|
|
76963
|
-
|
|
76962
|
+
log(`Incrementing Package Version ${packageVersion} -> ${bumpedVersion}`);
|
|
76964
76963
|
packageVersion = bumpedVersion;
|
|
76965
76964
|
updatePackageJsonVersion(packageVersion);
|
|
76966
76965
|
releaseVersion = buildReleaseVersion(packageVersion);
|
|
@@ -76973,7 +76972,7 @@ var pushSnippet = async ({
|
|
|
76973
76972
|
onError(`Error creating release: ${error}`);
|
|
76974
76973
|
return onExit(1);
|
|
76975
76974
|
});
|
|
76976
|
-
|
|
76975
|
+
log(`
|
|
76977
76976
|
`);
|
|
76978
76977
|
const filePaths = getPackageFilePaths(projectDir);
|
|
76979
76978
|
for (const fullFilePath of filePaths) {
|
|
@@ -77000,7 +76999,7 @@ var pushSnippet = async ({
|
|
|
77000
76999
|
});
|
|
77001
77000
|
onSuccess([
|
|
77002
77001
|
kleur_default.green(`"${tsciPackageName}@${releaseVersion}" published!`),
|
|
77003
|
-
`https://tscircuit.com/${scopedPackageName}`
|
|
77002
|
+
kleur_default.underline(kleur_default.blue(`https://tscircuit.com/${scopedPackageName}`))
|
|
77004
77003
|
].join(`
|
|
77005
77004
|
`));
|
|
77006
77005
|
return onExit(0);
|
|
@@ -77605,11 +77604,12 @@ class DevServer {
|
|
|
77605
77604
|
filePath: this.componentFilePath,
|
|
77606
77605
|
onExit: () => {},
|
|
77607
77606
|
onError: (e) => {
|
|
77608
|
-
console.error("Failed to save
|
|
77607
|
+
console.error("Failed to save package:- ", e);
|
|
77609
77608
|
postEvent("FAILED_TO_SAVE_SNIPPET", e);
|
|
77610
77609
|
},
|
|
77611
|
-
onSuccess: () => {
|
|
77610
|
+
onSuccess: (message) => {
|
|
77612
77611
|
postEvent("SNIPPET_SAVED");
|
|
77612
|
+
console.log(message);
|
|
77613
77613
|
}
|
|
77614
77614
|
});
|
|
77615
77615
|
}
|
|
@@ -94980,7 +94980,7 @@ var registerAuthWhoami = (program3) => {
|
|
|
94980
94980
|
|
|
94981
94981
|
// cli/push/register.ts
|
|
94982
94982
|
var registerPush = (program3) => {
|
|
94983
|
-
program3.command("push").description("Save
|
|
94983
|
+
program3.command("push").description("Save package code to Registry API").argument("[file]", "Path to the package file").option("--private", "Make the package private").option("--version-tag <tag>", "Publish as a non-latest version using the provided tag").action(async (filePath, options = {}) => {
|
|
94984
94984
|
await pushSnippet({
|
|
94985
94985
|
filePath,
|
|
94986
94986
|
isPrivate: options.private ?? false,
|