@tscircuit/cli 0.1.1309 → 0.1.1310
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/main.js +37 -10
- package/dist/lib/index.js +37 -10
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -100574,7 +100574,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
100574
100574
|
// lib/getVersion.ts
|
|
100575
100575
|
import { createRequire as createRequire2 } from "node:module";
|
|
100576
100576
|
// package.json
|
|
100577
|
-
var version = "0.1.
|
|
100577
|
+
var version = "0.1.1309";
|
|
100578
100578
|
var package_default = {
|
|
100579
100579
|
name: "@tscircuit/cli",
|
|
100580
100580
|
version,
|
|
@@ -246032,6 +246032,38 @@ var hasBinaryContent = (content) => {
|
|
|
246032
246032
|
// lib/shared/push-snippet.ts
|
|
246033
246033
|
var import_jszip4 = __toESM2(require_lib4(), 1);
|
|
246034
246034
|
var debug11 = Debug2("tsci:push-snippet");
|
|
246035
|
+
var findPushProject = async ({
|
|
246036
|
+
filePath,
|
|
246037
|
+
onError
|
|
246038
|
+
}) => {
|
|
246039
|
+
if (filePath) {
|
|
246040
|
+
const snippetFilePath2 = await getEntrypoint({
|
|
246041
|
+
filePath,
|
|
246042
|
+
onSuccess: () => {},
|
|
246043
|
+
onError
|
|
246044
|
+
});
|
|
246045
|
+
if (!snippetFilePath2) {
|
|
246046
|
+
return null;
|
|
246047
|
+
}
|
|
246048
|
+
const packageJsonPath2 = [
|
|
246049
|
+
path52.resolve(path52.join(path52.dirname(snippetFilePath2), "package.json")),
|
|
246050
|
+
path52.resolve(path52.join(process.cwd(), "package.json"))
|
|
246051
|
+
].find((candidatePath) => fs49.existsSync(candidatePath));
|
|
246052
|
+
const projectDir2 = packageJsonPath2 ? path52.dirname(packageJsonPath2) : path52.dirname(snippetFilePath2);
|
|
246053
|
+
return { snippetFilePath: snippetFilePath2, packageJsonPath: packageJsonPath2, projectDir: projectDir2 };
|
|
246054
|
+
}
|
|
246055
|
+
const projectDir = process.cwd();
|
|
246056
|
+
const packageJsonPath = path52.resolve(path52.join(projectDir, "package.json"));
|
|
246057
|
+
if (!fs49.existsSync(packageJsonPath)) {
|
|
246058
|
+
return { projectDir };
|
|
246059
|
+
}
|
|
246060
|
+
const snippetFilePath = await getEntrypoint({
|
|
246061
|
+
projectDir,
|
|
246062
|
+
onSuccess: () => {},
|
|
246063
|
+
onError: () => {}
|
|
246064
|
+
}) ?? undefined;
|
|
246065
|
+
return { snippetFilePath, packageJsonPath, projectDir };
|
|
246066
|
+
};
|
|
246035
246067
|
var getArchivePayload = async (filePaths, projectDir, packageNameWithVersion) => {
|
|
246036
246068
|
const zip = new import_jszip4.default;
|
|
246037
246069
|
for (const fullFilePath of filePaths) {
|
|
@@ -246065,19 +246097,14 @@ var pushSnippet = async ({
|
|
|
246065
246097
|
onError("You need to log in to save package. Run 'tsci login' to authenticate.");
|
|
246066
246098
|
return onExit(1);
|
|
246067
246099
|
}
|
|
246068
|
-
const
|
|
246100
|
+
const pushProject = await findPushProject({
|
|
246069
246101
|
filePath,
|
|
246070
|
-
onSuccess: () => {},
|
|
246071
246102
|
onError
|
|
246072
246103
|
});
|
|
246073
|
-
if (!
|
|
246104
|
+
if (!pushProject) {
|
|
246074
246105
|
return onExit(1);
|
|
246075
246106
|
}
|
|
246076
|
-
const packageJsonPath =
|
|
246077
|
-
path52.resolve(path52.join(path52.dirname(snippetFilePath), "package.json")),
|
|
246078
|
-
path52.resolve(path52.join(process.cwd(), "package.json"))
|
|
246079
|
-
].find((path53) => fs49.existsSync(path53));
|
|
246080
|
-
const projectDir = packageJsonPath ? path52.dirname(packageJsonPath) : path52.dirname(snippetFilePath);
|
|
246107
|
+
const { snippetFilePath, packageJsonPath, projectDir } = pushProject;
|
|
246081
246108
|
if (!packageJsonPath) {
|
|
246082
246109
|
onError("No package.json found, try running 'tsci init' to bootstrap the project");
|
|
246083
246110
|
return onExit(1);
|
|
@@ -246091,7 +246118,7 @@ var pushSnippet = async ({
|
|
|
246091
246118
|
return onExit(1);
|
|
246092
246119
|
}
|
|
246093
246120
|
}
|
|
246094
|
-
if (!fs49.existsSync(snippetFilePath)) {
|
|
246121
|
+
if (snippetFilePath && !fs49.existsSync(snippetFilePath)) {
|
|
246095
246122
|
onError(`File not found: ${snippetFilePath}`);
|
|
246096
246123
|
return onExit(1);
|
|
246097
246124
|
}
|
package/dist/lib/index.js
CHANGED
|
@@ -65661,7 +65661,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65661
65661
|
}));
|
|
65662
65662
|
};
|
|
65663
65663
|
// package.json
|
|
65664
|
-
var version = "0.1.
|
|
65664
|
+
var version = "0.1.1309";
|
|
65665
65665
|
var package_default = {
|
|
65666
65666
|
name: "@tscircuit/cli",
|
|
65667
65667
|
version,
|
|
@@ -77783,6 +77783,38 @@ var hasBinaryContent = (content) => {
|
|
|
77783
77783
|
// lib/shared/push-snippet.ts
|
|
77784
77784
|
var import_jszip2 = __toESM2(require_lib3(), 1);
|
|
77785
77785
|
var debug = Debug("tsci:push-snippet");
|
|
77786
|
+
var findPushProject = async ({
|
|
77787
|
+
filePath,
|
|
77788
|
+
onError
|
|
77789
|
+
}) => {
|
|
77790
|
+
if (filePath) {
|
|
77791
|
+
const snippetFilePath2 = await getEntrypoint({
|
|
77792
|
+
filePath,
|
|
77793
|
+
onSuccess: () => {},
|
|
77794
|
+
onError
|
|
77795
|
+
});
|
|
77796
|
+
if (!snippetFilePath2) {
|
|
77797
|
+
return null;
|
|
77798
|
+
}
|
|
77799
|
+
const packageJsonPath2 = [
|
|
77800
|
+
path25.resolve(path25.join(path25.dirname(snippetFilePath2), "package.json")),
|
|
77801
|
+
path25.resolve(path25.join(process.cwd(), "package.json"))
|
|
77802
|
+
].find((candidatePath) => fs24.existsSync(candidatePath));
|
|
77803
|
+
const projectDir2 = packageJsonPath2 ? path25.dirname(packageJsonPath2) : path25.dirname(snippetFilePath2);
|
|
77804
|
+
return { snippetFilePath: snippetFilePath2, packageJsonPath: packageJsonPath2, projectDir: projectDir2 };
|
|
77805
|
+
}
|
|
77806
|
+
const projectDir = process.cwd();
|
|
77807
|
+
const packageJsonPath = path25.resolve(path25.join(projectDir, "package.json"));
|
|
77808
|
+
if (!fs24.existsSync(packageJsonPath)) {
|
|
77809
|
+
return { projectDir };
|
|
77810
|
+
}
|
|
77811
|
+
const snippetFilePath = await getEntrypoint({
|
|
77812
|
+
projectDir,
|
|
77813
|
+
onSuccess: () => {},
|
|
77814
|
+
onError: () => {}
|
|
77815
|
+
}) ?? undefined;
|
|
77816
|
+
return { snippetFilePath, packageJsonPath, projectDir };
|
|
77817
|
+
};
|
|
77786
77818
|
var getArchivePayload = async (filePaths, projectDir, packageNameWithVersion) => {
|
|
77787
77819
|
const zip = new import_jszip2.default;
|
|
77788
77820
|
for (const fullFilePath of filePaths) {
|
|
@@ -77816,19 +77848,14 @@ var pushSnippet = async ({
|
|
|
77816
77848
|
onError("You need to log in to save package. Run 'tsci login' to authenticate.");
|
|
77817
77849
|
return onExit(1);
|
|
77818
77850
|
}
|
|
77819
|
-
const
|
|
77851
|
+
const pushProject = await findPushProject({
|
|
77820
77852
|
filePath,
|
|
77821
|
-
onSuccess: () => {},
|
|
77822
77853
|
onError
|
|
77823
77854
|
});
|
|
77824
|
-
if (!
|
|
77855
|
+
if (!pushProject) {
|
|
77825
77856
|
return onExit(1);
|
|
77826
77857
|
}
|
|
77827
|
-
const packageJsonPath =
|
|
77828
|
-
path25.resolve(path25.join(path25.dirname(snippetFilePath), "package.json")),
|
|
77829
|
-
path25.resolve(path25.join(process.cwd(), "package.json"))
|
|
77830
|
-
].find((path26) => fs24.existsSync(path26));
|
|
77831
|
-
const projectDir = packageJsonPath ? path25.dirname(packageJsonPath) : path25.dirname(snippetFilePath);
|
|
77858
|
+
const { snippetFilePath, packageJsonPath, projectDir } = pushProject;
|
|
77832
77859
|
if (!packageJsonPath) {
|
|
77833
77860
|
onError("No package.json found, try running 'tsci init' to bootstrap the project");
|
|
77834
77861
|
return onExit(1);
|
|
@@ -77842,7 +77869,7 @@ var pushSnippet = async ({
|
|
|
77842
77869
|
return onExit(1);
|
|
77843
77870
|
}
|
|
77844
77871
|
}
|
|
77845
|
-
if (!fs24.existsSync(snippetFilePath)) {
|
|
77872
|
+
if (snippetFilePath && !fs24.existsSync(snippetFilePath)) {
|
|
77846
77873
|
onError(`File not found: ${snippetFilePath}`);
|
|
77847
77874
|
return onExit(1);
|
|
77848
77875
|
}
|