Skip to content

Commit 834535c

Browse files
committed
Refactor tools/
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 3689950 commit 834535c

16 files changed

Lines changed: 63 additions & 553 deletions

rust/perspective-viewer/src/css/column-selector.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,22 @@
334334
padding: var(--column_type--padding, 0px 0px 0px 0px);
335335
position: absolute;
336336
height: 28px;
337-
top: 0;
337+
top: -28px;
338338
display: inline-flex;
339339
align-items: flex-end;
340340
content: var(--psp-label--all-columns--content, "All Columns");
341341
}
342342

343-
#sub-columns .scroll-panel-container:first-child {
344-
padding-top: 28px;
343+
#sub-columns .scroll-panel-container {
344+
margin-top: 28px;
345345
margin-bottom: 4px;
346346
}
347347

348+
/* #sub-acolumns .scroll-panel-container #add-expression {
349+
padding-top: 28px;
350+
margin-top: 0;
351+
} */
352+
348353
#sub-columns .column-selector-column.column-selector-column-hidden {
349354
overflow: hidden;
350355
height: 0;

rust/perspective-viewer/src/css/config-selector.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
padding-top: 15px;
311311
font-size: var(--label--font-size, 0.75em);
312312
select {
313-
font-size: var(--label--font-size, 0.75em);
313+
font-size: var(--label--font-size);
314314
}
315315
}
316316

tools/scripts/bench.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

1313
import * as dotenv from "dotenv";
14-
import sh from "./sh.mjs";
1514
import { get_scope } from "./sh_perspective.mjs";
1615

16+
import "zx/globals";
17+
1718
dotenv.config({ path: "./.perspectiverc", quiet: true });
1819
const scope = get_scope();
1920
if (scope.includes("client")) {
20-
sh`pnpm run --recursive --filter bench bench_js`.runSync();
21+
$.sync`pnpm run --recursive --filter bench bench_js`;
2122
} else if (scope.includes("python")) {
22-
sh`pnpm run --recursive --filter bench bench_python`.runSync();
23+
$.sync`pnpm run --recursive --filter bench bench_python`;
2324
}

tools/scripts/fix_cpp.mjs

Lines changed: 0 additions & 26 deletions
This file was deleted.

tools/scripts/install_emsdk.mjs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import path from "path";
1414
import os from "os";
1515
import fs from "fs";
1616
import * as dotenv from "dotenv";
17-
import sh from "./sh.mjs";
1817
import { getWorkspaceRoot, getWorkspacePackageJson } from "./workspace.mjs";
1918

2019
import "zx/globals";
@@ -26,27 +25,23 @@ const emscripten = pkg.emscripten;
2625
dotenv.config({ path: "./.perspectiverc", quiet: true });
2726

2827
function base() {
29-
return sh.path`${getWorkspaceRoot()}/.emsdk`;
28+
return path.resolve(getWorkspaceRoot(), ".emsdk");
3029
}
3130

3231
function emsdk_checkout() {
33-
function git(args) {
34-
sh`git ${args}`.runSync();
35-
}
36-
37-
git(["clone", "https://github.com/emscripten-core/emsdk.git", base()]);
32+
$.sync`git clone https://github.com/emscripten-core/emsdk.git ${base()}`;
3833
}
3934

4035
function emsdk(...args) {
4136
const basedir = base();
4237
const suffix = os.type() == "Windows_NT" ? ".bat" : "";
43-
const emsdk = path.join(basedir, "emsdk" + suffix);
44-
sh`${emsdk} ${args}`.runSync();
38+
const emsdkBin = path.join(basedir, "emsdk" + suffix);
39+
$.sync`${emsdkBin} ${args}`;
4540
}
4641

4742
function toolchain_install() {
4843
console.log(`-- Installing Emscripten ${emscripten}`);
49-
sh`git pull`.cwd(".emsdk").runSync();
44+
$.sync({ cwd: ".emsdk" })`git pull`;
5045
emsdk("install", emscripten);
5146
emsdk("activate", emscripten);
5247
console.log(`-- Emscripten ${emscripten} installed`);

tools/scripts/lint.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export async function lint_js(is_fix = false) {
2121
await $`prettier ${prettier_flags} "examples/**/*.js" "examples/**/*.tsx" "tools/scripts/*.mjs" "rust/**/*.ts" "rust/**/*.js" "packages/**/*.js" "packages/**/*.ts"`.verbose();
2222
await $`prettier --prose-wrap=always ${prettier_flags} "rust/*/docs/**/*.md"`.verbose();
2323
// cmd.sh`prettier ${prettier_flags} "**/*.yaml"`;
24-
await $`prettier ${prettier_flags} "**/less/*.less"`.verbose();
24+
await $`prettier ${prettier_flags} "**/css/**/*.css"`.verbose();
25+
await $`prettier ${prettier_flags} "**/themes/**/*.css"`.verbose();
2526
await $`prettier ${prettier_flags} "**/html/*.html"`.verbose();
2627
await $`prettier ${prettier_flags} "packages/**/package.json" "rust/**/package.json" "examples/**/package.json" "docs/package.json"`.verbose();
2728

tools/scripts/lint_headers.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const FIX_PATHS = [
2828
["**/*.mjs", ["//", "/*", " *", " */"]],
2929
// ["**/*.css", ["//", "/*", " *", " */"]],
3030
["**/*.scss", ["//", "/*", " *", " */"]],
31-
["**/*.less", ["//", "/*", " *", " */"]],
3231
["**/*.toml", ["# ", "#"]],
3332
["**/*.yaml", ["# ", "#"]],
3433
["**/*.py", ["# ", "#"]],

tools/scripts/publish.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

1313
import { Octokit } from "octokit";
14-
import sh from "./sh.mjs";
1514
import fs from "node:fs/promises";
1615

1716
import "zx/globals";
@@ -21,11 +20,11 @@ const OCTOKIT = new Octokit({
2120
auth: process.env.GITHUB_TOKEN,
2221
});
2322

24-
const CURRENT_TAG = sh`git describe --exact-match --tags`.execSync();
23+
const CURRENT_TAG = $.sync`git describe --exact-match --tags`.toString().trim();
2524

26-
const IS_DIRTY = await sh`git status --untracked-files=no --porcelain`
27-
.exec()
28-
.then((x) => x.length > 0);
25+
const IS_DIRTY =
26+
(await $`git status --untracked-files=no --porcelain`).stdout.trim()
27+
.length > 0;
2928

3029
async function get_release_assets() {
3130
const resp = await OCTOKIT.request("GET /repos/{owner}/{repo}/releases", {
@@ -71,9 +70,9 @@ async function publish_release_assets(releases) {
7170
release.name.endsWith("tar.gz")) &&
7271
release.name.indexOf("wasm") === -1
7372
) {
74-
sh`twine upload ${release.name}`.runSync();
73+
$.sync`twine upload ${release.name}`;
7574
} else if (release.name.endsWith(".tgz")) {
76-
sh`npm publish ${release.name}`.runSync();
75+
$.sync`npm publish ${release.name}`;
7776
} else {
7877
console.log(`Skipping "${release.name}"`);
7978
}

tools/scripts/run_emsdk.mjs

Lines changed: 0 additions & 32 deletions
This file was deleted.

tools/scripts/setup.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
1111
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

13-
import sh from "./sh.mjs";
1413
import inquirer from "inquirer";
1514
import fs from "fs";
1615
import * as dotenv from "dotenv";
16+
import { execSync } from "child_process";
1717

1818
const original = dotenv.config({
1919
path: "./.perspectiverc",
@@ -50,7 +50,7 @@ const CONFIG = new Proxy(
5050
write() {
5151
fs.writeFileSync("./.perspectiverc", this.config.join("\n"));
5252
if (process.env.PSP_BUILD_IMMEDIATELY || process.env.PSP_ONCE) {
53-
sh`node tools/scripts/build.mjs`.runSync();
53+
execSync("node tools/scripts/build.mjs", { stdio: "inherit" });
5454
if (process.env.PSP_ONCE) {
5555
while (this.config.length > 0) {
5656
this.config.pop();

0 commit comments

Comments
 (0)