@ankhorage/devtools 1.1.1 → 1.2.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 (48) hide show
  1. package/README.md +165 -138
  2. package/dist/cli/bin/eslint.js +4 -0
  3. package/dist/cli/bin/knip.js +4 -0
  4. package/dist/cli/bin/prettier.js +4 -0
  5. package/dist/cli/commands.d.ts +25 -0
  6. package/dist/cli/commands.js +92 -0
  7. package/dist/cli/index.d.ts +5 -5
  8. package/dist/cli/index.js +3 -4
  9. package/dist/cli/runExternalTool.d.ts +31 -0
  10. package/dist/{internal/runDevtoolsCommand.js → cli/runExternalTool.js} +3 -3
  11. package/dist/cli/runProviderCommand.d.ts +8 -0
  12. package/dist/cli/runProviderCommand.js +11 -0
  13. package/dist/cli/runRepositoryCommand.d.ts +16 -0
  14. package/dist/cli/runRepositoryCommand.js +108 -0
  15. package/dist/cli/runStandaloneTool.d.ts +3 -0
  16. package/dist/cli/runStandaloneTool.js +5 -0
  17. package/dist/internal/readmeDocs.js +7 -7
  18. package/dist/{eslint.d.ts → tools/eslint/index.d.ts} +2 -4
  19. package/dist/{eslint.js → tools/eslint/index.js} +1 -5
  20. package/dist/tools/eslint/types.d.ts +18 -0
  21. package/dist/tools/knip/index.d.ts +20 -0
  22. package/dist/tools/shared/managedFiles.d.ts +20 -0
  23. package/dist/tools/shared/managedFiles.js +84 -0
  24. package/dist/tools/vscode/files/extensions.json +9 -0
  25. package/dist/tools/vscode/files/settings.json +15 -0
  26. package/dist/tools/vscode/index.d.ts +7 -0
  27. package/dist/tools/vscode/index.js +10 -0
  28. package/dist/tools/workflows/files/ci.yml +88 -0
  29. package/dist/tools/workflows/files/release.yml +65 -0
  30. package/dist/tools/workflows/index.d.ts +7 -0
  31. package/dist/tools/workflows/index.js +10 -0
  32. package/package.json +21 -15
  33. package/dist/eslint-cli.js +0 -4
  34. package/dist/internal/devtoolsCommands.d.ts +0 -11
  35. package/dist/internal/devtoolsCommands.js +0 -39
  36. package/dist/internal/runDevtoolsCommand.d.ts +0 -31
  37. package/dist/internal/runStandaloneDevtoolsCommand.d.ts +0 -3
  38. package/dist/internal/runStandaloneDevtoolsCommand.js +0 -5
  39. package/dist/knip-cli.js +0 -4
  40. package/dist/knip.d.ts +0 -20
  41. package/dist/prettier-cli.js +0 -4
  42. package/dist/types.d.ts +0 -18
  43. /package/dist/{eslint-cli.d.ts → cli/bin/eslint.d.ts} +0 -0
  44. /package/dist/{knip-cli.d.ts → cli/bin/knip.d.ts} +0 -0
  45. /package/dist/{prettier-cli.d.ts → cli/bin/prettier.d.ts} +0 -0
  46. /package/dist/{types.js → tools/eslint/types.js} +0 -0
  47. /package/dist/{knip.js → tools/knip/index.js} +0 -0
  48. /package/dist/{prettier.cjs → tools/prettier/index.cjs} +0 -0
@@ -1,39 +0,0 @@
1
- const DEVTOOLS_COMMANDS = [
2
- {
3
- path: ['lint'],
4
- capability: 'devtools.lint',
5
- summary: 'Run the shared ESLint toolchain.',
6
- packageName: 'eslint',
7
- binName: 'eslint',
8
- },
9
- {
10
- path: ['format'],
11
- capability: 'devtools.format',
12
- summary: 'Run the shared Prettier toolchain.',
13
- packageName: 'prettier',
14
- binName: 'prettier',
15
- },
16
- {
17
- path: ['knip'],
18
- capability: 'devtools.knip',
19
- summary: 'Run the shared Knip toolchain.',
20
- packageName: 'knip',
21
- binName: 'knip',
22
- },
23
- ];
24
- export function getDevtoolsCommands() {
25
- return DEVTOOLS_COMMANDS;
26
- }
27
- export function findDevtoolsCommandByPath(path) {
28
- if (path.length !== 1) {
29
- return null;
30
- }
31
- return DEVTOOLS_COMMANDS.find((command) => command.path[0] === path[0]) ?? null;
32
- }
33
- export function getDevtoolsCommand(toolName) {
34
- const command = DEVTOOLS_COMMANDS.find((candidate) => candidate.path[0] === toolName);
35
- if (command === undefined) {
36
- throw new Error(`Unknown devtools command: ${toolName}`);
37
- }
38
- return command;
39
- }
@@ -1,31 +0,0 @@
1
- import type { DevtoolsCommandDefinition, DevtoolsToolName } from './devtoolsCommands.js';
2
- export type { DevtoolsCommandDefinition, DevtoolsToolName };
3
- export interface DevtoolsRunResult {
4
- exitCode: number;
5
- }
6
- interface DevtoolsRunnerOptions {
7
- cwd?: string;
8
- env?: NodeJS.ProcessEnv;
9
- }
10
- interface ResolvedExecutionTarget {
11
- command: string;
12
- args: readonly string[];
13
- shell: boolean;
14
- }
15
- interface SpawnedProcess {
16
- on(event: 'error', listener: (error: Error) => void): SpawnedProcess;
17
- on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): SpawnedProcess;
18
- }
19
- type SpawnProcess = (command: string, args: readonly string[], options: {
20
- cwd: string;
21
- env: NodeJS.ProcessEnv;
22
- shell: boolean;
23
- stdio: 'inherit';
24
- }) => SpawnedProcess;
25
- interface DevtoolsRunnerDependencies {
26
- readonly logError: (message: string) => void;
27
- readonly resolveExecutionTarget: (command: DevtoolsCommandDefinition) => Promise<ResolvedExecutionTarget>;
28
- readonly spawnProcess: SpawnProcess;
29
- }
30
- export declare function runDevtoolsCommand(command: DevtoolsCommandDefinition, argv: readonly string[], options?: DevtoolsRunnerOptions): Promise<DevtoolsRunResult>;
31
- export declare function runDevtoolsCommandWithDependencies(command: DevtoolsCommandDefinition, argv: readonly string[], options: DevtoolsRunnerOptions | undefined, dependencies: DevtoolsRunnerDependencies): Promise<DevtoolsRunResult>;
@@ -1,3 +0,0 @@
1
- import type { DevtoolsToolName } from './runDevtoolsCommand.js';
2
- import { type DevtoolsRunResult } from './runDevtoolsCommand.js';
3
- export declare function runStandaloneDevtoolsCommand(toolName: DevtoolsToolName, argv: readonly string[]): Promise<DevtoolsRunResult>;
@@ -1,5 +0,0 @@
1
- import { getDevtoolsCommand } from './devtoolsCommands.js';
2
- import { runDevtoolsCommand } from './runDevtoolsCommand.js';
3
- export async function runStandaloneDevtoolsCommand(toolName, argv) {
4
- return runDevtoolsCommand(getDevtoolsCommand(toolName), argv);
5
- }
package/dist/knip-cli.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runStandaloneDevtoolsCommand } from './internal/runStandaloneDevtoolsCommand.js';
3
- const result = await runStandaloneDevtoolsCommand('knip', process.argv.slice(2));
4
- process.exit(result.exitCode);
package/dist/knip.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { KnipConfig } from 'knip';
2
- export interface DevtoolsKnipWorkspaceConfigOptions {
3
- entry?: string[];
4
- project?: string[];
5
- ignore?: string[];
6
- ignoreBinaries?: string[];
7
- ignoreDependencies?: (string | RegExp)[];
8
- ignoreFiles?: string[];
9
- }
10
- export interface DevtoolsKnipConfigOptions extends DevtoolsKnipWorkspaceConfigOptions {
11
- workspaces?: Record<string, DevtoolsKnipWorkspaceConfigOptions>;
12
- }
13
- export interface DevtoolsKnipMonorepoConfigOptions {
14
- root?: DevtoolsKnipWorkspaceConfigOptions;
15
- workspaceDefaults?: DevtoolsKnipWorkspaceConfigOptions;
16
- workspaceGlobs?: string[];
17
- workspaces?: Record<string, DevtoolsKnipWorkspaceConfigOptions>;
18
- }
19
- export declare function createKnipConfig(options?: DevtoolsKnipConfigOptions): KnipConfig;
20
- export declare function createKnipMonorepoConfig(options?: DevtoolsKnipMonorepoConfigOptions): KnipConfig;
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runStandaloneDevtoolsCommand } from './internal/runStandaloneDevtoolsCommand.js';
3
- const result = await runStandaloneDevtoolsCommand('format', process.argv.slice(2));
4
- process.exit(result.exitCode);
package/dist/types.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type tseslint from 'typescript-eslint';
2
- type FlatConfig = ReturnType<typeof tseslint.config>;
3
- export type FlatConfigItem = FlatConfig[number];
4
- interface RestrictedImport {
5
- name: string;
6
- message: string;
7
- }
8
- export interface DevtoolsConfigOptions {
9
- tsconfigRootDir: string;
10
- project: string[];
11
- files: string[];
12
- allowDefaultProject?: string[];
13
- additionalIgnores?: string[];
14
- restrictedImports?: RestrictedImport[];
15
- overrides?: FlatConfigItem[];
16
- includePrettier?: boolean;
17
- }
18
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes