@tscircuit/cli 0.1.88 → 0.1.90
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 +20 -6
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -348861,7 +348861,7 @@ Expected ` + (val42.length + 1) + " quasis but got " + node2.quasis.length);
|
|
|
348861
348861
|
return p;
|
|
348862
348862
|
}).join("/"));
|
|
348863
348863
|
}
|
|
348864
|
-
function
|
|
348864
|
+
function relative6(from2, to) {
|
|
348865
348865
|
from2 = resolve$2(from2).substr(1);
|
|
348866
348866
|
to = resolve$2(to).substr(1);
|
|
348867
348867
|
function trim(arr) {
|
|
@@ -348924,7 +348924,7 @@ Expected ` + (val42.length + 1) + " quasis but got " + node2.quasis.length);
|
|
|
348924
348924
|
dirname: dirname8,
|
|
348925
348925
|
sep: sep$1,
|
|
348926
348926
|
delimiter,
|
|
348927
|
-
relative:
|
|
348927
|
+
relative: relative6,
|
|
348928
348928
|
join: join11,
|
|
348929
348929
|
isAbsolute: isAbsolute2,
|
|
348930
348930
|
normalize: normalize$2,
|
|
@@ -348957,7 +348957,7 @@ Expected ` + (val42.length + 1) + " quasis but got " + node2.quasis.length);
|
|
|
348957
348957
|
isAbsolute: isAbsolute2,
|
|
348958
348958
|
join: join11,
|
|
348959
348959
|
normalize: normalize$2,
|
|
348960
|
-
relative:
|
|
348960
|
+
relative: relative6,
|
|
348961
348961
|
resolve: resolve$2,
|
|
348962
348962
|
sep: sep$1
|
|
348963
348963
|
});
|
|
@@ -433425,7 +433425,7 @@ import readline from "node:readline";
|
|
|
433425
433425
|
import { execSync as execSync2 } from "node:child_process";
|
|
433426
433426
|
var import_semver = __toESM2(require_semver2(), 1);
|
|
433427
433427
|
// package.json
|
|
433428
|
-
var version = "0.1.
|
|
433428
|
+
var version = "0.1.89";
|
|
433429
433429
|
var package_default = {
|
|
433430
433430
|
name: "@tscircuit/cli",
|
|
433431
433431
|
version,
|
|
@@ -433539,6 +433539,12 @@ var askConfirmation = (question) => {
|
|
|
433539
433539
|
var registerInit = (program3) => {
|
|
433540
433540
|
program3.command("init").description("Initialize a new TSCircuit project in the specified directory (or current directory if none is provided)").argument("[directory]", "Directory name (optional, defaults to current directory)").action(async (directory) => {
|
|
433541
433541
|
await checkForTsciUpdates();
|
|
433542
|
+
if (!directory) {
|
|
433543
|
+
const continueInCurrentDirectory = await askConfirmation("Do you want to initialize a new project in the current directory?");
|
|
433544
|
+
if (!continueInCurrentDirectory) {
|
|
433545
|
+
return;
|
|
433546
|
+
}
|
|
433547
|
+
}
|
|
433542
433548
|
const projectDir = directory ? path5.resolve(process.cwd(), directory) : process.cwd();
|
|
433543
433549
|
fs4.mkdirSync(projectDir, { recursive: true });
|
|
433544
433550
|
writeFileIfNotExists(path5.join(projectDir, "index.tsx"), `
|
|
@@ -439194,6 +439200,7 @@ var registerClone = (program3) => {
|
|
|
439194
439200
|
program3.command("clone").description("Clone a snippet from the registry").argument("<snippet>", "Snippet to clone (e.g. author/snippetName or https://tscircuit.com/author/snippetName)").action(async (snippetPath) => {
|
|
439195
439201
|
const urlMatch = snippetPath.match(/^https:\/\/tscircuit\.com\/([^\/]+)\/([^\/]+)\/?$/i);
|
|
439196
439202
|
const originalMatch = !urlMatch && snippetPath.match(/^(?:@tsci\/)?([^/.]+)[/.]([^/.]+)$/);
|
|
439203
|
+
const originalCwd = process.cwd();
|
|
439197
439204
|
if (!urlMatch && !originalMatch) {
|
|
439198
439205
|
console.error(`Invalid snippet path "${snippetPath}". Accepted formats:
|
|
439199
439206
|
- author/snippetName
|
|
@@ -439243,8 +439250,15 @@ var registerClone = (program3) => {
|
|
|
439243
439250
|
fs19.writeFileSync(path19.join(dirPath, ".npmrc"), "@tsci:registry=https://npm.tscircuit.com");
|
|
439244
439251
|
generateTsConfig(dirPath);
|
|
439245
439252
|
setupTsciProject(dirPath);
|
|
439246
|
-
|
|
439247
|
-
console.log(
|
|
439253
|
+
const relativeDirPath = path19.relative(originalCwd, dirPath);
|
|
439254
|
+
console.log(kleur_default.green(`
|
|
439255
|
+
Successfully cloned to:`));
|
|
439256
|
+
console.log(` ${dirPath}/
|
|
439257
|
+
`);
|
|
439258
|
+
console.log(kleur_default.bold("Start developing:"));
|
|
439259
|
+
console.log(kleur_default.cyan(` cd ${relativeDirPath}`));
|
|
439260
|
+
console.log(kleur_default.cyan(` tsci dev
|
|
439261
|
+
`));
|
|
439248
439262
|
});
|
|
439249
439263
|
};
|
|
439250
439264
|
|