@tscircuit/cli 0.1.121 → 0.1.122
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 +72 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -439676,7 +439676,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
439676
439676
|
import { execSync as execSync2 } from "node:child_process";
|
|
439677
439677
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
439678
439678
|
// package.json
|
|
439679
|
-
var version = "0.1.
|
|
439679
|
+
var version = "0.1.121";
|
|
439680
439680
|
var package_default = {
|
|
439681
439681
|
name: "@tscircuit/cli",
|
|
439682
439682
|
version,
|
|
@@ -489980,6 +489980,76 @@ var registerSnapshot = (program3) => {
|
|
|
489980
489980
|
});
|
|
489981
489981
|
};
|
|
489982
489982
|
|
|
489983
|
+
// lib/shared/setup-github-actions.ts
|
|
489984
|
+
import fs25 from "node:fs";
|
|
489985
|
+
import path25 from "node:path";
|
|
489986
|
+
var setupGithubActions = (projectDir = process.cwd()) => {
|
|
489987
|
+
const workflowsDir = path25.join(projectDir, ".github", "workflows");
|
|
489988
|
+
fs25.mkdirSync(workflowsDir, { recursive: true });
|
|
489989
|
+
const buildWorkflow = `name: tscircuit Build
|
|
489990
|
+
|
|
489991
|
+
on:
|
|
489992
|
+
push:
|
|
489993
|
+
branches: [main]
|
|
489994
|
+
pull_request:
|
|
489995
|
+
|
|
489996
|
+
jobs:
|
|
489997
|
+
build:
|
|
489998
|
+
runs-on: ubuntu-latest
|
|
489999
|
+
steps:
|
|
490000
|
+
- uses: actions/checkout@v4
|
|
490001
|
+
- uses: oven-sh/setup-bun@v2
|
|
490002
|
+
- run: bun install
|
|
490003
|
+
- run: bunx tsci build
|
|
490004
|
+
`;
|
|
490005
|
+
const snapshotWorkflow = `name: tscircuit Snapshot
|
|
490006
|
+
|
|
490007
|
+
on:
|
|
490008
|
+
push:
|
|
490009
|
+
branches: [main]
|
|
490010
|
+
|
|
490011
|
+
jobs:
|
|
490012
|
+
snapshot:
|
|
490013
|
+
runs-on: ubuntu-latest
|
|
490014
|
+
steps:
|
|
490015
|
+
- uses: actions/checkout@v4
|
|
490016
|
+
- uses: oven-sh/setup-bun@v2
|
|
490017
|
+
- run: bun install
|
|
490018
|
+
- run: bunx tsci snapshot --update
|
|
490019
|
+
- name: Commit snapshots
|
|
490020
|
+
run: |
|
|
490021
|
+
git config --global user.name "github-actions[bot]"
|
|
490022
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
490023
|
+
git add .
|
|
490024
|
+
git commit -m "Update snapshots" || echo "No changes to commit"
|
|
490025
|
+
git push
|
|
490026
|
+
`;
|
|
490027
|
+
writeFileIfNotExists(path25.join(workflowsDir, "tscircuit-build.yml"), buildWorkflow);
|
|
490028
|
+
writeFileIfNotExists(path25.join(workflowsDir, "tscircuit-snapshot.yml"), snapshotWorkflow);
|
|
490029
|
+
};
|
|
490030
|
+
|
|
490031
|
+
// cli/setup/register.ts
|
|
490032
|
+
var registerSetup = (program3) => {
|
|
490033
|
+
program3.command("setup").description("Setup utilities like GitHub Actions").action(async () => {
|
|
490034
|
+
const { option } = await prompts({
|
|
490035
|
+
type: "select",
|
|
490036
|
+
name: "option",
|
|
490037
|
+
message: "Select setup option",
|
|
490038
|
+
choices: [
|
|
490039
|
+
{
|
|
490040
|
+
title: "GitHub Action",
|
|
490041
|
+
value: "github-action",
|
|
490042
|
+
description: "Automatically build, check and commit snapshots to the main branch",
|
|
490043
|
+
selected: true
|
|
490044
|
+
}
|
|
490045
|
+
]
|
|
490046
|
+
});
|
|
490047
|
+
if (option === "github-action") {
|
|
490048
|
+
setupGithubActions();
|
|
490049
|
+
}
|
|
490050
|
+
});
|
|
490051
|
+
};
|
|
490052
|
+
|
|
489983
490053
|
// cli/main.ts
|
|
489984
490054
|
var program2 = new Command;
|
|
489985
490055
|
program2.name("tsci").description("CLI for developing tscircuit packages");
|
|
@@ -490000,6 +490070,7 @@ registerBuild(program2);
|
|
|
490000
490070
|
registerAdd(program2);
|
|
490001
490071
|
registerRemove(program2);
|
|
490002
490072
|
registerSnapshot(program2);
|
|
490073
|
+
registerSetup(program2);
|
|
490003
490074
|
registerUpgradeCommand(program2);
|
|
490004
490075
|
registerSearch(program2);
|
|
490005
490076
|
if (process.argv.includes("--version") || process.argv.includes("-v") || process.argv.includes("-V")) {
|