@yorozu/build 0.1.0

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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/chunks/21EFCjEU.js +19160 -0
  4. package/chunks/CMapqBQB.js +2620 -0
  5. package/chunks/CYSd7-PF.js +623 -0
  6. package/chunks/Cr5v7tI0.js +1824 -0
  7. package/ci/github-actions.d.ts +3 -0
  8. package/ci/index.d.ts +1 -0
  9. package/cli/commands/_utils.d.ts +8 -0
  10. package/cli/commands/build.d.ts +40 -0
  11. package/cli/commands/bump-version.d.ts +27 -0
  12. package/cli/commands/cr.d.ts +27 -0
  13. package/cli/commands/docs.d.ts +9 -0
  14. package/cli/commands/find-changed-packages.d.ts +10 -0
  15. package/cli/commands/gen-changelog.d.ts +10 -0
  16. package/cli/commands/gen-deps-graph.d.ts +15 -0
  17. package/cli/commands/jsr.d.ts +6 -0
  18. package/cli/commands/lint/config.d.ts +1 -0
  19. package/cli/commands/lint/index.d.ts +11 -0
  20. package/cli/commands/lint/validate-workspace-deps.d.ts +23 -0
  21. package/cli/commands/publish.d.ts +62 -0
  22. package/cli/commands/release.d.ts +45 -0
  23. package/cli/index.d.ts +8 -0
  24. package/cli/log.d.ts +3 -0
  25. package/cli/main.d.ts +2 -0
  26. package/config.d.ts +57 -0
  27. package/git/github.d.ts +15 -0
  28. package/git/index.d.ts +2 -0
  29. package/git/utils.d.ts +38 -0
  30. package/index.d.ts +8 -0
  31. package/index.js +26 -0
  32. package/jsr/_deno-directives.d.ts +1 -0
  33. package/jsr/config.d.ts +1 -0
  34. package/jsr/create-packages.d.ts +8 -0
  35. package/jsr/deno-json.d.ts +19 -0
  36. package/jsr/generate-workspace.d.ts +9 -0
  37. package/jsr/index.d.ts +6 -0
  38. package/jsr/populate.d.ts +10 -0
  39. package/jsr/utils/external-libs.d.ts +8 -0
  40. package/jsr/utils/index.d.ts +4 -0
  41. package/jsr/utils/jsr-api.d.ts +23 -0
  42. package/jsr/utils/jsr-json.d.ts +10 -0
  43. package/jsr/utils/jsr.d.ts +10 -0
  44. package/jsr.d.ts +1 -0
  45. package/jsr.js +2 -0
  46. package/misc/_config.d.ts +2 -0
  47. package/misc/exec.d.ts +15 -0
  48. package/misc/fs.d.ts +4 -0
  49. package/misc/index.d.ts +6 -0
  50. package/misc/path.d.ts +1 -0
  51. package/misc/publish-order.d.ts +3 -0
  52. package/misc/tsconfig.d.ts +2 -0
  53. package/npm/index.d.ts +1 -0
  54. package/npm/npm-api.d.ts +6 -0
  55. package/package-json/collect-package-jsons.d.ts +9 -0
  56. package/package-json/find-package-json.d.ts +1 -0
  57. package/package-json/index.d.ts +6 -0
  58. package/package-json/parse.d.ts +11 -0
  59. package/package-json/process-package-json.d.ts +20 -0
  60. package/package-json/types.d.ts +39 -0
  61. package/package-json/utils.d.ts +4 -0
  62. package/package.json +59 -0
  63. package/versioning/bump-version.d.ts +31 -0
  64. package/versioning/collect-files.d.ts +21 -0
  65. package/versioning/generate-changelog.d.ts +8 -0
  66. package/versioning/index.d.ts +4 -0
  67. package/versioning/types.d.ts +21 -0
  68. package/vite/build-plugin.d.ts +73 -0
  69. package/vite/config.d.ts +47 -0
  70. package/vite/index.d.ts +2 -0
  71. package/vite.d.ts +1 -0
  72. package/vite.js +184 -0
  73. package/yorozu-build.d.ts +1 -0
  74. package/yorozu-build.js +527 -0
@@ -0,0 +1,3 @@
1
+ export declare function isRunningInGithubActions(): boolean;
2
+ export declare function getGithubActionsInput(name: string): string | undefined;
3
+ export declare function writeGithubActionsOutput(name: string, value: string): void;
package/ci/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './github-actions';
@@ -0,0 +1,8 @@
1
+ import { RootConfigObject } from '../../config';
2
+ import * as bc from "@drizzle-team/brocli";
3
+ export { bc };
4
+ export declare function resolveWorkspaceRoot(root?: string): string;
5
+ export declare function loadConfig(params: {
6
+ workspaceRoot: string;
7
+ require?: boolean;
8
+ }): Promise<RootConfigObject | null>;
@@ -0,0 +1,40 @@
1
+ import { WorkspacePackage } from '../../package-json/collect-package-jsons';
2
+ import { bc } from './_utils';
3
+ export declare function resolveViteConfig(workspaceRoot: string, configured?: string): Promise<string>;
4
+ /**
5
+ * build a single package using vite
6
+ *
7
+ * tiny wrapper on top of `vite build`
8
+ */
9
+ export declare function buildPackage(params: {
10
+ /** path to the workspace root */
11
+ workspaceRoot: string;
12
+ /**
13
+ * list of workspace packages **including root**
14
+ */
15
+ workspace?: Array<WorkspacePackage>;
16
+ /** name of the package to build */
17
+ packageName: string;
18
+ /** path to the `build.config.js` file */
19
+ configPath?: string;
20
+ /** "fixed" version to use when building the package */
21
+ fixedVersion?: string;
22
+ }): Promise<void>;
23
+ /**
24
+ * build every npm-publishable workspace package in publish order
25
+ */
26
+ export declare function buildWorkspace(params: {
27
+ workspaceRoot: string;
28
+ fixedVersion?: string;
29
+ }): Promise<void>;
30
+ export declare let buildPackageCli: bc.Command<{
31
+ config: string | undefined;
32
+ root: string | undefined;
33
+ packageName: string;
34
+ fixedVersion: string | undefined;
35
+ }, {
36
+ config: string | undefined;
37
+ root: string | undefined;
38
+ packageName: string;
39
+ fixedVersion: string | undefined;
40
+ }>;
@@ -0,0 +1,27 @@
1
+ import { ReleaseType } from 'semver';
2
+ import { BumpVersionResult } from '../../versioning/bump-version';
3
+ import { bc } from './_utils';
4
+ export type BumpVersionKind = "major" | "minor" | "patch" | "auto";
5
+ export declare function sharedWorkspaceBumpOptions(params: {
6
+ type: BumpVersionKind;
7
+ dryRun?: boolean;
8
+ }): {
9
+ type: ReleaseType | undefined;
10
+ withRoot: true;
11
+ all: true;
12
+ dryRun?: boolean;
13
+ };
14
+ export declare function formatBumpVersionResult(result: BumpVersionResult, withReleaseType: boolean): string;
15
+ export declare let bumpVersionCli: bc.Command<{
16
+ root: string | undefined;
17
+ type: "major" | "minor" | "patch" | "auto";
18
+ since: string | undefined;
19
+ dryRun: boolean | undefined;
20
+ quiet: boolean | undefined;
21
+ }, {
22
+ root: string | undefined;
23
+ type: "major" | "minor" | "patch" | "auto";
24
+ since: string | undefined;
25
+ dryRun: boolean | undefined;
26
+ quiet: boolean | undefined;
27
+ }>;
@@ -0,0 +1,27 @@
1
+ import { WorkspacePackage } from '../../package-json/collect-package-jsons';
2
+ import { bc } from './_utils';
3
+ export declare function selectChangedNpmPackages(params: {
4
+ publishable: Array<WorkspacePackage>;
5
+ changed: Array<WorkspacePackage>;
6
+ }): Array<WorkspacePackage>;
7
+ export declare function runContinuousRelease(params: {
8
+ workspaceRoot?: string;
9
+ workspace?: Array<WorkspacePackage>;
10
+ distDir?: string;
11
+ extraArgs?: Array<string>;
12
+ onlyChanged?: boolean;
13
+ onlyChangedSince?: string;
14
+ }): Promise<void>;
15
+ export declare let runContinuousReleaseCli: bc.Command<{
16
+ root: string | undefined;
17
+ distDir: string | undefined;
18
+ extraArgs: string | undefined;
19
+ onlyChanged: boolean;
20
+ onlyChangedSince: string | undefined;
21
+ }, {
22
+ workspaceRoot: string;
23
+ distDir: string | undefined;
24
+ extraArgs: string[] | undefined;
25
+ onlyChanged: boolean;
26
+ onlyChangedSince: string | undefined;
27
+ }>;
@@ -0,0 +1,9 @@
1
+ import { bc } from './_utils';
2
+ export declare function generateDocs(params: {
3
+ workspaceRoot: string;
4
+ }): Promise<void>;
5
+ export declare let generateDocsCli: bc.Command<{
6
+ root: string | undefined;
7
+ }, {
8
+ root: string | undefined;
9
+ }>;
@@ -0,0 +1,10 @@
1
+ import { bc } from './_utils';
2
+ export declare let findChangedPackagesCli: bc.Command<{
3
+ root: string | undefined;
4
+ since: string | undefined;
5
+ until: string | undefined;
6
+ }, {
7
+ root: string | undefined;
8
+ since: string | undefined;
9
+ until: string | undefined;
10
+ }>;
@@ -0,0 +1,10 @@
1
+ import { bc } from './_utils';
2
+ export declare let generateChangelogCli: bc.Command<{
3
+ only: string | undefined;
4
+ root: string | undefined;
5
+ since: string | undefined;
6
+ }, {
7
+ only: string | undefined;
8
+ root: string | undefined;
9
+ since: string | undefined;
10
+ }>;
@@ -0,0 +1,15 @@
1
+ import { bc } from './_utils';
2
+ export declare function generateDepsGraph(params: {
3
+ workspaceRoot: string | URL;
4
+ includeRoot?: boolean;
5
+ includeExternal?: boolean;
6
+ }): Promise<string>;
7
+ export declare let generateDepsGraphCli: bc.Command<{
8
+ includeRoot: boolean | undefined;
9
+ includeExternal: boolean | undefined;
10
+ root: string | undefined;
11
+ }, {
12
+ includeRoot: boolean | undefined;
13
+ includeExternal: boolean | undefined;
14
+ root: string | undefined;
15
+ }>;
@@ -0,0 +1,6 @@
1
+ import { bc } from './_utils';
2
+ export declare let jsrCli: bc.Command<{
3
+ [x: string]: bc.OutputType;
4
+ } | undefined, {
5
+ [x: string]: bc.OutputType;
6
+ } | undefined>;
@@ -0,0 +1 @@
1
+ export type { LintConfig } from '../../../config';
@@ -0,0 +1,11 @@
1
+ import { bc } from '../_utils';
2
+ import { validateWorkspaceDeps } from './validate-workspace-deps';
3
+ export { validateWorkspaceDeps };
4
+ export type { ExternalDepsError, InternalDepsError, WorkspaceDepsError } from './validate-workspace-deps';
5
+ export declare let lintCli: bc.Command<{
6
+ workspace: string | undefined;
7
+ noErrorCode: boolean;
8
+ }, {
9
+ workspace: string | undefined;
10
+ noErrorCode: boolean;
11
+ }>;
@@ -0,0 +1,23 @@
1
+ import { WorkspacePackage } from '../../../package-json/collect-package-jsons';
2
+ import { LintConfig } from './config';
3
+ export interface ExternalDepsError {
4
+ type: "external";
5
+ package: string;
6
+ dependency: string;
7
+ version: string;
8
+ at: string;
9
+ otherPackage: string;
10
+ otherVersion: string;
11
+ }
12
+ export interface InternalDepsError {
13
+ type: "internal";
14
+ package: string;
15
+ dependency: string;
16
+ subtype: "not_workspace_proto" | "not_workspace_dep";
17
+ }
18
+ export type WorkspaceDepsError = ExternalDepsError | InternalDepsError;
19
+ export declare function validateWorkspaceDeps(params: {
20
+ workspaceRoot: string | URL;
21
+ packages?: Array<WorkspacePackage>;
22
+ config?: LintConfig;
23
+ }): Promise<Array<WorkspaceDepsError>>;
@@ -0,0 +1,62 @@
1
+ import { WorkspacePackage } from '../../package-json/collect-package-jsons';
2
+ import { bc } from './_utils';
3
+ export interface PublishPackagesResult {
4
+ failed: Array<string>;
5
+ tarballs: Array<string>;
6
+ }
7
+ export declare function normalizeNpmAuthToken(token?: string): string | undefined;
8
+ export declare function formatNpmAuthRc(registryUrl: string, token: string): string;
9
+ export interface NpmPublishAuth {
10
+ extraArgs: Array<string>;
11
+ extraEnv: NodeJS.ProcessEnv;
12
+ cleanup: () => Promise<void>;
13
+ }
14
+ export declare function prepareNpmPublishAuth(params: {
15
+ token?: string;
16
+ registryUrl: string;
17
+ }): Promise<NpmPublishAuth>;
18
+ export declare function publishPackages(params: {
19
+ workspaceRoot?: string;
20
+ workspace?: Array<WorkspacePackage>;
21
+ packages: Array<string>;
22
+ unpublishExisting?: boolean;
23
+ registryUrl?: string;
24
+ token?: string;
25
+ distDir?: string;
26
+ dryRun?: boolean;
27
+ publishArgs?: Array<string>;
28
+ withTarballs?: boolean;
29
+ withBuild?: boolean;
30
+ skipVersionCheck?: boolean;
31
+ fixedVersion?: string;
32
+ noProvenance?: boolean;
33
+ }): Promise<PublishPackagesResult>;
34
+ export declare let publishPackagesCli: bc.Command<{
35
+ root: string | undefined;
36
+ unpublishExisting: boolean | undefined;
37
+ skipVersionCheck: boolean | undefined;
38
+ registryUrl: string | undefined;
39
+ token: string | undefined;
40
+ distDir: string | undefined;
41
+ dryRun: boolean | undefined;
42
+ publishArgs: string | undefined;
43
+ packages: string;
44
+ withTarballs: boolean | undefined;
45
+ withBuild: boolean | undefined;
46
+ fixedVersion: string | undefined;
47
+ noProvenance: boolean | undefined;
48
+ }, {
49
+ root: string | undefined;
50
+ unpublishExisting: boolean | undefined;
51
+ skipVersionCheck: boolean | undefined;
52
+ registryUrl: string | undefined;
53
+ token: string | undefined;
54
+ distDir: string | undefined;
55
+ dryRun: boolean | undefined;
56
+ publishArgs: string | undefined;
57
+ packages: string;
58
+ withTarballs: boolean | undefined;
59
+ withBuild: boolean | undefined;
60
+ fixedVersion: string | undefined;
61
+ noProvenance: boolean | undefined;
62
+ }>;
@@ -0,0 +1,45 @@
1
+ import { bc } from './_utils';
2
+ export declare function shouldSkipAutoRelease(params: {
3
+ kind: string;
4
+ prevTag: string | null;
5
+ commitsSincePrevTag: ReadonlyArray<unknown>;
6
+ }): boolean;
7
+ export declare let releaseCli: bc.Command<{
8
+ kind: "major" | "minor" | "patch" | "auto";
9
+ withGithubRelease: boolean;
10
+ gitExtraOrigins: string | undefined;
11
+ githubToken: string | undefined;
12
+ githubRepo: string | undefined;
13
+ githubApiUrl: string | undefined;
14
+ withJsr: boolean;
15
+ jsrRegistry: string | undefined;
16
+ jsrToken: string | undefined;
17
+ jsrPublishArgs: string | undefined;
18
+ jsrCreatePackages: boolean | undefined;
19
+ withNpm: boolean | undefined;
20
+ npmToken: string | undefined;
21
+ npmPublishArgs: string | undefined;
22
+ npmDistDir: string | undefined;
23
+ npmRegistry: string | undefined;
24
+ noProvenance: boolean | undefined;
25
+ dryRun: boolean | undefined;
26
+ }, {
27
+ kind: "major" | "minor" | "patch" | "auto";
28
+ withGithubRelease: boolean;
29
+ gitExtraOrigins: string | undefined;
30
+ githubToken: string | undefined;
31
+ githubRepo: string | undefined;
32
+ githubApiUrl: string | undefined;
33
+ withJsr: boolean;
34
+ jsrRegistry: string | undefined;
35
+ jsrToken: string | undefined;
36
+ jsrPublishArgs: string | undefined;
37
+ jsrCreatePackages: boolean | undefined;
38
+ withNpm: boolean | undefined;
39
+ npmToken: string | undefined;
40
+ npmPublishArgs: string | undefined;
41
+ npmDistDir: string | undefined;
42
+ npmRegistry: string | undefined;
43
+ noProvenance: boolean | undefined;
44
+ dryRun: boolean | undefined;
45
+ }>;
package/cli/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { buildPackage, buildWorkspace } from './commands/build';
2
+ export { publishPackages } from './commands/publish';
3
+ export { generateDocs } from './commands/docs';
4
+ export { generateDepsGraph } from './commands/gen-deps-graph';
5
+ export { runContinuousRelease } from './commands/cr';
6
+ export { validateWorkspaceDeps } from './commands/lint/validate-workspace-deps';
7
+ export type { ExternalDepsError, InternalDepsError, WorkspaceDepsError, } from './commands/lint/validate-workspace-deps';
8
+ export * from './log';
package/cli/log.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare function info(message: string): void;
2
+ export declare function warn(message: string): void;
3
+ export declare function error(err: Error): void;
package/cli/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/config.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ import { AnyToNever, MaybePromise } from '@yorozu/utils';
2
+ import { TypeDocOptions } from 'typedoc';
3
+ import { SourceFile } from 'typescript';
4
+ import { WorkspacePackage } from './package-json/collect-package-jsons';
5
+ import { PackageJson } from './package-json/types';
6
+ import { VersioningOptions } from './versioning/types';
7
+ export type { VersioningOptions };
8
+ export interface BuildHookContext {
9
+ outDir: string;
10
+ packageDir: string;
11
+ packageName: string;
12
+ /**
13
+ * package.json of the package being built.
14
+ * should not be modified unless the hook docs allow it
15
+ */
16
+ packageJson: PackageJson;
17
+ jsr: boolean;
18
+ typedoc: boolean;
19
+ }
20
+ export interface JsrConfig {
21
+ outputDir?: string;
22
+ copyRootFiles?: Array<string>;
23
+ copyPackageFiles?: Array<string>;
24
+ sourceDir?: string;
25
+ exclude?: Array<string>;
26
+ includePackage?: (pkg: WorkspacePackage) => boolean;
27
+ dryRun?: boolean;
28
+ finalizeDenoJson?: (ctx: BuildHookContext, jsr: Record<string, unknown>) => void;
29
+ finalize?: (ctx: BuildHookContext) => MaybePromise<void>;
30
+ transformAst?: (ast: SourceFile) => boolean;
31
+ transformCode?: (path: string, code: string) => string;
32
+ enableDenoDirectives?: boolean;
33
+ }
34
+ export interface LintConfig {
35
+ includeRoot?: boolean;
36
+ externalDependencies?: {
37
+ enabled?: boolean;
38
+ skipPeerDependencies?: boolean;
39
+ shouldSkip?: (ctx: {
40
+ package: WorkspacePackage;
41
+ dependency: string;
42
+ version: string;
43
+ field: "dependencies" | "devDependencies" | "peerDependencies" | "optionalDependencies";
44
+ }) => boolean;
45
+ };
46
+ }
47
+ export interface RootConfigObject {
48
+ viteConfig?: string;
49
+ jsr?: JsrConfig;
50
+ versioning?: VersioningOptions;
51
+ typedoc?: AnyToNever<Omit<Partial<TypeDocOptions>, "entryPoints" | "entryPointStrategy" | "extends"> & {
52
+ includePackages?: Array<string>;
53
+ excludePackages?: Array<string>;
54
+ }>;
55
+ lint?: LintConfig;
56
+ }
57
+ export type RootConfig = RootConfigObject | (() => RootConfigObject);
@@ -0,0 +1,15 @@
1
+ export declare function createGithubRelease(params: {
2
+ token: string;
3
+ repo: string;
4
+ tag: string;
5
+ name: string;
6
+ body: string;
7
+ draft?: boolean;
8
+ prerelease?: boolean;
9
+ artifacts?: Array<{
10
+ name: string;
11
+ type: string;
12
+ body: Uint8Array<ArrayBuffer>;
13
+ }>;
14
+ apiUrl?: string;
15
+ }): Promise<number>;
package/git/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './github';
2
+ export * from './utils';
package/git/utils.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ export declare function getLatestTag(cwd?: string | URL): Promise<string | null>;
2
+ export declare function getFirstCommit(cwd?: string | URL): Promise<string>;
3
+ export declare function getCurrentCommit(cwd?: string | URL): Promise<string>;
4
+ export declare function getCurrentBranch(cwd?: string | URL): Promise<string>;
5
+ export declare function gitTagExists(tag: string, cwd?: string | URL): Promise<boolean>;
6
+ export declare function findChangedFiles(params: {
7
+ since: string;
8
+ until?: string;
9
+ cwd?: string | URL;
10
+ }): Promise<Array<string>>;
11
+ export interface CommitInfo {
12
+ hash: string;
13
+ author: {
14
+ name: string;
15
+ email: string;
16
+ date: Date;
17
+ };
18
+ committer: {
19
+ name: string;
20
+ email: string;
21
+ date: Date;
22
+ };
23
+ message: string;
24
+ description: string;
25
+ }
26
+ export declare function getCommitsBetween(params: {
27
+ since?: string;
28
+ files?: Array<string>;
29
+ until?: string;
30
+ cwd?: string | URL;
31
+ }): Promise<Array<CommitInfo>>;
32
+ export interface ConventionalCommit {
33
+ type: string;
34
+ scope?: string;
35
+ breaking: boolean;
36
+ subject: string;
37
+ }
38
+ export declare function parseConventionalCommit(msg: string): ConventionalCommit | null;
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './ci/index.js';
2
+ export * from './cli/index.js';
3
+ export * from './config.js';
4
+ export * from './git/index.js';
5
+ export * from './misc/index.js';
6
+ export * from './npm/index.js';
7
+ export * from './package-json/index.js';
8
+ export * from './versioning/index.js';
package/index.js ADDED
@@ -0,0 +1,26 @@
1
+ import { PackageJsonSchema, collectPackageJsons, collectVersions, directoryExists, error, fileExists, filterPackageJsonsForPublish, findPackageByName, findRootPackage, getWorkspaceRoot, info, loadBuildConfig, normalizeFilePath, parsePackageJson, parsePackageJsonFile, parsePackageJsonFromDir, parseWorkspaceRootPackageJson, processPackageJson, removeCommonjsExports, tryCopy, warn } from "./chunks/21EFCjEU.js";
2
+ import { LruMap, NPM_PACKAGE_NAME_REGEX, buildPackage, buildWorkspace, bumpVersion, createGithubRelease, determineBumpType, findChangedFiles, findProjectChangedFiles, findProjectChangedPackages, generateChangelog, generateDepsGraph, generateDocs, getCommitsBetween, getCurrentBranch, getCurrentCommit, getFirstCommit, getGithubActionsInput, getLatestTag, getTsconfigFiles, getTsconfigFor, gitTagExists, isRunningInGithubActions, npmCheckVersion, parseConventionalCommit, publishPackages, runContinuousRelease, validateWorkspaceDeps, writeGithubActionsOutput } from "./chunks/CMapqBQB.js";
3
+ import { ExecError, determinePublishOrder, exec, sortWorkspaceByPublishOrder } from "./chunks/Cr5v7tI0.js";
4
+ import { join } from "node:path";
5
+ //#region src/package-json/find-package-json.ts
6
+ var findPackageJsonCache = new LruMap(32);
7
+ async function findPackageJson(from) {
8
+ from = normalizeFilePath(from);
9
+ if (findPackageJsonCache.has(from)) return findPackageJsonCache.get(from) ?? null;
10
+ let current = from;
11
+ while (true) {
12
+ let file = join(current, "package.json");
13
+ if (await fileExists(file)) {
14
+ findPackageJsonCache.set(from, file);
15
+ return file;
16
+ }
17
+ let parent = join(current, "..");
18
+ if (parent === current) {
19
+ findPackageJsonCache.set(from, null);
20
+ return null;
21
+ }
22
+ current = parent;
23
+ }
24
+ }
25
+ //#endregion
26
+ export { ExecError, NPM_PACKAGE_NAME_REGEX, PackageJsonSchema, buildPackage, buildWorkspace, bumpVersion, collectPackageJsons, collectVersions, createGithubRelease, determineBumpType, determinePublishOrder, directoryExists, error, exec, fileExists, filterPackageJsonsForPublish, findChangedFiles, findPackageByName, findPackageJson, findProjectChangedFiles, findProjectChangedPackages, findRootPackage, generateChangelog, generateDepsGraph, generateDocs, getCommitsBetween, getCurrentBranch, getCurrentCommit, getFirstCommit, getGithubActionsInput, getLatestTag, getTsconfigFiles, getTsconfigFor, getWorkspaceRoot, gitTagExists, info, isRunningInGithubActions, loadBuildConfig, normalizeFilePath, npmCheckVersion, parseConventionalCommit, parsePackageJson, parsePackageJsonFile, parsePackageJsonFromDir, parseWorkspaceRootPackageJson, processPackageJson, publishPackages, removeCommonjsExports, runContinuousRelease, sortWorkspaceByPublishOrder, tryCopy, validateWorkspaceDeps, warn, writeGithubActionsOutput };
@@ -0,0 +1 @@
1
+ export declare function applyDenoDirectives(code: string): string;
@@ -0,0 +1 @@
1
+ export type { JsrConfig } from '../config';
@@ -0,0 +1,8 @@
1
+ import { WorkspacePackage } from '../package-json/collect-package-jsons';
2
+ export declare function jsrCreatePackages(params: {
3
+ workspaceRoot: string;
4
+ workspacePackages?: Array<WorkspacePackage>;
5
+ registry?: string;
6
+ token?: string;
7
+ githubRepo?: string;
8
+ }): Promise<boolean>;
@@ -0,0 +1,19 @@
1
+ import { PackageJson } from '../package-json/types';
2
+ export interface DenoJson {
3
+ name: string;
4
+ version: string;
5
+ exports?: Record<string, string>;
6
+ imports?: Record<string, string>;
7
+ exclude?: Array<string>;
8
+ publish?: {
9
+ exclude?: Array<string>;
10
+ };
11
+ }
12
+ export declare function packageJsonToDeno({ packageJson, packageJsonOrig, workspaceVersions, exclude, buildDirName, baseDir, }: {
13
+ packageJson: PackageJson;
14
+ packageJsonOrig: PackageJson;
15
+ workspaceVersions: Map<string, string>;
16
+ buildDirName: string;
17
+ baseDir?: string;
18
+ exclude?: Array<string>;
19
+ }): DenoJson;
@@ -0,0 +1,9 @@
1
+ import { WorkspacePackage } from '../package-json/collect-package-jsons';
2
+ import { JsrConfig } from './config';
3
+ export declare function generateDenoWorkspace(params: {
4
+ workspaceRoot: string | URL;
5
+ workspacePackages?: Array<WorkspacePackage>;
6
+ rootConfig?: JsrConfig;
7
+ withDryRun?: boolean;
8
+ fixedVersion?: string;
9
+ }): Promise<string>;
package/jsr/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './config';
2
+ export * from './create-packages';
3
+ export * from './deno-json';
4
+ export * from './generate-workspace';
5
+ export * from './populate';
6
+ export * from './utils/index';
@@ -0,0 +1,10 @@
1
+ export declare function populateFromUpstream(params: {
2
+ upstream?: string;
3
+ downstream: string;
4
+ packages: Array<string>;
5
+ token?: string;
6
+ createViaApi?: boolean;
7
+ deno?: string;
8
+ quiet?: boolean;
9
+ publishArgs?: Array<string> | ((pkg: string) => Array<string>);
10
+ }): Promise<void>;
@@ -0,0 +1,8 @@
1
+ export declare function getModuleCacheDirectory(): string;
2
+ export interface ImportSpecifier {
3
+ registry: "npm" | "jsr";
4
+ packageName: string;
5
+ version: string;
6
+ }
7
+ export declare function parseImportSpecifier(importSpecifier: string): ImportSpecifier;
8
+ export declare function splitImportRequest(request: string): [string, string];
@@ -0,0 +1,4 @@
1
+ export * from './external-libs';
2
+ export * from './jsr-api';
3
+ export * from './jsr-json';
4
+ export * from './jsr';
@@ -0,0 +1,23 @@
1
+ export declare function jsrGetScopeInfo(params: {
2
+ scope: string;
3
+ registry: string;
4
+ }): Promise<unknown>;
5
+ export declare function jsrCreateScope(params: {
6
+ name: string;
7
+ registry: string;
8
+ token: string;
9
+ quiet?: boolean;
10
+ }): Promise<void>;
11
+ export declare function jsrMaybeCreatePackage(params: {
12
+ name: string;
13
+ registry: string;
14
+ token: string;
15
+ quiet?: boolean;
16
+ }): Promise<void>;
17
+ export declare function jsrSetGithubRepo(params: {
18
+ registry: string;
19
+ name: string;
20
+ token: string;
21
+ owner: string;
22
+ repo: string;
23
+ }): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { ImportSpecifier } from './external-libs';
2
+ export interface JsrJson {
3
+ name: string;
4
+ version: string;
5
+ exports: string | Record<string, string>;
6
+ imports?: Record<string, ImportSpecifier>;
7
+ compilerOptions?: object;
8
+ }
9
+ export declare function parseJsrJson(json: string): JsrJson;
10
+ export declare function findClosestJsrJson(path: string): string | null;
@@ -0,0 +1,10 @@
1
+ import { ImportSpecifier } from './external-libs';
2
+ export declare function jsrCheckVersion(params: {
3
+ registry?: string;
4
+ package: string;
5
+ version?: string;
6
+ }): Promise<boolean>;
7
+ export declare function downloadJsrPackage(specifier: ImportSpecifier, params?: {
8
+ registry?: string;
9
+ force?: boolean;
10
+ }): Promise<string>;
package/jsr.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./jsr/index.js"
package/jsr.js ADDED
@@ -0,0 +1,2 @@
1
+ import { downloadJsrPackage, findClosestJsrJson, generateDenoWorkspace, getModuleCacheDirectory, jsrCheckVersion, jsrCreatePackages, jsrCreateScope, jsrGetScopeInfo, jsrMaybeCreatePackage, jsrSetGithubRepo, packageJsonToDeno, parseImportSpecifier, parseJsrJson, populateFromUpstream, splitImportRequest } from "./chunks/CYSd7-PF.js";
2
+ export { downloadJsrPackage, findClosestJsrJson, generateDenoWorkspace, getModuleCacheDirectory, jsrCheckVersion, jsrCreatePackages, jsrCreateScope, jsrGetScopeInfo, jsrMaybeCreatePackage, jsrSetGithubRepo, packageJsonToDeno, parseImportSpecifier, parseJsrJson, populateFromUpstream, splitImportRequest };
@@ -0,0 +1,2 @@
1
+ export declare function getWorkspaceRoot(cwd?: string): string;
2
+ export declare function loadBuildConfig<T>(packageRoot: string): Promise<T | undefined>;