Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions packages/aws_cdk/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "aws_cdk",
version: "2.1019.1",
packageName: "aws-cdk",
extra: {
packageName: "aws-cdk",
},
};

export default function awsCdk(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/cdk"));
}
Expand All @@ -34,24 +35,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
29 changes: 6 additions & 23 deletions packages/bash_language_server/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "bash_language_server",
version: "5.6.0",
packageName: "bash-language-server",
extra: {
packageName: "bash-language-server",
}
};

export default function bashLanguageServer(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/bash-language-server"));
}
Expand All @@ -31,24 +32,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
29 changes: 6 additions & 23 deletions packages/claude_code/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "claude_code",
version: "1.0.31",
packageName: "@anthropic-ai/claude-code",
extra: {
packageName: "@anthropic-ai/claude-code",
},
};

export default function claudeCode(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/claude"));
}
Expand All @@ -31,24 +32,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
29 changes: 6 additions & 23 deletions packages/codex/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "codex",
version: "0.1.2505172129",
packageName: "@openai/codex",
extra: {
packageName: "@openai/codex",
},
};

export default function codex(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/codex"));
}
Expand All @@ -31,24 +32,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
29 changes: 6 additions & 23 deletions packages/markdownlint_cli/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "markdownlint_cli",
version: "0.45.0",
packageName: "markdownlint-cli",
extra: {
packageName: "markdownlint-cli",
},
};

export default function markdownlintCli(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/markdownlint"));
}
Expand All @@ -31,24 +32,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
29 changes: 6 additions & 23 deletions packages/markdownlint_cli2/project.bri
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "markdownlint_cli2",
version: "0.18.1",
packageName: "markdownlint-cli2",
extra: {
packageName: "markdownlint-cli2",
},
};

export default function markdownlintCli2(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.packageName,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/markdownlint-cli2"));
}
Expand All @@ -34,24 +35,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.packageName}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
28 changes: 6 additions & 22 deletions packages/renovate/project.bri
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import * as std from "std";
import { npmInstallGlobal } from "nodejs";
import nushell from "nushell";

export const project = {
name: "renovate",
version: "41.1.4",
extra: {
packageName: "renovate",
},
};

export default function renovate(): std.Recipe<std.Directory> {
return npmInstallGlobal({
packageName: project.name,
packageName: project.extra.packageName,
version: project.version,
}).pipe((recipe) => std.withRunnableLink(recipe, "bin/renovate"));
}
Expand All @@ -30,24 +32,6 @@ export async function test(): Promise<std.Recipe<std.File>> {
return script;
}

export function liveUpdate(): std.WithRunnable {
const src = std.file(std.indoc`
let releaseData = http get https://registry.npmjs.org/${project.name}/latest

let version = $releaseData
| get version
| str replace --regex '^v' ''

$env.project
| from json
| update version $version
| to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell],
});
export function liveUpdate(): std.Recipe<std.Directory> {
return std.liveUpdateFromNpmPackages({ project });
}
2 changes: 2 additions & 0 deletions packages/std/extra/index.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export * from "./bash_runnable.bri";
export * from "./set_env.bri";
export * from "./with_runnable_link.bri";
export * from "./apply_patch.bri";
export * from "./live_update.bri";
export * from "./live_update_from_github_releases.bri";
export * from "./live_update_from_npm_packages.bri";
export * from "./pkg_config_make_paths_relative.bri";

import "./extra_global.bri";
5 changes: 5 additions & 0 deletions packages/std/extra/live_update.bri
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// The default regex used for matching versions. Strips an optional "v" prefix,
// then matches the rest if it looks like a version number (either semver or
// a semver-like version)
export const DEFAULT_LIVE_UDPATE_REGEX_VERSION_MATCH =
/^v?(?<version>(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*))?(?:-(?:(?:[0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?:[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/;
Loading