diff --git a/.changeset/eight-moons-drop.md b/.changeset/eight-moons-drop.md new file mode 100644 index 00000000..a3551626 --- /dev/null +++ b/.changeset/eight-moons-drop.md @@ -0,0 +1,5 @@ +--- +"jsrepo": minor +--- + +perf: Cache git provider state to improve time it takes to fetch the manifest. (This behavior can be disabled with the `--no-cache` flag) diff --git a/packages/cli/package.json b/packages/cli/package.json index dfdf3a8f..db914ba5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -69,11 +69,11 @@ "package-manager-detector": "^0.2.9", "parse5": "^7.2.1", "pathe": "^2.0.2", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "semver": "^7.7.1", "svelte": "^5.19.9", "ts-morph": "^25.0.1", - "valibot": "1.0.0-beta.15", + "valibot": "1.0.0-rc.0", "validate-npm-package-name": "^6.0.0", "vue": "^3.5.13" } diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 14636280..d1c2428b 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,41 +1,11 @@ -import fs from 'node:fs'; -import { fileURLToPath } from 'node:url'; import { program } from 'commander'; -import path from 'pathe'; +import pkg from '../package.json'; import * as commands from './commands'; -import type { CLIContext } from './utils/context'; -import { getLatestVersion } from './utils/get-latest-version'; - -const resolveRelativeToRoot = (p: string): string => { - const dirname = fileURLToPath(import.meta.url); - return path.join(dirname, '../..', p); -}; - -// get version from package.json -const { version, name, description, repository } = JSON.parse( - fs.readFileSync(resolveRelativeToRoot('package.json'), 'utf-8') -); - -const latestVersion = (await getLatestVersion()).match( - (val) => val, - () => undefined -); - -const context: CLIContext = { - package: { - name, - description, - version, - repository, - latestVersion, - }, - resolveRelativeToRoot, -}; const cli = program - .name(name) - .description(description) - .version(version) + .name(pkg.name) + .description(pkg.description) + .version(pkg.version) .addCommand(commands.add) .addCommand(commands.auth) .addCommand(commands.build) @@ -44,4 +14,4 @@ const cli = program .addCommand(commands.test) .addCommand(commands.update); -export { cli, context }; +export { cli }; diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index 79f74d66..03224344 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -16,7 +16,6 @@ import { resolveCommand } from 'package-manager-detector/commands'; import { detect } from 'package-manager-detector/detect'; import path from 'pathe'; import * as v from 'valibot'; -import { context } from '../cli'; import * as ascii from '../utils/ascii'; import { getInstalled, resolveTree } from '../utils/blocks'; import * as url from '../utils/blocks/ts/url'; @@ -48,6 +47,7 @@ const schema = v.object({ repo: v.optional(v.string()), allow: v.boolean(), yes: v.boolean(), + cache: v.boolean(), verbose: v.boolean(), cwd: v.string(), }); @@ -63,12 +63,13 @@ const add = new Command('add') .option('--repo ', 'Repository to download the blocks from.') .option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false) .option('-y, --yes', 'Skip confirmation prompt.', false) + .option('--no-cache', 'Disable caching of resolved git urls.') .option('--verbose', 'Include debug logs.', false) .option('--cwd ', 'The current working directory.', process.cwd()) .action(async (blockNames, opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _add(blockNames, options); @@ -216,7 +217,7 @@ const _add = async (blockNames: string[], options: Options) => { if (!options.verbose) loading.start(`Fetching blocks from ${color.cyan(repoPaths.join(', '))}`); const resolvedRepos: registry.RegistryProviderState[] = ( - await registry.forEachPathGetProviderState(...repoPaths) + await registry.forEachPathGetProviderState(repoPaths, { noCache: !options.cache }) ).match( (val) => val, ({ repo, message }) => { @@ -417,7 +418,7 @@ const _add = async (blockNames: string[], options: Options) => { for (const { block } of installingBlocks) { const fullSpecifier = url.join(block.sourceRepo.url, block.category, block.name); const shortSpecifier = `${block.category}/${block.name}`; - const watermark = getWatermark(context.package.version, block.sourceRepo.url); + const watermark = getWatermark(block.sourceRepo.url); const providerInfo = block.sourceRepo; diff --git a/packages/cli/src/commands/auth.ts b/packages/cli/src/commands/auth.ts index 99d41f02..466a3447 100644 --- a/packages/cli/src/commands/auth.ts +++ b/packages/cli/src/commands/auth.ts @@ -2,7 +2,6 @@ import { cancel, confirm, isCancel, outro, password, select } from '@clack/promp import color from 'chalk'; import { Command, Option } from 'commander'; import * as v from 'valibot'; -import { context } from '../cli'; import * as ascii from '../utils/ascii'; import * as persisted from '../utils/persisted'; import { intro } from '../utils/prompts'; @@ -30,7 +29,7 @@ const auth = new Command('auth') .action(async (opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _auth(options); diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index b52470ea..3e6266ac 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -5,7 +5,6 @@ import { Command, program } from 'commander'; import ignore from 'ignore'; import path from 'pathe'; import * as v from 'valibot'; -import { context } from '../cli'; import { MANIFEST_FILE } from '../constants'; import type { Category, Manifest } from '../types'; import * as ascii from '../utils/ascii'; @@ -72,7 +71,7 @@ const build = new Command('build') .action(async (opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _build(options); diff --git a/packages/cli/src/commands/exec.ts b/packages/cli/src/commands/exec.ts index 2ef6d2c7..5ae9baa9 100644 --- a/packages/cli/src/commands/exec.ts +++ b/packages/cli/src/commands/exec.ts @@ -7,7 +7,6 @@ import { resolveCommand } from 'package-manager-detector/commands'; import { detect } from 'package-manager-detector/detect'; import path from 'pathe'; import * as v from 'valibot'; -import { context } from '../cli'; import * as ascii from '../utils/ascii'; import { resolveTree } from '../utils/blocks'; import * as url from '../utils/blocks/ts/url'; @@ -21,6 +20,7 @@ const schema = v.objectWithRest( { repo: v.optional(v.string()), allow: v.boolean(), + cache: v.boolean(), cwd: v.string(), }, v.unknown() @@ -39,13 +39,14 @@ const exec = new Command('exec') ) .option('--repo ', 'Repository to download and run the script from.') .option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false) + .option('--no-cache', 'Disable caching of resolved git urls.') .option('--cwd ', 'The current working directory.', process.cwd()) .allowExcessArguments() .allowUnknownOption() .action(async (script, opts, command) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _exec(script, options, command); }); @@ -141,7 +142,7 @@ const _exec = async (s: string | undefined, options: Options, command: any) => { loading.start(`Fetching scripts from ${color.cyan(repoPaths.join(', '))}`); const resolvedRepos: registry.RegistryProviderState[] = ( - await registry.forEachPathGetProviderState(...repoPaths) + await registry.forEachPathGetProviderState(repoPaths, { noCache: !options.cache }) ).match( (val) => val, ({ repo, message }) => { diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 54d69dde..f2c157ec 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -18,7 +18,6 @@ import { createPathsMatcher } from 'get-tsconfig'; import { detect, resolveCommand } from 'package-manager-detector'; import path from 'pathe'; import * as v from 'valibot'; -import { context } from '../cli'; import { type ModelName, models } from '../utils/ai'; import * as ascii from '../utils/ascii'; import { @@ -31,6 +30,7 @@ import { getProjectConfig, getRegistryConfig, } from '../utils/config'; +import { packageJson } from '../utils/context'; import { installDependencies } from '../utils/dependencies'; import { formatDiff } from '../utils/diff'; import { formatFile, matchJSDescendant, tryGetTsconfig } from '../utils/files'; @@ -52,6 +52,7 @@ const schema = v.object({ expand: v.boolean(), maxUnchanged: v.number(), yes: v.boolean(), + cache: v.boolean(), cwd: v.string(), }); @@ -87,11 +88,12 @@ const init = new Command('init') 3 ) .option('-y, --yes', 'Skip confirmation prompt.', false) + .option('--no-cache', 'Disable caching of resolved git urls.') .option('--cwd ', 'The current working directory.', process.cwd()) .action(async (registries, opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); if (options.registry !== undefined && options.project !== undefined) { program.error( @@ -315,7 +317,7 @@ const _initProject = async (registries: string[], options: Options) => { } const config: ProjectConfig = { - $schema: `https://unpkg.com/jsrepo@${context.package.version}/schemas/project-config.json`, + $schema: `https://unpkg.com/jsrepo@${packageJson.version}/schemas/project-config.json`, repos, includeTests: initialConfig.isOk() && options.tests === undefined @@ -527,7 +529,7 @@ const promptForProviderConfig = async ({ loading.start(`Fetching manifest from ${color.cyan(repo)}`); - const providerState = await registry.getProviderState(repo); + const providerState = await registry.getProviderState(repo, { noCache: !options.cache }); if (providerState.isErr()) { program.error(color.red(providerState.unwrapErr())); @@ -874,7 +876,7 @@ const _initRegistry = async (options: Options) => { }; } - config.$schema = `https://unpkg.com/jsrepo@${context.package.version}/schemas/registry-config.json`; + config.$schema = `https://unpkg.com/jsrepo@${packageJson.version}/schemas/registry-config.json`; while (true) { if (config.dirs.length > 0) { diff --git a/packages/cli/src/commands/test.ts b/packages/cli/src/commands/test.ts index 21dbf7f4..c824472b 100644 --- a/packages/cli/src/commands/test.ts +++ b/packages/cli/src/commands/test.ts @@ -8,7 +8,6 @@ import { detect } from 'package-manager-detector/detect'; import path from 'pathe'; import { Project } from 'ts-morph'; import * as v from 'valibot'; -import { context } from '../cli'; import * as ascii from '../utils/ascii'; import { getInstalled } from '../utils/blocks'; import * as url from '../utils/blocks/ts/url'; @@ -21,6 +20,7 @@ const schema = v.object({ repo: v.optional(v.string()), allow: v.boolean(), debug: v.boolean(), + cache: v.boolean(), verbose: v.boolean(), cwd: v.string(), }); @@ -33,12 +33,13 @@ const test = new Command('test') .option('--repo ', 'Repository to download the blocks from.') .option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false) .option('--debug', 'Leaves the temp test file around for debugging upon failure.', false) + .option('--no-cache', 'Disable caching of resolved git urls.') .option('--verbose', 'Include debug logs.', false) .option('--cwd ', 'The current working directory.', process.cwd()) .action(async (blockNames, opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _test(blockNames, options); @@ -81,7 +82,7 @@ const _test = async (blockNames: string[], options: Options) => { if (!options.verbose) loading.start(`Fetching blocks from ${color.cyan(repoPaths.join(', '))}`); const resolvedRepos: registry.RegistryProviderState[] = ( - await registry.forEachPathGetProviderState(...repoPaths) + await registry.forEachPathGetProviderState(repoPaths, { noCache: !options.cache }) ).match( (val) => val, ({ repo, message }) => { diff --git a/packages/cli/src/commands/update.ts b/packages/cli/src/commands/update.ts index 28c3152b..fed750b3 100644 --- a/packages/cli/src/commands/update.ts +++ b/packages/cli/src/commands/update.ts @@ -16,7 +16,6 @@ import { resolveCommand } from 'package-manager-detector/commands'; import { detect } from 'package-manager-detector/detect'; import path from 'pathe'; import * as v from 'valibot'; -import { context } from '../cli'; import { type ModelName, models } from '../utils/ai'; import * as ascii from '../utils/ascii'; import { getInstalled, resolveTree } from '../utils/blocks'; @@ -40,6 +39,7 @@ const schema = v.object({ repo: v.optional(v.string()), allow: v.boolean(), yes: v.boolean(), + cache: v.boolean(), verbose: v.boolean(), cwd: v.string(), }); @@ -61,12 +61,13 @@ const update = new Command('update') .option('--repo ', 'Repository to download the blocks from.') .option('-A, --allow', 'Allow jsrepo to download code from the provided repo.', false) .option('-y, --yes', 'Skip confirmation prompt.', false) + .option('--no-cache', 'Disable caching of resolved git urls.') .option('--verbose', 'Include debug logs.', false) .option('--cwd ', 'The current working directory.', process.cwd()) .action(async (blockNames, opts) => { const options = v.parse(schema, opts); - intro(context); + await intro(); await _update(blockNames, options); @@ -122,7 +123,7 @@ const _update = async (blockNames: string[], options: Options) => { if (!options.verbose) loading.start(`Fetching blocks from ${color.cyan(repoPaths.join(', '))}`); const resolvedRepos: registry.RegistryProviderState[] = ( - await registry.forEachPathGetProviderState(...repoPaths) + await registry.forEachPathGetProviderState(repoPaths, { noCache: !options.cache }) ).match( (val) => val, ({ repo, message }) => { @@ -220,7 +221,7 @@ const _update = async (blockNames: string[], options: Options) => { for (const { block } of updatingBlocks) { const fullSpecifier = url.join(block.sourceRepo.url, block.category, block.name); - const watermark = getWatermark(context.package.version, block.sourceRepo.url); + const watermark = getWatermark(block.sourceRepo.url); const providerState = block.sourceRepo; diff --git a/packages/cli/src/utils/context.ts b/packages/cli/src/utils/context.ts index 6484a57b..07143ae7 100644 --- a/packages/cli/src/utils/context.ts +++ b/packages/cli/src/utils/context.ts @@ -1,18 +1,4 @@ -export interface CLIContext { - /** The package.json of the CLI */ - package: { - name: string; - version: string; - description: string; - repository: { - url: string; - }; - latestVersion?: string; - }; - /** Resolves the path relative to the root of the application - * - * @param path - * @returns - */ - resolveRelativeToRoot: (path: string) => string; -} +import pkg from '../../package.json'; +import type { PackageJson } from './package'; + +export const packageJson = pkg as PackageJson; diff --git a/packages/cli/src/utils/get-latest-version.ts b/packages/cli/src/utils/get-latest-version.ts index 531af337..f7b0746e 100644 --- a/packages/cli/src/utils/get-latest-version.ts +++ b/packages/cli/src/utils/get-latest-version.ts @@ -12,23 +12,27 @@ type LatestVersion = { }; /** Checks for the latest version from the github repository. Will cache results for up to 1 hour. */ -export const getLatestVersion = async (): Promise> => { +export const getLatestVersion = async ({ + noCache = false, +}: { noCache?: boolean } = {}): Promise> => { try { // handle caching const storage = persisted.get(); let version: string; - const latestVersion = storage.get(LATEST_VERSION_KEY) as LatestVersion | null; + if (!noCache) { + const latestVersion = storage.get(LATEST_VERSION_KEY) as LatestVersion | null; - if (latestVersion) { - if (latestVersion.expiration > Date.now()) { - version = latestVersion.version; + if (latestVersion) { + if (latestVersion.expiration > Date.now()) { + version = latestVersion.version; - return Ok(version); - } + return Ok(version); + } - storage.delete(LATEST_VERSION_KEY); + storage.delete(LATEST_VERSION_KEY); + } } // we abort the request after a second diff --git a/packages/cli/src/utils/get-watermark.ts b/packages/cli/src/utils/get-watermark.ts index b6e30e78..ef982da3 100644 --- a/packages/cli/src/utils/get-watermark.ts +++ b/packages/cli/src/utils/get-watermark.ts @@ -1,5 +1,7 @@ -const getWatermark = (version: string, repoUrl: string): string => { - return `jsrepo ${version}\nInstalled from ${repoUrl}\n${new Date() +import { packageJson } from './context'; + +const getWatermark = (repoUrl: string): string => { + return `jsrepo ${packageJson.version}\nInstalled from ${repoUrl}\n${new Date() .toLocaleDateString() .replaceAll('/', '-')}`; }; diff --git a/packages/cli/src/utils/package.ts b/packages/cli/src/utils/package.ts index 40f37bbb..5b3389aa 100644 --- a/packages/cli/src/utils/package.ts +++ b/packages/cli/src/utils/package.ts @@ -16,7 +16,7 @@ const findNearestPackageJson = (startDir: string, until: string): string | undef return findNearestPackageJson(segments.slice(0, segments.length - 1).join('/'), until); }; -type PackageJson = { +export type PackageJson = { name: string; version: string; description: string; diff --git a/packages/cli/src/utils/prompts.ts b/packages/cli/src/utils/prompts.ts index 8ac146e0..fbcbfecb 100644 --- a/packages/cli/src/utils/prompts.ts +++ b/packages/cli/src/utils/prompts.ts @@ -5,7 +5,8 @@ import { detectSync, resolveCommand } from 'package-manager-detector'; import semver from 'semver'; import * as ascii from './ascii'; import { stripAsni } from './blocks/ts/strip-ansi'; -import type { CLIContext } from './context'; +import { packageJson } from './context'; +import { getLatestVersion } from './get-latest-version'; export type Task = { loadingMessage: string; @@ -140,16 +141,22 @@ const newerVersionAvailable = (name: string, oldVersion: string, newVersion: str return box; }; -const _intro = ({ package: pkg }: CLIContext) => { +const _intro = async () => { console.clear(); - if (pkg.latestVersion) { - if (semver.lt(pkg.version, pkg.latestVersion)) { - console.info(newerVersionAvailable(pkg.name, pkg.version, pkg.latestVersion)); + const latestVersion = await getLatestVersion(); + + if (latestVersion.isOk()) { + if (semver.lt(packageJson.version, latestVersion.unwrap())) { + console.info( + newerVersionAvailable(packageJson.name, packageJson.version, latestVersion.unwrap()) + ); } } - intro(`${color.bgHex('#f7df1e').black(` ${pkg.name} `)}${color.gray(` v${pkg.version} `)}`); + intro( + `${color.bgHex('#f7df1e').black(` ${packageJson.name} `)}${color.gray(` v${packageJson.version} `)}` + ); }; export { runTasks, nextSteps, _intro as intro, runTasksConcurrently, truncatedList }; diff --git a/packages/cli/src/utils/registry-providers/azure.ts b/packages/cli/src/utils/registry-providers/azure.ts index 8c2e1cd6..46e3f624 100644 --- a/packages/cli/src/utils/registry-providers/azure.ts +++ b/packages/cli/src/utils/registry-providers/azure.ts @@ -82,6 +82,7 @@ ${color.bold('This may be for one of the following reasons:')} 1. Either \`${color.bold(filePath)}\` or the containing repository doesn't exist 2. Your repository path is incorrect (wrong branch, wrong tag) 3. You are using an expired access token or a token that doesn't have access to this repository +4. The cached state for this git provider is incorrect (try using ${color.bold('--no-cache')}) `; }, }; diff --git a/packages/cli/src/utils/registry-providers/bitbucket.ts b/packages/cli/src/utils/registry-providers/bitbucket.ts index 58053c53..5e49ce37 100644 --- a/packages/cli/src/utils/registry-providers/bitbucket.ts +++ b/packages/cli/src/utils/registry-providers/bitbucket.ts @@ -110,6 +110,7 @@ ${color.bold('This may be for one of the following reasons:')} 1. Either \`${color.bold(filePath)}\` or the containing repository doesn't exist 2. Your repository path is incorrect (wrong branch, wrong tag) 3. You are using an expired access token or a token that doesn't have access to this repository +4. The cached state for this git provider is incorrect (try using ${color.bold('--no-cache')}) `; }, }; diff --git a/packages/cli/src/utils/registry-providers/github.ts b/packages/cli/src/utils/registry-providers/github.ts index 3ccd8de4..7be1cef5 100644 --- a/packages/cli/src/utils/registry-providers/github.ts +++ b/packages/cli/src/utils/registry-providers/github.ts @@ -114,6 +114,7 @@ ${color.bold('This may be for one of the following reasons:')} 1. Either \`${color.bold(filePath)}\` or the containing repository doesn't exist 2. Your repository path is incorrect (wrong branch, wrong tag) 3. You are using an expired access token or a token that doesn't have access to this repository +4. The cached state for this git provider is incorrect (try using ${color.bold('--no-cache')}) `; }, }; diff --git a/packages/cli/src/utils/registry-providers/gitlab.ts b/packages/cli/src/utils/registry-providers/gitlab.ts index 648371f5..73a3fa4d 100644 --- a/packages/cli/src/utils/registry-providers/gitlab.ts +++ b/packages/cli/src/utils/registry-providers/gitlab.ts @@ -109,6 +109,7 @@ ${color.bold('This may be for one of the following reasons:')} 1. Either \`${color.bold(filePath)}\` or the containing repository doesn't exist 2. Your repository path is incorrect (wrong branch, wrong tag) 3. You are using an expired access token or a token that doesn't have access to this repository +4. The cached state for this git provider is incorrect (try using ${color.bold('--no-cache')}) `; }, }; diff --git a/packages/cli/src/utils/registry-providers/internal.ts b/packages/cli/src/utils/registry-providers/internal.ts index d90f9475..95b3c236 100644 --- a/packages/cli/src/utils/registry-providers/internal.ts +++ b/packages/cli/src/utils/registry-providers/internal.ts @@ -64,16 +64,32 @@ export const getProviderToken = (provider: RegistryProvider): string | undefined * @returns */ export const getProviderState = async ( - repo: string + repo: string, + { noCache = false }: { noCache?: boolean } = {} ): Promise> => { const provider = selectProvider(repo); + if (provider) { + const storage = persisted.get(); + + // only git providers are cached + if (provider.name !== http.name && !noCache) { + const cached = storage.get(`${repo}-state`); + + if (cached) return Ok({ ...(cached as RegistryProviderState), provider }); + } + const state = await provider.state(repo, { token: getProviderToken(provider), // @ts-expect-error but it does work fetch: nodeFetch, }); + // only cache git providers + if (provider.name !== http.name && !noCache) { + storage.set(`${repo}-state`, state); + } + return Ok(state); } @@ -88,13 +104,14 @@ export const getProviderState = async ( * @returns */ export const forEachPathGetProviderState = async ( - ...repos: string[] + repos: string[], + { noCache = false }: { noCache?: boolean } = {} ): Promise> => { const resolvedPaths: RegistryProviderState[] = []; const errors = await Promise.all( repos.map(async (repo) => { - const getProviderResult = await getProviderState(repo); + const getProviderResult = await getProviderState(repo, { noCache }); if (getProviderResult.isErr()) return Err({ message: getProviderResult.unwrapErr(), repo }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57841ff6..51600189 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,8 +84,8 @@ importers: specifier: ^2.0.2 version: 2.0.2 prettier: - specifier: ^3.4.2 - version: 3.4.2 + specifier: ^3.5.0 + version: 3.5.0 semver: specifier: ^7.7.1 version: 7.7.1 @@ -96,8 +96,8 @@ importers: specifier: ^25.0.1 version: 25.0.1 valibot: - specifier: 1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@5.7.3) + specifier: 1.0.0-rc.0 + version: 1.0.0-rc.0(typescript@5.7.3) validate-npm-package-name: specifier: ^6.0.0 version: 6.0.0 @@ -2743,11 +2743,6 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.4.2: - resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} - engines: {node: '>=14'} - hasBin: true - prettier@3.5.0: resolution: {integrity: sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==} engines: {node: '>=14'} @@ -3325,6 +3320,14 @@ packages: typescript: optional: true + valibot@1.0.0-rc.0: + resolution: {integrity: sha512-9ZUrOXOejY/WaIn8p0Z469R1qBAwNJeqq8jzOIDsl1qR8gqtObHQmyHLFli0UCkcGiTco5kH6/KPLWsTWE9b2g==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + validate-npm-package-name@5.0.1: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -6250,8 +6253,6 @@ snapshots: prettier@2.8.8: {} - prettier@3.4.2: {} - prettier@3.5.0: {} pretty-ms@9.2.0: @@ -6858,6 +6859,10 @@ snapshots: optionalDependencies: typescript: 5.7.3 + valibot@1.0.0-rc.0(typescript@5.7.3): + optionalDependencies: + typescript: 5.7.3 + validate-npm-package-name@5.0.1: {} validate-npm-package-name@6.0.0: {} diff --git a/sites/docs/static/docs/cli/llms.txt b/sites/docs/static/docs/cli/llms.txt index fe963965..04476820 100644 --- a/sites/docs/static/docs/cli/llms.txt +++ b/sites/docs/static/docs/cli/llms.txt @@ -2,7 +2,7 @@ > A CLI to add shared code from remote repositories. -Latest Version: 1.31.0 +Latest Version: 1.34.0 ## Commands @@ -19,6 +19,7 @@ jsrepo add [options] [blocks...] - --repo : Repository to download the blocks from. - -A, --allow: Allow jsrepo to download code from the provided repo. - -y, --yes: Skip confirmation prompt. +- --no-cache: Disable caching of resolved git urls. - --verbose: Include debug logs. - --cwd : The current working directory. (default: ./) @@ -75,6 +76,7 @@ jsrepo exec [options] [script] #### Options - --repo : Repository to download and run the script from. - -A, --allow: Allow jsrepo to download code from the provided repo. +- --no-cache: Disable caching of resolved git urls. - --cwd : The current working directory. (default: ./) ### init @@ -94,7 +96,10 @@ jsrepo init [options] [registries...] - -P, --project: Takes you through the steps to initialize a project. - -R, --registry: Takes you through the steps to initialize a registry. - --script : The name of the build script. (For Registry setup) (default: build:registry) +- -E, --expand: Expands the diff so you see everything. +- --max-unchanged : Maximum unchanged lines that will show without being collapsed. (default: 3) - -y, --yes: Skip confirmation prompt. +- --no-cache: Disable caching of resolved git urls. - --cwd : The current working directory. (default: ./) ### test @@ -110,6 +115,7 @@ jsrepo test [options] [blocks...] - --repo : Repository to download the blocks from. - -A, --allow: Allow jsrepo to download code from the provided repo. - --debug: Leaves the temp test file around for debugging upon failure. +- --no-cache: Disable caching of resolved git urls. - --verbose: Include debug logs. - --cwd : The current working directory. (default: ./) @@ -130,6 +136,7 @@ jsrepo update [options] [blocks...] - --repo : Repository to download the blocks from. - -A, --allow: Allow jsrepo to download code from the provided repo. - -y, --yes: Skip confirmation prompt. +- --no-cache: Disable caching of resolved git urls. - --verbose: Include debug logs. - --cwd : The current working directory. (default: ./)