@mui/internal-code-infra 0.1.1-canary.4 → 0.1.1-canary.40

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 (102) hide show
  1. package/README.md +36 -4
  2. package/build/babel-config.d.mts +7 -1
  3. package/build/changelog/changelogChanges.d.mts +42 -0
  4. package/build/changelog/changelogGrouping.d.mts +52 -0
  5. package/build/changelog/changelogMarkdown.d.mts +69 -0
  6. package/build/changelog/changelogTags.d.mts +15 -0
  7. package/build/changelog/changelogTitle.d.mts +28 -0
  8. package/build/changelog/fetchChangelogData.d.mts +16 -0
  9. package/build/changelog/fetchChangelogs.d.mts +11 -12
  10. package/build/changelog/index.d.mts +25 -0
  11. package/build/changelog/octokit.d.mts +7 -0
  12. package/build/changelog/types.d.ts +174 -0
  13. package/build/eslint/baseConfig.d.mts +1 -1
  14. package/build/eslint/index.d.mts +1 -0
  15. package/build/eslint/mui/rules/no-constructor-assigned-field.d.mts +50 -0
  16. package/build/eslint/nodeSupportConfig.d.mts +11 -0
  17. package/build/eslint/packageJsonConfig.d.mts +7 -0
  18. package/build/remark/config.d.mts +5 -14
  19. package/build/utils/babelPlugin.d.mts +8 -0
  20. package/build/utils/build.d.mts +22 -0
  21. package/build/utils/cjsSourcesPlugin.d.mts +11 -0
  22. package/build/utils/credentials.d.mts +2 -2
  23. package/build/utils/dtsExportsPlugin.d.mts +8 -0
  24. package/build/utils/dtsNamespacesPlugin.d.mts +19 -0
  25. package/build/utils/fileUrlEntriesPlugin.d.mts +9 -0
  26. package/build/utils/getPublishedPkgJson.d.mts +20 -0
  27. package/build/utils/git.d.mts +30 -9
  28. package/build/utils/github.d.mts +8 -0
  29. package/build/utils/jsNamespacesPlugin.d.mts +13 -0
  30. package/build/utils/pnpm.d.mts +67 -3
  31. package/build/utils/publint.d.mts +6 -0
  32. package/build/utils/rolldownOutput.d.mts +38 -0
  33. package/build/utils/testUtils.d.mts +8 -0
  34. package/build/utils/typescript.d.mts +17 -0
  35. package/package.json +61 -49
  36. package/src/babel-config.mjs +35 -1
  37. package/src/brokenLinksChecker/index.mjs +8 -1
  38. package/src/changelog/changelogChanges.mjs +479 -0
  39. package/src/changelog/changelogGrouping.mjs +148 -0
  40. package/src/changelog/changelogMarkdown.mjs +110 -0
  41. package/src/changelog/changelogTags.mjs +34 -0
  42. package/src/changelog/changelogTitle.mjs +56 -0
  43. package/src/changelog/fetchChangelogData.mjs +172 -0
  44. package/src/changelog/fetchChangelogs.mjs +47 -34
  45. package/src/changelog/index.mjs +34 -0
  46. package/src/changelog/octokit.mjs +35 -0
  47. package/src/changelog/types.ts +187 -0
  48. package/src/cli/cmdBaseline.mjs +31 -0
  49. package/src/cli/cmdBuild.mjs +20 -89
  50. package/src/cli/cmdBuildNew.mjs +471 -0
  51. package/src/cli/cmdNetlifyIgnore.mjs +14 -7
  52. package/src/cli/cmdPublish.mjs +17 -3
  53. package/src/cli/cmdPublishNewPackage.mjs +11 -4
  54. package/src/cli/cmdValidateBuiltTypes.mjs +447 -32
  55. package/src/cli/index.mjs +4 -0
  56. package/src/eslint/baseConfig.mjs +10 -2
  57. package/src/eslint/docsConfig.mjs +28 -10
  58. package/src/eslint/index.mjs +1 -0
  59. package/src/eslint/jsonConfig.mjs +2 -1
  60. package/src/eslint/mui/config.mjs +16 -1
  61. package/src/eslint/mui/index.mjs +2 -0
  62. package/src/eslint/mui/rules/disallow-react-api-in-server-components.mjs +4 -1
  63. package/src/eslint/mui/rules/no-constructor-assigned-field.mjs +183 -0
  64. package/src/eslint/nodeSupportConfig.mjs +70 -0
  65. package/src/eslint/packageJsonConfig.mjs +50 -0
  66. package/src/eslint/testConfig.mjs +4 -2
  67. package/src/remark/config.mjs +60 -13
  68. package/src/utils/babelPlugin.mjs +52 -0
  69. package/src/utils/build.mjs +81 -0
  70. package/src/utils/cjsSourcesPlugin.mjs +92 -0
  71. package/src/utils/credentials.mjs +4 -3
  72. package/src/utils/dtsExportsPlugin.mjs +103 -0
  73. package/src/utils/dtsNamespacesPlugin.mjs +226 -0
  74. package/src/utils/extractErrorCodes.mjs +1 -3
  75. package/src/utils/fileUrlEntriesPlugin.mjs +84 -0
  76. package/src/utils/getPublishedPkgJson.mjs +86 -0
  77. package/src/utils/git.mjs +107 -46
  78. package/src/utils/github.mjs +27 -0
  79. package/src/utils/jsNamespacesPlugin.mjs +505 -0
  80. package/src/utils/pnpm.mjs +126 -25
  81. package/src/utils/publint.mjs +34 -0
  82. package/src/utils/rolldownOutput.mjs +70 -0
  83. package/src/utils/testUtils.mjs +26 -0
  84. package/src/utils/typescript.mjs +23 -13
  85. package/vale/styles/MUI/GoogleLatin.yml +5 -2
  86. package/build/cli/cmdArgosPush.d.mts +0 -18
  87. package/build/cli/cmdBuild.d.mts +0 -64
  88. package/build/cli/cmdCopyFiles.d.mts +0 -20
  89. package/build/cli/cmdExtractErrorCodes.d.mts +0 -6
  90. package/build/cli/cmdGenerateChangelog.d.mts +0 -32
  91. package/build/cli/cmdGithubAuth.d.mts +0 -11
  92. package/build/cli/cmdListWorkspaces.d.mts +0 -29
  93. package/build/cli/cmdNetlifyIgnore.d.mts +0 -17
  94. package/build/cli/cmdPublish.d.mts +0 -32
  95. package/build/cli/cmdPublishCanary.d.mts +0 -34
  96. package/build/cli/cmdPublishNewPackage.d.mts +0 -17
  97. package/build/cli/cmdRenameScope.d.mts +0 -18
  98. package/build/cli/cmdSetVersionOverrides.d.mts +0 -9
  99. package/build/cli/cmdVale.d.mts +0 -46
  100. package/build/cli/cmdValidateBuiltTypes.d.mts +0 -2
  101. package/build/cli/index.d.mts +0 -1
  102. package/vale/styles/MUI/CorrectRererenceCased.yml +0 -14
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Lints the output directory with publint. Errors fail the build, warnings are only reported.
3
+ * @param {string} buildDir - The build directory to validate.
4
+ * @returns {Promise<void>}
5
+ */
6
+ export async function validateWithPublint(buildDir) {
7
+ const [{ publint }, { formatMessage }] = await Promise.all([
8
+ import('publint'),
9
+ import('publint/utils'),
10
+ ]);
11
+ // Everything in the output directory is published, so there is nothing to pack.
12
+ const result = await publint({ pkgDir: buildDir, pack: false, level: 'warning' });
13
+ const { pkg } = result;
14
+ // TODO: remove this filter and bump publint to >=0.3.25, which ships the fix from
15
+ // https://github.com/publint/publint/pull/265 (publint checks `browser` values
16
+ // that point at another package as local files).
17
+ const messages = result.messages.filter((message) => {
18
+ if (message.code !== 'FILE_DOES_NOT_EXIST' || message.path[0] !== 'browser') {
19
+ return true;
20
+ }
21
+ const value = message.path.length === 2 ? pkg.browser?.[message.path[1]] : undefined;
22
+ return typeof value !== 'string' || value.startsWith('.');
23
+ });
24
+
25
+ for (const message of messages) {
26
+ const log = message.type === 'error' ? console.error : console.warn;
27
+ log(`publint ${message.type}: ${formatMessage(message, pkg)}`);
28
+ }
29
+
30
+ const errorCount = messages.filter((message) => message.type === 'error').length;
31
+ if (errorCount > 0) {
32
+ throw new Error(`publint found ${errorCount} error(s) in "${buildDir}".`);
33
+ }
34
+ }
@@ -0,0 +1,70 @@
1
+ import { RolldownMagicString } from 'rolldown';
2
+
3
+ export const DTS_FILES = /\.d\.[cm]?ts$/;
4
+
5
+ export const GENERATED_NAMESPACE = /_exports$/;
6
+
7
+ /**
8
+ * @typedef {{ start: number; end: number; text: string }} Edit
9
+ * @typedef {import('rolldown/utils').ESTree.Node} Node
10
+ * @typedef {import('rolldown/utils').ESTree.ModuleExportName | import('rolldown/utils').ESTree.BindingIdentifier} Name
11
+ */
12
+
13
+ /**
14
+ * @param {string} code
15
+ * @param {Edit[]} edits
16
+ */
17
+ export function applyEdits(code, edits) {
18
+ const result = new RolldownMagicString(code);
19
+
20
+ for (const { start, end, text } of edits) {
21
+ if (text) {
22
+ result.update(start, end, text);
23
+ } else {
24
+ result.remove(start, end);
25
+ }
26
+ }
27
+
28
+ return result.toString();
29
+ }
30
+
31
+ /**
32
+ * @param {string} code
33
+ * @param {string} name
34
+ */
35
+ export function countReferences(code, name) {
36
+ const escaped = name.replace(/[$]/g, '\\$&');
37
+
38
+ return code.match(new RegExp(`(?<![\\w$])${escaped}(?![\\w$])`, 'g'))?.length ?? 0;
39
+ }
40
+
41
+ /** @param {Name} node */
42
+ export function getName(node) {
43
+ return node.type === 'Identifier' ? node.name : String(node.value);
44
+ }
45
+
46
+ /**
47
+ * The imported and local names of an import specifier, or the local and exported names of an
48
+ * export specifier.
49
+ * @param {Node} specifier
50
+ * @returns {[Name, Name] | []}
51
+ */
52
+ export function getBinding(specifier) {
53
+ if (specifier.type === 'ImportSpecifier') {
54
+ return [specifier.imported, specifier.local];
55
+ }
56
+
57
+ if (specifier.type === 'ExportSpecifier') {
58
+ return [specifier.local, specifier.exported];
59
+ }
60
+
61
+ return [];
62
+ }
63
+
64
+ /**
65
+ * @param {string} code
66
+ * @param {Node} node
67
+ */
68
+ export function slice(code, node) {
69
+ return code.slice(node.start, node.end);
70
+ }
@@ -19,6 +19,24 @@ export async function makeTempDir() {
19
19
  return tmpDir;
20
20
  }
21
21
 
22
+ /**
23
+ * Creates a temporary directory (see {@link makeTempDir}) containing `files`.
24
+ *
25
+ * @param {Record<string, string>} files - File contents keyed by path relative to the directory.
26
+ * @returns {Promise<string>} The path of the created temporary directory.
27
+ */
28
+ export async function makeTempFiles(files) {
29
+ const tmpDir = await makeTempDir();
30
+ await Promise.all(
31
+ Object.entries(files).map(async ([name, contents]) => {
32
+ const file = path.join(tmpDir, name);
33
+ await fs.mkdir(path.dirname(file), { recursive: true });
34
+ await fs.writeFile(file, contents);
35
+ }),
36
+ );
37
+ return tmpDir;
38
+ }
39
+
22
40
  /**
23
41
  * Write a package.json into a subdirectory of a temp workspace.
24
42
  *
@@ -51,3 +69,11 @@ export function publicPkg(name, pkgPath) {
51
69
  export function privatePkg(name, pkgPath) {
52
70
  return { name, version: '1.0.0', path: pkgPath, isPrivate: true };
53
71
  }
72
+
73
+ export async function getTsgo() {
74
+ const { default: getExePath } = await import(
75
+ new URL('../../../../node_modules/@typescript/native/lib/getExePath.js', import.meta.url).href
76
+ );
77
+
78
+ return getExePath();
79
+ }
@@ -37,7 +37,7 @@ async function findBin(dir, name) {
37
37
  * @param {string} cwd
38
38
  * @returns {Promise<{ native: string | null, js: string }>}
39
39
  */
40
- async function findTscPair(cwd) {
40
+ export async function findTscPair(cwd) {
41
41
  const workspaceDir = await findWorkspaceDir(cwd);
42
42
  if (!workspaceDir) {
43
43
  return { native: null, js: 'tsc' };
@@ -54,6 +54,27 @@ async function findTscPair(cwd) {
54
54
  return { native: tsc, js: tsc6 ?? 'tsc' };
55
55
  }
56
56
 
57
+ /**
58
+ * @param {string} cwd
59
+ * @returns {Promise<string>} The `tsconfig.build.json` to emit declarations with.
60
+ */
61
+ export async function getTsconfig(cwd) {
62
+ const tsconfig = path.join(cwd, 'tsconfig.build.json');
63
+
64
+ const exists = await fs.stat(tsconfig).then(
65
+ (file) => file.isFile(),
66
+ () => false,
67
+ );
68
+
69
+ if (!exists) {
70
+ throw new Error(
71
+ `Unable to find a tsconfig to build types. Add 'tsconfig.build.json' to '${cwd}'.`,
72
+ );
73
+ }
74
+
75
+ return tsconfig;
76
+ }
77
+
57
78
  /**
58
79
  * Emits TypeScript declaration files.
59
80
  * @param {string} tsconfig - The path to the tsconfig.json file.
@@ -233,19 +254,8 @@ export async function createTypes({
233
254
 
234
255
  try {
235
256
  await copyDeclarations(srcDir, tmpDir, { verbose });
236
- const tsconfigPath = path.join(cwd, 'tsconfig.build.json');
237
- const tsconfigExists = await fs.stat(tsconfigPath).then(
238
- (file) => file.isFile(),
239
- () => false,
240
- );
241
257
  if (!skipTsc) {
242
- if (!tsconfigExists) {
243
- throw new Error(
244
- 'Unable to find a tsconfig to build this project. ' +
245
- `The package root needs to contain a 'tsconfig.build.json'. ` +
246
- `The package root is '${cwd}'`,
247
- );
248
- }
258
+ const tsconfigPath = await getTsconfig(cwd);
249
259
  console.log(`Building types for ${tsconfigPath} in ${tmpDir}`);
250
260
  await emitDeclarations(tsconfigPath, tmpDir, { useTsgo });
251
261
  }
@@ -6,6 +6,9 @@ level: error
6
6
  nonword: true
7
7
  action:
8
8
  name: replace
9
+ # Wider than upstream Google.Latin: also catches e.g/eg./i.e/ie. and any trailing
10
+ # punctuation, so no separate rule asks for "e.g." (which this one forbids).
11
+ # The lookbehind skips matches after a dot or inside a word (example.eg).
9
12
  swap:
10
- '\b(?:eg|e\.g\.)(?=[\s,;])': for example
11
- '\b(?:ie|i\.e\.)(?=[\s,;])': that is
13
+ '(?<![\w.])e\.?g\.?(?=[^\w.]|$)': for example
14
+ '(?<![\w.])i\.?e\.?(?=[^\w.]|$)': that is
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- export type Args = {
3
- /**
4
- * - Run with verbose logging
5
- */
6
- verbose?: boolean;
7
- /**
8
- * - Screenshots folder path
9
- */
10
- folder: string;
11
- };
12
- /**
13
- * @typedef {Object} Args
14
- * @property {boolean} [verbose] - Run with verbose logging
15
- * @property {string} folder - Screenshots folder path
16
- */
17
- declare const _default: import('yargs').CommandModule<{}, Args>;
18
- export default _default;
@@ -1,64 +0,0 @@
1
- export type Args = {
2
- /**
3
- * - The bundles to build.
4
- */
5
- bundle: import('../utils/build.mjs').BundleType[];
6
- /**
7
- * - The large files to build.
8
- */
9
- hasLargeFiles: boolean;
10
- /**
11
- * - Whether to skip generating a package.json file in the /esm folder.
12
- */
13
- skipBundlePackageJson: boolean;
14
- /**
15
- * - Whether to enable verbose logging.
16
- */
17
- verbose: boolean;
18
- /**
19
- * - Whether to build types for the package.
20
- */
21
- buildTypes: boolean;
22
- /**
23
- * - Whether to build types for the package.
24
- */
25
- skipTsc: boolean;
26
- /**
27
- * - Whether to skip checking for Babel runtime dependencies in the package.
28
- */
29
- skipBabelRuntimeCheck: boolean;
30
- /**
31
- * - Whether to skip generating the package.json file in the bundle output.
32
- */
33
- skipPackageJson: boolean;
34
- /**
35
- * - Whether to skip checking for main field in package.json.
36
- */
37
- skipMainCheck: boolean;
38
- /**
39
- * - Globs to be ignored by Babel.
40
- */
41
- ignore: string[];
42
- /**
43
- * - Files/Directories to be copied. Can be a glob pattern.
44
- */
45
- copy?: string[];
46
- /**
47
- * - Whether to use the React compiler.
48
- */
49
- enableReactCompiler?: boolean;
50
- /**
51
- * - Whether to build types using the native TypeScript compiler.
52
- */
53
- tsgo?: boolean;
54
- /**
55
- * - Deprecated no-op; flat builds are always used.
56
- */
57
- flat?: boolean;
58
- /**
59
- * - Whether to enumerate glob patterns in exports/imports into concrete entries.
60
- */
61
- expand: boolean;
62
- };
63
- declare const _default: import('yargs').CommandModule<{}, Args>;
64
- export default _default;
@@ -1,20 +0,0 @@
1
- export type Args = {
2
- /**
3
- * Run in silent mode without logging
4
- */
5
- silent?: boolean;
6
- /**
7
- * Exclude default files from the copy operation
8
- */
9
- excludeDefaults?: boolean;
10
- /**
11
- * Glob patterns to copy
12
- */
13
- glob?: string[];
14
- /**
15
- * Extra files to copy
16
- */
17
- files?: string[];
18
- };
19
- declare const _default: import('yargs').CommandModule<{}, Args>;
20
- export default _default;
@@ -1,6 +0,0 @@
1
- export type Args = import('../utils/extractErrorCodes.mjs').Args;
2
- /**
3
- * @typedef {import('../utils/extractErrorCodes.mjs').Args} Args
4
- */
5
- declare const _default: import('yargs').CommandModule<{}, Args>;
6
- export default _default;
@@ -1,32 +0,0 @@
1
- export type Args = {
2
- /**
3
- * Path to the changelog configuration file
4
- */
5
- config: string;
6
- /**
7
- * The git reference (tag/commit) of the last release
8
- */
9
- lastRelease: string;
10
- /**
11
- * The git reference (tag/commit) of the new release
12
- */
13
- release: string;
14
- /**
15
- * The version number for the new release
16
- */
17
- releaseVersion: string;
18
- /**
19
- * The current working directory to run the command in
20
- */
21
- cwd: string;
22
- };
23
- /**
24
- * @typedef {Object} Args
25
- * @property {string} config Path to the changelog configuration file
26
- * @property {string} lastRelease The git reference (tag/commit) of the last release
27
- * @property {string} release The git reference (tag/commit) of the new release
28
- * @property {string} releaseVersion The version number for the new release
29
- * @property {string} cwd The current working directory to run the command in
30
- */
31
- declare const _default: import('yargs').CommandModule<{}, Args>;
32
- export default _default;
@@ -1,11 +0,0 @@
1
- export type Args = {
2
- authorize: boolean;
3
- clear: boolean;
4
- };
5
- /**
6
- * @typedef {Object} Args
7
- * @property {boolean} authorize
8
- * @property {boolean} clear
9
- */
10
- declare const _default: import('yargs').CommandModule<{}, Args>;
11
- export default _default;
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env node
2
- export type PublicPackage = import('../utils/pnpm.mjs').PublicPackage;
3
- export type Args = {
4
- /**
5
- * - Whether to filter to only public packages
6
- */
7
- publicOnly?: boolean;
8
- /**
9
- * - Output format (name, path, or json)
10
- */
11
- output?: 'json' | 'path' | 'name';
12
- /**
13
- * - Git reference to filter changes since
14
- */
15
- sinceRef?: string;
16
- /**
17
- * - Same as filtering packages with --filter in pnpm. Only include packages matching the filter. See https://pnpm.io/filtering.
18
- */
19
- filter?: string[];
20
- };
21
- /**
22
- * @typedef {Object} Args
23
- * @property {boolean} [publicOnly] - Whether to filter to only public packages
24
- * @property {'json'|'path'|'name'} [output] - Output format (name, path, or json)
25
- * @property {string} [sinceRef] - Git reference to filter changes since
26
- * @property {string[]} [filter] - Same as filtering packages with --filter in pnpm. Only include packages matching the filter. See https://pnpm.io/filtering.
27
- */
28
- declare const _default: import('yargs').CommandModule<{}, Args>;
29
- export default _default;
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- export type Args = {
3
- /**
4
- * - List of workspace names to process
5
- */
6
- workspaces: string[];
7
- /**
8
- * - Check mode - error if the generated content differs from current
9
- */
10
- check?: boolean;
11
- /**
12
- * - Branch to compare PRs against (default: master)
13
- */
14
- baseBranch?: string;
15
- };
16
- declare const _default: import('yargs').CommandModule<{}, Args>;
17
- export default _default;
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- export type PublicPackage = import('../utils/pnpm.mjs').PublicPackage;
3
- export type PublishOptions = import('../utils/pnpm.mjs').PublishOptions;
4
- export type PublishSummaryEntry = import('../utils/pnpm.mjs').PublishSummaryEntry;
5
- export type Args = {
6
- /**
7
- * Run in dry-run mode without publishing
8
- */
9
- "dry-run": boolean;
10
- /**
11
- * Create a GitHub draft release after publishing
12
- */
13
- "github-release": boolean;
14
- /**
15
- * NPM dist tag to publish to
16
- */
17
- tag: string;
18
- /**
19
- * Runs in CI environment
20
- */
21
- ci: boolean;
22
- /**
23
- * Git SHA to use for the GitHub release workflow (local only)
24
- */
25
- sha?: string;
26
- /**
27
- * Same as filtering packages with --filter in pnpm. Only publish packages matching the filter. See https://pnpm.io/filtering.
28
- */
29
- filter?: string[];
30
- };
31
- declare const _default: import('yargs').CommandModule<{}, Args>;
32
- export default _default;
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- export type PublicPackage = import('../utils/pnpm.mjs').PublicPackage;
3
- export type VersionInfo = import('../utils/pnpm.mjs').VersionInfo;
4
- export type PublishOptions = import('../utils/pnpm.mjs').PublishOptions;
5
- export type Args = {
6
- /**
7
- * - Whether to run in dry-run mode
8
- */
9
- dryRun?: boolean;
10
- /**
11
- * - Whether to create GitHub releases for canary packages
12
- */
13
- githubRelease?: boolean;
14
- /**
15
- * - Same as filtering packages with --filter in pnpm. Only publish packages matching the filter. See https://pnpm.io/filtering.
16
- */
17
- filter?: string[];
18
- };
19
- export type Commit = {
20
- /**
21
- * - Commit SHA
22
- */
23
- sha: string;
24
- /**
25
- * - Commit message
26
- */
27
- message: string;
28
- /**
29
- * - Commit author
30
- */
31
- author: string;
32
- };
33
- declare const _default: import('yargs').CommandModule<{}, Args>;
34
- export default _default;
@@ -1,17 +0,0 @@
1
- export type Args = {
2
- /**
3
- * If true, will only log the commands without executing them
4
- */
5
- dryRun?: boolean;
6
- /**
7
- * 6 digit auth code to forward to npm for two-factor authentication
8
- */
9
- otp?: string;
10
- };
11
- /**
12
- * @typedef {Object} Args
13
- * @property {boolean} [dryRun] If true, will only log the commands without executing them
14
- * @property {string} [otp] 6 digit auth code to forward to npm for two-factor authentication
15
- */
16
- declare const _default: import('yargs').CommandModule<{}, Args>;
17
- export default _default;
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- export type Args = {
3
- /**
4
- * Source and target scope
5
- */
6
- alias: [string, string];
7
- };
8
- /**
9
- * @typedef {Object} Args
10
- * @property {[string, string]} alias Source and target scope
11
- */
12
- /**
13
- * @param {string} alias
14
- * @returns {[string, string]}
15
- */
16
- export declare function parseAlias(alias: string): [string, string];
17
- declare const _default: import('yargs').CommandModule<{}, Args>;
18
- export default _default;
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- export type Args = {
3
- /**
4
- * - Package version specifiers in format 'package@version'
5
- */
6
- pkg?: string[];
7
- };
8
- declare const _default: import('yargs').CommandModule<{}, Args>;
9
- export default _default;
@@ -1,46 +0,0 @@
1
- export type ValeOS = 'Linux' | 'macOS' | 'Windows';
2
- export type ValeArch = '64-bit' | 'arm64';
3
- /**
4
- * Extracts the replacement text from a vale alert.
5
- * Returns null if no replacement can be determined.
6
- * @param {{ Action: { Name: string; Params: string[] | null }; Message: string }} alert
7
- * @returns {string | null}
8
- */
9
- export declare function getReplacementText(alert: {
10
- Action: {
11
- Name: string;
12
- Params: string[] | null;
13
- };
14
- Message: string;
15
- }): string | null;
16
- /**
17
- * Applies auto-fixes from vale alerts to the source files.
18
- * Processes alerts in reverse order within each line to preserve column positions.
19
- * @param {Record<string, Array<{ Action: { Name: string; Params: string[] | null }; Span: [number, number]; Check: string; Message: string; Severity: string; Match: string; Line: number }>>} results
20
- * @param {'all' | 'error'} fixLevel
21
- * @returns {Promise<{ fixed: number; skipped: number }>}
22
- */
23
- export declare function applyFixes(results: Record<string, Array<{
24
- Action: {
25
- Name: string;
26
- Params: string[] | null;
27
- };
28
- Span: [number, number];
29
- Check: string;
30
- Message: string;
31
- Severity: string;
32
- Match: string;
33
- Line: number;
34
- }>>, fixLevel: 'all' | 'error'): Promise<{
35
- fixed: number;
36
- skipped: number;
37
- }>;
38
- export type Args = {
39
- 'vale-version': string;
40
- 'auto-fix': 'all' | 'error' | undefined;
41
- };
42
- /**
43
- * @typedef {{ 'vale-version': string; 'auto-fix': 'all' | 'error' | undefined; }} Args
44
- */
45
- declare const _default: import('yargs').CommandModule<{}, Args>;
46
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import('yargs').CommandModule<{}, {}>;
2
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- # Write things correctly, please no wrong references.
2
- extends: substitution
3
- message: Use '%s' instead of '%s'
4
- level: error
5
- ignorecase: false
6
- # swap maps tokens in form of bad: good
7
- # for more information: https://vale.sh/docs/topics/styles/#substitution
8
- swap:
9
- eg: e.g.
10
- eg\.: e.g.
11
- e\.g: e.g.
12
- ie: i.e.
13
- ie\.: i.e.
14
- i\.e: i.e.