knip 6.45.0 → 6.46.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 (213) hide show
  1. package/README.md +42 -18
  2. package/dist/ConfigurationChief.d.ts +6 -0
  3. package/dist/ConfigurationChief.js +2 -2
  4. package/dist/DependencyDeputy.d.ts +12 -14
  5. package/dist/DependencyDeputy.js +33 -21
  6. package/dist/IssueCollector.d.ts +1 -0
  7. package/dist/IssueCollector.js +4 -1
  8. package/dist/PackagePeeker.d.ts +0 -9
  9. package/dist/PackagePeeker.js +0 -38
  10. package/dist/ProjectPrincipal.d.ts +1 -1
  11. package/dist/ProjectPrincipal.js +3 -1
  12. package/dist/WorkspaceWorker.js +7 -7
  13. package/dist/binaries/bash-parser.js +5 -8
  14. package/dist/binaries/command.js +2 -2
  15. package/dist/binaries/fallback.d.ts +5 -1
  16. package/dist/binaries/fallback.js +41 -10
  17. package/dist/binaries/plugins.d.ts +1 -0
  18. package/dist/binaries/plugins.js +75 -39
  19. package/dist/binaries/resolvers/bun.js +2 -2
  20. package/dist/binaries/resolvers/npm.js +2 -2
  21. package/dist/binaries/resolvers/npx.js +2 -2
  22. package/dist/binaries/resolvers/nub.js +2 -2
  23. package/dist/binaries/resolvers/pnpm.js +29 -21
  24. package/dist/binaries/resolvers/pnpx.js +20 -8
  25. package/dist/binaries/resolvers/vp.js +1 -1
  26. package/dist/binaries/resolvers/yarn.js +1 -1
  27. package/dist/binaries/util.d.ts +4 -1
  28. package/dist/binaries/util.js +10 -13
  29. package/dist/constants.js +18 -0
  30. package/dist/graph/SubpathReferences.d.ts +1 -1
  31. package/dist/graph/SubpathReferences.js +4 -3
  32. package/dist/graph/build.js +11 -12
  33. package/dist/plugins/_template/index.js +2 -2
  34. package/dist/plugins/angular/index.js +3 -8
  35. package/dist/plugins/astro/resolveFromAST.js +2 -2
  36. package/dist/plugins/astro-markdoc/index.js +2 -2
  37. package/dist/plugins/aws-cdk/index.js +3 -3
  38. package/dist/plugins/babel/index.js +5 -3
  39. package/dist/plugins/borp/index.js +2 -2
  40. package/dist/plugins/bun/index.js +3 -3
  41. package/dist/plugins/capacitor/index.js +33 -6
  42. package/dist/plugins/capacitor/types.d.ts +10 -0
  43. package/dist/plugins/changesets/index.js +2 -2
  44. package/dist/plugins/commitizen/index.js +2 -2
  45. package/dist/plugins/commitlint/index.js +2 -2
  46. package/dist/plugins/convex/index.js +2 -2
  47. package/dist/plugins/cspell/index.js +2 -2
  48. package/dist/plugins/cucumber/index.js +2 -2
  49. package/dist/plugins/cypress/index.js +3 -3
  50. package/dist/plugins/docusaurus/helpers.js +4 -4
  51. package/dist/plugins/docusaurus/index.js +3 -3
  52. package/dist/plugins/dotenv/index.js +6 -2
  53. package/dist/plugins/drizzle/index.js +2 -2
  54. package/dist/plugins/electron-builder/index.d.ts +3 -0
  55. package/dist/plugins/electron-builder/index.js +61 -0
  56. package/dist/plugins/electron-forge/index.js +2 -2
  57. package/dist/plugins/electron-vite/index.js +4 -3
  58. package/dist/plugins/electron-vite/types.d.ts +3 -0
  59. package/dist/plugins/eleventy/index.js +2 -2
  60. package/dist/plugins/ember/compiler.d.ts +2 -0
  61. package/dist/plugins/ember/compiler.js +14 -0
  62. package/dist/plugins/ember/index.d.ts +6 -0
  63. package/dist/plugins/ember/index.js +160 -0
  64. package/dist/plugins/ember/types.d.ts +13 -0
  65. package/dist/plugins/ember/types.js +1 -0
  66. package/dist/plugins/ember/visitors/importSync.d.ts +2 -0
  67. package/dist/plugins/ember/visitors/importSync.js +32 -0
  68. package/dist/plugins/ember-template-lint/index.d.ts +3 -0
  69. package/dist/plugins/ember-template-lint/index.js +20 -0
  70. package/dist/plugins/env-cmd/index.d.ts +3 -0
  71. package/dist/plugins/env-cmd/index.js +16 -0
  72. package/dist/plugins/esbuild/index.js +2 -2
  73. package/dist/plugins/eslint/helpers.js +6 -6
  74. package/dist/plugins/eslint/index.js +0 -1
  75. package/dist/plugins/eslint/resolveFromAST.js +11 -3
  76. package/dist/plugins/evalite/index.js +2 -2
  77. package/dist/plugins/expo/helpers.js +10 -10
  78. package/dist/plugins/expo-router/index.js +3 -3
  79. package/dist/plugins/filesystem-routing/index.js +4 -4
  80. package/dist/plugins/flue/index.js +4 -4
  81. package/dist/plugins/gatsby/index.js +3 -3
  82. package/dist/plugins/github-action/index.js +2 -2
  83. package/dist/plugins/github-actions/index.js +2 -2
  84. package/dist/plugins/graphql-codegen/index.js +8 -6
  85. package/dist/plugins/index.d.ts +6 -0
  86. package/dist/plugins/index.js +12 -0
  87. package/dist/plugins/jasmine/index.js +3 -4
  88. package/dist/plugins/jest/index.js +3 -3
  89. package/dist/plugins/karma/helpers.js +2 -2
  90. package/dist/plugins/karma/index.js +5 -1
  91. package/dist/plugins/knex/index.js +13 -7
  92. package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
  93. package/dist/plugins/linthtml/index.js +2 -2
  94. package/dist/plugins/lunaria/index.js +3 -3
  95. package/dist/plugins/maestro/index.d.ts +3 -0
  96. package/dist/plugins/maestro/index.js +54 -0
  97. package/dist/plugins/maestro/types.d.ts +21 -0
  98. package/dist/plugins/maestro/types.js +1 -0
  99. package/dist/plugins/markdownlint/index.js +3 -3
  100. package/dist/plugins/marko/index.js +4 -4
  101. package/dist/plugins/mastra/index.js +3 -3
  102. package/dist/plugins/mdx/index.js +3 -3
  103. package/dist/plugins/mdxlint/index.js +2 -2
  104. package/dist/plugins/metro/index.js +5 -5
  105. package/dist/plugins/mikro-orm/index.js +3 -4
  106. package/dist/plugins/mise/scripts.js +2 -3
  107. package/dist/plugins/mocha/index.js +8 -7
  108. package/dist/plugins/netlify/index.js +3 -3
  109. package/dist/plugins/next/index.js +5 -5
  110. package/dist/plugins/next-mdx/resolveFromAST.js +2 -2
  111. package/dist/plugins/nitro/index.js +4 -4
  112. package/dist/plugins/node/index.d.ts +16 -0
  113. package/dist/plugins/node/index.js +89 -23
  114. package/dist/plugins/nodemon/index.js +1 -1
  115. package/dist/plugins/npm-package-json-lint/index.js +2 -2
  116. package/dist/plugins/nuxt/index.js +16 -14
  117. package/dist/plugins/nx/index.js +3 -3
  118. package/dist/plugins/nyc/index.js +39 -2
  119. package/dist/plugins/oclif/index.js +2 -2
  120. package/dist/plugins/openclaw/index.js +5 -5
  121. package/dist/plugins/oxlint/index.js +2 -2
  122. package/dist/plugins/panda-css/index.js +7 -2
  123. package/dist/plugins/parcel/index.js +2 -2
  124. package/dist/plugins/payload/index.js +3 -3
  125. package/dist/plugins/playwright/index.js +4 -4
  126. package/dist/plugins/pm2/index.js +2 -2
  127. package/dist/plugins/pnpm/index.js +1 -1
  128. package/dist/plugins/postcss/index.js +2 -2
  129. package/dist/plugins/preconstruct/index.js +2 -2
  130. package/dist/plugins/prettier/index.js +4 -3
  131. package/dist/plugins/prisma/index.js +5 -5
  132. package/dist/plugins/quasar/resolveFromAST.js +6 -6
  133. package/dist/plugins/qwik/resolveFromAST.js +3 -3
  134. package/dist/plugins/raycast/index.js +2 -2
  135. package/dist/plugins/react-cosmos/index.js +2 -2
  136. package/dist/plugins/react-router/index.js +6 -6
  137. package/dist/plugins/relay/index.js +3 -3
  138. package/dist/plugins/release-it/index.js +2 -5
  139. package/dist/plugins/remark/helpers.js +2 -2
  140. package/dist/plugins/retry-cli/index.js +0 -1
  141. package/dist/plugins/rolldown/index.js +2 -2
  142. package/dist/plugins/rollup/index.js +2 -2
  143. package/dist/plugins/rsbuild/index.js +3 -3
  144. package/dist/plugins/rslib/index.js +2 -2
  145. package/dist/plugins/rslint/index.d.ts +3 -0
  146. package/dist/plugins/rslint/index.js +16 -0
  147. package/dist/plugins/rspack/index.js +4 -0
  148. package/dist/plugins/rstest/index.js +4 -4
  149. package/dist/plugins/semantic-release/index.js +2 -2
  150. package/dist/plugins/serverless-framework/index.js +4 -4
  151. package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +3 -3
  152. package/dist/plugins/sst/resolveFromAST.js +2 -2
  153. package/dist/plugins/starlight/resolveFromAST.js +3 -3
  154. package/dist/plugins/stencil/resolveFromAST.js +5 -5
  155. package/dist/plugins/storybook/index.js +2 -2
  156. package/dist/plugins/stryker/index.js +2 -2
  157. package/dist/plugins/stylelint/index.js +4 -4
  158. package/dist/plugins/sveltekit/resolveFromAST.js +7 -5
  159. package/dist/plugins/swc/index.js +2 -2
  160. package/dist/plugins/tailwind/index.js +3 -2
  161. package/dist/plugins/tanstack-router/index.js +5 -2
  162. package/dist/plugins/textlint/helpers.js +2 -2
  163. package/dist/plugins/ts-node/index.js +23 -6
  164. package/dist/plugins/tsd/index.js +1 -1
  165. package/dist/plugins/tsdown/index.js +4 -4
  166. package/dist/plugins/tsup/index.js +3 -3
  167. package/dist/plugins/tsx/index.js +4 -3
  168. package/dist/plugins/turbo/index.js +2 -2
  169. package/dist/plugins/typedoc/index.js +4 -3
  170. package/dist/plugins/typescript/index.js +4 -4
  171. package/dist/plugins/varlock/scan.js +6 -3
  172. package/dist/plugins/vite/helpers.js +2 -2
  173. package/dist/plugins/vite-plugin-pages/index.js +2 -2
  174. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  175. package/dist/plugins/vite-plugin-vue-layouts-next/index.js +2 -2
  176. package/dist/plugins/vitest/index.js +14 -18
  177. package/dist/plugins/webdriver-io/index.js +35 -18
  178. package/dist/plugins/webdriver-io/types.d.ts +3 -2
  179. package/dist/plugins/webpack/index.js +5 -8
  180. package/dist/plugins/wrangler/index.js +3 -3
  181. package/dist/plugins/wxt/index.js +2 -2
  182. package/dist/plugins/yarn/index.js +5 -5
  183. package/dist/session/incremental.d.ts +1 -1
  184. package/dist/session/index.d.ts +1 -0
  185. package/dist/session/index.js +1 -0
  186. package/dist/types/PluginNames.d.ts +2 -2
  187. package/dist/types/PluginNames.js +6 -0
  188. package/dist/types/args.d.ts +4 -3
  189. package/dist/types/config.d.ts +2 -0
  190. package/dist/types/module-graph.d.ts +1 -1
  191. package/dist/types/package-json.d.ts +1 -0
  192. package/dist/types/workspace.d.ts +10 -8
  193. package/dist/typescript/ast-nodes.js +51 -6
  194. package/dist/typescript/get-imports-and-exports.js +5 -2
  195. package/dist/typescript/visitors/exports.js +6 -32
  196. package/dist/typescript/visitors/imports.d.ts +1 -1
  197. package/dist/typescript/visitors/imports.js +15 -24
  198. package/dist/typescript/visitors/walk.d.ts +5 -0
  199. package/dist/typescript/visitors/walk.js +75 -30
  200. package/dist/util/codeowners.js +4 -1
  201. package/dist/util/get-included-issue-types.js +1 -0
  202. package/dist/util/input.d.ts +3 -6
  203. package/dist/util/input.js +6 -20
  204. package/dist/util/parse-and-convert-gitignores.js +5 -4
  205. package/dist/util/parse-args.d.ts +2 -1
  206. package/dist/util/parse-args.js +13 -3
  207. package/dist/util/plugin.js +6 -4
  208. package/dist/util/regex.js +10 -1
  209. package/dist/util/watch.js +1 -1
  210. package/dist/version.d.ts +1 -1
  211. package/dist/version.js +1 -1
  212. package/package.json +1 -1
  213. package/schema.json +36 -5
@@ -0,0 +1,160 @@
1
+ import { readdirSync } from 'node:fs';
2
+ import { isDirectory, isFile, loadJSON } from '../../util/fs.js';
3
+ import { toAlias, toDependency, toEntry, toEntryPath, toIgnore, toProject } from '../../util/input.js';
4
+ import { getPackageNameFromSpecifier } from '../../util/modules.js';
5
+ import { dirname, join } from '../../util/path.js';
6
+ import { hasDependency } from '../../util/plugin.js';
7
+ import { resolvePackageManifestPath } from '../../util/resolve.js';
8
+ import { compiler } from './compiler.js';
9
+ import { createImportSyncVisitor } from './visitors/importSync.js';
10
+ const title = 'Ember';
11
+ const enablers = ['ember-cli', 'ember-source'];
12
+ const isEnabled = ({ dependencies, manifest }) => hasDependency(dependencies, enablers) || Boolean(manifest.peerDependencies?.['ember-source']);
13
+ const packageJsonPath = 'ember-addon';
14
+ const config = ['package.json'];
15
+ const getAppPatterns = (dir) => [
16
+ `${dir}/styles/app.{css,scss,sass,less,styl}`,
17
+ `${dir}/{app,router,resolver}.{js,ts}`,
18
+ `${dir}/{adapters,components,controllers,helpers,initializers,instance-initializers,locations,models,modifiers,routes,serializers,services,templates,transforms}/**/*.{js,ts,gjs,gts}`,
19
+ ];
20
+ const entry = [
21
+ 'ember-cli-build.{js,cjs,mjs}',
22
+ 'testem.{js,cjs,mjs}',
23
+ 'config/*.js',
24
+ 'blueprints/*/index.js',
25
+ 'server/index.js',
26
+ 'server/{mocks,proxies}/**/*.js',
27
+ 'tests/test-helper.{js,ts}',
28
+ 'tests/**/*{-,.}test.{js,ts,gjs,gts}',
29
+ 'tests/dummy/config/*.js',
30
+ ...getAppPatterns('tests/dummy/app'),
31
+ 'addon-test-support/**/*.{js,ts,gjs,gts}',
32
+ ];
33
+ const production = [...getAppPatterns('app'), 'addon/**/*.{js,ts,gjs,gts}'];
34
+ const implicitFields = [
35
+ 'app-js',
36
+ 'public-assets',
37
+ 'implicit-modules',
38
+ 'implicit-scripts',
39
+ 'implicit-styles',
40
+ 'renamed-modules',
41
+ ];
42
+ const isAddon = (pkg) => Boolean(pkg.keywords?.includes('ember-addon'));
43
+ const getModuleNames = (dir) => {
44
+ const names = [];
45
+ if (!isDirectory(dir))
46
+ return names;
47
+ for (const name of readdirSync(dir)) {
48
+ if (!name.startsWith('@'))
49
+ names.push(name.replace(/\.js$/, ''));
50
+ else
51
+ for (const scoped of readdirSync(join(dir, name)))
52
+ names.push(`${name}/${scoped.replace(/\.js$/, '')}`);
53
+ }
54
+ return names;
55
+ };
56
+ const resolveConfig = async (config, { cwd }) => {
57
+ const inputs = [];
58
+ if (config.main)
59
+ inputs.push(toEntryPath(join(cwd, config.main), { production: true }));
60
+ for (const path of config.paths ?? []) {
61
+ inputs.push(toEntry(join(path, 'index.js')), toEntry(join(path, '{addon,app}/**/*.{js,ts,gjs,gts}'), { production: true }));
62
+ const manifestPath = join(cwd, path, 'package.json');
63
+ const { name } = isFile(manifestPath) ? await loadJSON(manifestPath) : {};
64
+ if (name) {
65
+ inputs.push(toAlias(name, join(cwd, path, 'addon'), { dir: cwd }), toAlias(`${name}/*`, join(cwd, path, 'addon/*'), { dir: cwd }));
66
+ }
67
+ }
68
+ return inputs;
69
+ };
70
+ const resolveSourceMap = ({ cwd, dependencies }) => dependencies.has('@embroider/addon-dev') ? [{ srcDir: join(cwd, 'src'), outDir: join(cwd, 'dist') }] : [];
71
+ const resolve = async ({ cwd, manifest }) => {
72
+ const inputs = [toIgnore('^@embroider/virtual($|/)', 'dependencies'), toProject('!blueprints/*/files/**')];
73
+ if (!manifest.exports) {
74
+ if (isAddon(manifest)) {
75
+ inputs.push(toAlias('dummy/tests/*', './tests/*', { dir: cwd }), toAlias('dummy/*', './tests/dummy/app/*', { dir: cwd }), toIgnore('dummy', 'dependencies'), toEntry('app/**/*.{js,ts,gjs,gts}', { production: true }));
76
+ }
77
+ else if (manifest.name) {
78
+ inputs.push(toAlias(`${manifest.name}/tests/*`, './tests/*', { dir: cwd }), toAlias(`${manifest.name}/*`, './app/*', { dir: cwd }));
79
+ }
80
+ }
81
+ const isDeclared = (name) => Boolean(manifest.dependencies?.[name] ||
82
+ manifest.devDependencies?.[name] ||
83
+ manifest.peerDependencies?.[name] ||
84
+ manifest.optionalDependencies?.[name]);
85
+ const checked = new Set();
86
+ const provided = new Set();
87
+ for (const dependencies of [manifest.dependencies, manifest.devDependencies, manifest.peerDependencies]) {
88
+ for (const name in dependencies) {
89
+ if (name === 'ember-auto-import')
90
+ inputs.push(toDependency('webpack', { production: true, optional: true }));
91
+ if (name === 'ember-fetch' && !isDeclared('fetch'))
92
+ provided.add('fetch');
93
+ const path = resolvePackageManifestPath(name, cwd);
94
+ if (!path)
95
+ continue;
96
+ const pkg = await loadJSON(path);
97
+ if (!isAddon(pkg))
98
+ continue;
99
+ const meta = pkg['ember-addon'];
100
+ if (!meta || meta.version !== 2 || implicitFields.some(field => Object.keys(meta[field] ?? {}).length > 0)) {
101
+ inputs.push(toDependency(name, { production: dependencies !== manifest.devDependencies }));
102
+ }
103
+ const dir = dirname(path);
104
+ for (const dependency in pkg.dependencies) {
105
+ if (checked.has(dependency) || isDeclared(dependency))
106
+ continue;
107
+ checked.add(dependency);
108
+ const nestedPath = resolvePackageManifestPath(dependency, dir);
109
+ if (nestedPath && isAddon(await loadJSON(nestedPath)))
110
+ provided.add(dependency);
111
+ }
112
+ const renamedModules = meta?.['renamed-modules'];
113
+ if (name === 'ember-source' && !renamedModules) {
114
+ for (const module of [
115
+ ...getModuleNames(join(dir, 'dist/packages')),
116
+ ...getModuleNames(join(dir, 'dist/dependencies')),
117
+ ]) {
118
+ if (!isDeclared(module))
119
+ provided.add(module);
120
+ }
121
+ }
122
+ for (const specifier in renamedModules) {
123
+ const packageName = getPackageNameFromSpecifier(specifier);
124
+ if (packageName && !isDeclared(packageName))
125
+ provided.add(packageName);
126
+ }
127
+ }
128
+ }
129
+ for (const name of provided)
130
+ inputs.push(toIgnore(name, 'dependencies'));
131
+ return inputs;
132
+ };
133
+ const registerCompilers = ({ dependencies, hasDependency, registerCompiler }) => {
134
+ if (!hasDependency('ember-cli') && !hasDependency('ember-source') && !dependencies.has('ember-source'))
135
+ return;
136
+ registerCompiler({ extension: '.gjs', compiler });
137
+ registerCompiler({ extension: '.gts', compiler });
138
+ };
139
+ const registerVisitors = ({ ctx, registerVisitor }) => {
140
+ registerVisitor(createImportSyncVisitor(ctx));
141
+ };
142
+ const note = `Apps from the Vite blueprint export \`app\` and \`tests\` in \`package.json\`, which makes all their files entry files. Enable [includeSubpathExports](/reference/configuration#includesubpathexports) to report unused files in these directories.
143
+
144
+ Pods or a custom app directory? Override the default \`entry\` patterns to match the layout.`;
145
+ export const docs = { note };
146
+ const plugin = {
147
+ title,
148
+ enablers,
149
+ isEnabled,
150
+ packageJsonPath,
151
+ config,
152
+ entry,
153
+ production,
154
+ resolveConfig,
155
+ resolve,
156
+ resolveSourceMap,
157
+ registerCompilers,
158
+ registerVisitors,
159
+ };
160
+ export default plugin;
@@ -0,0 +1,13 @@
1
+ export type EmberAddonConfig = {
2
+ version?: number;
3
+ main?: string;
4
+ paths?: string[];
5
+ 'renamed-modules'?: Record<string, string>;
6
+ [key: string]: unknown;
7
+ };
8
+ export type EmberPackage = {
9
+ name?: string;
10
+ keywords?: string[];
11
+ dependencies?: Record<string, string>;
12
+ 'ember-addon'?: EmberAddonConfig;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { PluginVisitorContext, PluginVisitorObject } from '../../../types/config.ts';
2
+ export declare function createImportSyncVisitor(ctx: PluginVisitorContext): PluginVisitorObject;
@@ -0,0 +1,32 @@
1
+ import { IMPORT_FLAGS } from '../../../constants.js';
2
+ import { getStringValue, isStringLiteral } from '../../../typescript/ast-nodes.js';
3
+ import { isShadowed } from '../../../typescript/visitors/walk.js';
4
+ export function createImportSyncVisitor(ctx) {
5
+ const names = new Set();
6
+ return {
7
+ Program(node) {
8
+ names.clear();
9
+ for (const statement of node.body) {
10
+ if (statement.type !== 'ImportDeclaration' || getStringValue(statement.source) !== '@embroider/macros')
11
+ continue;
12
+ for (const specifier of statement.specifiers ?? []) {
13
+ if (specifier.type === 'ImportSpecifier' &&
14
+ specifier.imported.type === 'Identifier' &&
15
+ specifier.imported.name === 'importSync') {
16
+ names.add(specifier.local.name);
17
+ }
18
+ }
19
+ }
20
+ },
21
+ CallExpression(node) {
22
+ const argument = node.arguments[0];
23
+ if (names.size === 0 ||
24
+ node.callee.type !== 'Identifier' ||
25
+ !names.has(node.callee.name) ||
26
+ isShadowed(node.callee.name, node.callee.start) ||
27
+ !isStringLiteral(argument))
28
+ return;
29
+ ctx.addImport(getStringValue(argument), argument.start, IMPORT_FLAGS.OPAQUE);
30
+ },
31
+ };
32
+ }
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,20 @@
1
+ import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
+ import { toModule } from '../../util/input.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ const title = 'ember-template-lint';
5
+ const enablers = ['ember-template-lint'];
6
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
+ const config = ['.template-lintrc.{js,cjs,mjs}'];
8
+ const resolveFromAST = program => Array.from(collectPropertyValues(program, 'plugins'), id => toModule(id));
9
+ const args = {
10
+ config: ['config-path'],
11
+ };
12
+ const plugin = {
13
+ title,
14
+ enablers,
15
+ isEnabled,
16
+ config,
17
+ resolveFromAST,
18
+ args,
19
+ };
20
+ export default plugin;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,16 @@
1
+ import { spawningArgs } from '../../binaries/util.js';
2
+ const title = 'env-cmd';
3
+ const args = {
4
+ boolean: true,
5
+ string: ['environments', 'file', 'rc-file'],
6
+ alias: { environments: ['e'], file: ['f'], 'rc-file': ['r'] },
7
+ fromArgs: (parsed, argv) => {
8
+ const command = spawningArgs(parsed, argv);
9
+ return parsed['use-shell'] ? command.join(' ') : command;
10
+ },
11
+ };
12
+ const plugin = {
13
+ title,
14
+ args,
15
+ };
16
+ export default plugin;
@@ -1,12 +1,12 @@
1
1
  import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { join } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'esbuild';
6
6
  const enablers = ['esbuild'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
8
  const config = ['esbuild.config.{js,mjs,cjs,ts,mts,cts}', 'esbuild.{js,mjs,cjs,ts,mts,cts}'];
9
- const resolveFromAST = (program, { configFileDir }) => Array.from(collectPropertyValues(program, 'entryPoints'), id => toProductionEntry(join(configFileDir, id)));
9
+ const resolveFromAST = (program, { configFileDir }) => Array.from(collectPropertyValues(program, 'entryPoints'), id => toEntry(join(configFileDir, id), { production: true }));
10
10
  const plugin = {
11
11
  title,
12
12
  enablers,
@@ -1,5 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toConfig, toDeferResolve, toDependency } from '../../util/input.js';
2
+ import { toConfig, toModule, toDependency } from '../../util/input.js';
3
3
  import { getPackageNameFromFilePath, getPackageNameFromModuleSpecifier } from '../../util/modules.js';
4
4
  import { extname, isAbsolute, isInternal } from '../../util/path.js';
5
5
  import { substringBefore } from '../../util/string.js';
@@ -13,7 +13,7 @@ export const getInputs = (config, options) => {
13
13
  const configArray = Array.isArray(config) ? config : [config];
14
14
  const dependencies = configArray.flatMap(config => config.settings ? getDependenciesFromSettings(config.settings) : []);
15
15
  dependencies.push('eslint-import-resolver-typescript');
16
- return compact(dependencies).map(id => toDeferResolve(id, { optional: true }));
16
+ return compact(dependencies).map(id => toModule(id, { optional: true }));
17
17
  };
18
18
  const getInputsDeprecated = (config, options) => {
19
19
  const extendsList = config.extends ? [config.extends].flat() : [];
@@ -30,11 +30,11 @@ const getInputsDeprecated = (config, options) => {
30
30
  const rules = getDependenciesFromRules({});
31
31
  const overrides = config.overrides ? [config.overrides].flat().flatMap(d => getInputsDeprecated(d, options)) : [];
32
32
  const dependencies = compact([...extendsSpecifiers, ...plugins, ...rules]).map(id => toDependency(id));
33
- const resolvers = compact(settings).map(id => toDeferResolve(id));
33
+ const resolvers = compact(settings).map(id => toModule(id));
34
34
  return [...extendConfigs, ...dependencies, ...resolvers, ...parsers, ...babelDependencies, ...overrides];
35
35
  };
36
36
  const isParserObject = (value) => typeof value.parseForESLint === 'function' || typeof value.parse === 'function';
37
- export const toParser = (name) => toDeferResolve(name, name === 'espree' ? { optional: true } : {});
37
+ export const toParser = (name) => toModule(name, name === 'espree' ? { optional: true } : {});
38
38
  const getParsers = ({ parser, parserOptions }) => {
39
39
  const inputs = [];
40
40
  for (const value of [parser, parserOptions?.parser]) {
@@ -117,7 +117,7 @@ const getDependenciesFromSettings = (settings = {}) => {
117
117
  }
118
118
  });
119
119
  };
120
- export const getInputsFromSettings = (settings) => compact(getDependenciesFromSettings(settings)).map(id => toDeferResolve(id, { optional: true }));
120
+ export const getInputsFromSettings = (settings) => compact(getDependenciesFromSettings(settings)).map(id => toModule(id, { optional: true }));
121
121
  const builtinFormatters = new Set(['html', 'json-with-metadata', 'json', 'stylish']);
122
122
  const builtinFormattersUntilV8 = new Set([
123
123
  'checkstyle',
@@ -142,7 +142,7 @@ export const resolveFormatters = (formatters, manifest) => {
142
142
  for (const rawFormatter of [formatters].flat()) {
143
143
  const formatter = rawFormatter.replace(/\\/g, '/');
144
144
  if (!formatter.startsWith('@') && formatter.includes('/')) {
145
- inputs.add(toDeferResolve(isInternal(formatter) ? formatter : `./${formatter}`));
145
+ inputs.add(toModule(isInternal(formatter) ? formatter : `./${formatter}`));
146
146
  }
147
147
  else {
148
148
  const isBuiltin = builtinFormatters.has(formatter) || (isBeforeV9 && builtinFormattersUntilV8.has(formatter));
@@ -48,7 +48,6 @@ export const docs = { note };
48
48
  const args = {
49
49
  config: true,
50
50
  alias: { format: ['f'] },
51
- boolean: ['inspect-config'],
52
51
  resolveInputs: (parsed, { manifest }) => {
53
52
  const inputs = [];
54
53
  if (parsed['inspect-config'])
@@ -1,8 +1,9 @@
1
1
  import { Visitor } from 'oxc-parser';
2
- import { toDeferResolve, toDependency } from '../../util/input.js';
3
- import { findProperty, getPropertyKey } from '../../typescript/ast-helpers.js';
2
+ import { toModule, toDependency } from '../../util/input.js';
3
+ import { findProperty, getPropertyKey, getStringValues } from '../../typescript/ast-helpers.js';
4
4
  import { getStringValue } from '../../typescript/ast-nodes.js';
5
5
  import { isInternal } from '../../util/path.js';
6
+ import { getDependenciesFromConfig } from '../babel/index.js';
6
7
  import { importSettingKinds, toParser } from './helpers.js';
7
8
  const isParserObjectExpression = (node) => {
8
9
  for (const prop of node.properties) {
@@ -20,7 +21,7 @@ const getInputsFromSettingsAST = (program) => {
20
21
  if (!resolver || resolver === 'node' || isInternal(resolver))
21
22
  return;
22
23
  const dep = kind === 'resolver' ? `eslint-import-resolver-${resolver}` : resolver;
23
- inputs.push(toDeferResolve(dep, { optional: true }));
24
+ inputs.push(toModule(dep, { optional: true }));
24
25
  };
25
26
  const addParser = (name) => {
26
27
  if (name)
@@ -56,6 +57,13 @@ const getInputsFromSettingsAST = (program) => {
56
57
  addResolvers(kind, prop.value);
57
58
  }
58
59
  }
60
+ const babelOptions = findProperty(node, 'babelOptions');
61
+ if (babelOptions?.type === 'ObjectExpression') {
62
+ const plugins = [...getStringValues(findProperty(babelOptions, 'plugins'))];
63
+ const presets = [...getStringValues(findProperty(babelOptions, 'presets'))];
64
+ for (const input of getDependenciesFromConfig({ plugins, presets }, false))
65
+ inputs.push(input);
66
+ }
59
67
  const parser = findProperty(findProperty(node, 'parserOptions'), 'parser');
60
68
  if (parser?.type === 'ObjectExpression') {
61
69
  if (isParserObjectExpression(parser))
@@ -1,5 +1,5 @@
1
1
  import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toDeferResolve, toEntry } from '../../util/input.js';
2
+ import { toModule, toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Evalite';
5
5
  const enablers = ['evalite'];
@@ -12,7 +12,7 @@ const resolveFromAST = (program, options) => {
12
12
  for (const id of entry)
13
13
  inputs.push(toEntry(id));
14
14
  for (const id of collectPropertyValues(program, 'setupFiles'))
15
- inputs.push(toDeferResolve(id));
15
+ inputs.push(toModule(id));
16
16
  return inputs;
17
17
  };
18
18
  const plugin = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolveEntry, toDependency, toProductionDependency } from '../../util/input.js';
1
+ import { toEntryPath, toDependency } from '../../util/input.js';
2
2
  import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
3
3
  import { isInternal, join } from '../../util/path.js';
4
4
  const getDummyConfigContext = (options) => ({
@@ -23,7 +23,7 @@ export const getDependencies = async (localConfig, options) => {
23
23
  if (typeof pluginName !== 'string')
24
24
  continue;
25
25
  if (isInternal(pluginName)) {
26
- inputs.add(toDeferResolveEntry(pluginName));
26
+ inputs.add(toEntryPath(pluginName));
27
27
  }
28
28
  else {
29
29
  const packageName = getPackageNameFromModuleSpecifier(pluginName);
@@ -41,32 +41,32 @@ export const getDependencies = async (localConfig, options) => {
41
41
  }
42
42
  for (const pkg of allowedProductionPackages) {
43
43
  if (manifestDependencies.includes(pkg)) {
44
- inputs.add(toProductionDependency(pkg));
44
+ inputs.add(toDependency(pkg, { production: true }));
45
45
  }
46
46
  }
47
47
  if (config.updates?.enabled !== false) {
48
- inputs.add(toProductionDependency('expo-updates'));
48
+ inputs.add(toDependency('expo-updates', { production: true }));
49
49
  }
50
50
  if (config.notification) {
51
- inputs.add(toProductionDependency('expo-notifications'));
51
+ inputs.add(toDependency('expo-notifications', { production: true }));
52
52
  }
53
53
  const isExpoRouter = manifest.main === 'expo-router/entry';
54
54
  if (isExpoRouter) {
55
- inputs.add(toProductionDependency('expo-router'));
55
+ inputs.add(toDependency('expo-router', { production: true }));
56
56
  }
57
57
  if (platforms.includes('web')) {
58
- inputs.add(toProductionDependency('react-native-web'));
59
- inputs.add(toProductionDependency('react-dom'));
58
+ inputs.add(toDependency('react-native-web', { production: true }));
59
+ inputs.add(toDependency('react-dom', { production: true }));
60
60
  if (!isExpoRouter && !options.enabledPlugins.includes('expo-router')) {
61
61
  inputs.add(toDependency('@expo/metro-runtime'));
62
62
  }
63
63
  }
64
64
  if ((platforms.includes('android') && (config.userInterfaceStyle || config.android?.userInterfaceStyle)) ||
65
65
  (platforms.includes('ios') && (config.backgroundColor || config.ios?.backgroundColor))) {
66
- inputs.add(toProductionDependency('expo-system-ui'));
66
+ inputs.add(toDependency('expo-system-ui', { production: true }));
67
67
  }
68
68
  if (platforms.includes('android') && config.androidNavigationBar) {
69
- inputs.add(toProductionDependency('expo-navigation-bar'));
69
+ inputs.add(toDependency('expo-navigation-bar', { production: true }));
70
70
  }
71
71
  return [...inputs];
72
72
  };
@@ -1,4 +1,4 @@
1
- import { toProductionEntry } from '../../util/input.js';
1
+ import { toEntry } from '../../util/input.js';
2
2
  import { join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import expo from '../expo/index.js';
@@ -16,10 +16,10 @@ const resolveConfig = async (localConfig, options) => {
16
16
  const [name, pluginOptions] = plugin;
17
17
  const root = pluginOptions?.root;
18
18
  if (name === 'expo-router' && typeof root === 'string') {
19
- return [toProductionEntry(join(root, '**/*.{js,jsx,ts,tsx}'))];
19
+ return [toEntry(join(root, '**/*.{js,jsx,ts,tsx}'), { production: true })];
20
20
  }
21
21
  }
22
- return production.map(id => toProductionEntry(id));
22
+ return production.map(id => toEntry(id, { production: true }));
23
23
  };
24
24
  const plugin = {
25
25
  title,
@@ -1,7 +1,7 @@
1
1
  import { escapePath } from 'tinyglobby';
2
2
  import { findImportedCalls, findProperty } from '../../typescript/ast-helpers.js';
3
3
  import { getStringValue } from '../../typescript/ast-nodes.js';
4
- import { toProductionEntry } from '../../util/input.js';
4
+ import { toEntry } from '../../util/input.js';
5
5
  import { join, relative, toAbsolute } from '../../util/path.js';
6
6
  import { hasDependency } from '../../util/plugin.js';
7
7
  import { getViteRoot } from '../vite/helpers.js';
@@ -16,10 +16,10 @@ const resolveFromAST = (program, { config, cwd }) => {
16
16
  if (config.entry)
17
17
  return [];
18
18
  const root = getViteRoot(program, cwd);
19
- const toEntry = (dir, pattern) => toProductionEntry(join(cwd, escapePath(relative(cwd, dir)), pattern));
19
+ const toRouteEntry = (dir, pattern) => toEntry(join(cwd, escapePath(relative(cwd, dir)), pattern), { production: true });
20
20
  const calls = findImportedCalls(program, 'filesystem-routing/vite');
21
21
  if (calls.length === 0)
22
- return production.map(pattern => toEntry(root, pattern));
22
+ return production.map(pattern => toRouteEntry(root, pattern));
23
23
  const inputs = [];
24
24
  for (const call of calls) {
25
25
  const options = call.arguments[0];
@@ -42,7 +42,7 @@ const resolveFromAST = (program, { config, cwd }) => {
42
42
  if (extensions.size === 0)
43
43
  continue;
44
44
  const suffix = extensions.size === 1 ? [...extensions][0] : `{${[...extensions].join(',')}}`;
45
- inputs.push(toEntry(toAbsolute(dir, root), `**/*.${suffix}`));
45
+ inputs.push(toRouteEntry(toAbsolute(dir, root), `**/*.${suffix}`));
46
46
  }
47
47
  return inputs;
48
48
  };
@@ -1,6 +1,6 @@
1
1
  import { collectFirstPropertyValue } from '../../typescript/ast-helpers.js';
2
2
  import { isDirectory } from '../../util/fs.js';
3
- import { toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
3
+ import { toEntryPath, toEntry } from '../../util/input.js';
4
4
  import { join } from '../../util/path.js';
5
5
  import { hasDependency } from '../../util/plugin.js';
6
6
  const title = 'Flue';
@@ -23,12 +23,12 @@ const resolveFromAST = (program, { configFileDir }) => {
23
23
  for (const name of entryNames) {
24
24
  const filePath = collectFirstPropertyValue(program, name);
25
25
  if (filePath)
26
- inputs.push(toDeferResolveProductionEntry(join(configFileDir, filePath)));
26
+ inputs.push(toEntryPath(join(configFileDir, filePath), { production: true }));
27
27
  else
28
- inputs.push(toProductionEntry(join(sourceRoot, `${name}.${extensions}`)));
28
+ inputs.push(toEntry(join(sourceRoot, `${name}.${extensions}`), { production: true }));
29
29
  }
30
30
  const agents = collectFirstPropertyValue(program, 'agents') ?? agentsPattern;
31
- inputs.push(toProductionEntry(join(sourceRoot, agents)));
31
+ inputs.push(toEntry(join(sourceRoot, agents), { production: true }));
32
32
  return inputs;
33
33
  };
34
34
  const plugin = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDependency, toProductionEntry } from '../../util/input.js';
1
+ import { toModule, toDependency, toEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Gatsby';
4
4
  const enablers = ['gatsby', 'gatsby-cli'];
@@ -14,10 +14,10 @@ const production = [
14
14
  ];
15
15
  const resolveConfig = async (localConfig, options) => {
16
16
  const { configFileName } = options;
17
- const entries = production.map(id => toProductionEntry(id));
17
+ const entries = production.map(id => toEntry(id, { production: true }));
18
18
  if (configFileName.includes('gatsby-config')) {
19
19
  const plugins = localConfig.plugins ?? [];
20
- return [...entries, ...plugins.map(plugin => toDeferResolve(typeof plugin === 'string' ? plugin : plugin.resolve))];
20
+ return [...entries, ...plugins.map(plugin => toModule(typeof plugin === 'string' ? plugin : plugin.resolve))];
21
21
  }
22
22
  if (configFileName.includes('gatsby-node')) {
23
23
  const plugins = new Set();
@@ -1,4 +1,4 @@
1
- import { toDeferResolveEntry, toProject } from '../../util/input.js';
1
+ import { toEntryPath, toProject } from '../../util/input.js';
2
2
  import { relative } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { getActionDependencies } from '../github-actions/index.js';
@@ -15,7 +15,7 @@ const resolveConfig = async (config, options) => {
15
15
  if (isAssumeArtifact(relativePath))
16
16
  inputs.push(toProject(`!${relativePath}`));
17
17
  else
18
- inputs.push(toDeferResolveEntry(filePath));
18
+ inputs.push(toEntryPath(filePath));
19
19
  }
20
20
  return inputs;
21
21
  };
@@ -1,5 +1,5 @@
1
1
  import { hasFileWithExtension } from '../../util/fs.js';
2
- import { isDeferResolveEntry, toDeferResolveEntry } from '../../util/input.js';
2
+ import { isDeferResolveEntry, toEntryPath } from '../../util/input.js';
3
3
  import { findByKeyDeep } from '../../util/object.js';
4
4
  import { join, relative } from '../../util/path.js';
5
5
  const title = 'GitHub Actions';
@@ -45,7 +45,7 @@ const resolveConfig = async (config, options) => {
45
45
  }
46
46
  }
47
47
  }
48
- return [...inputs, ...getActionDependencies(config, options).map(id => toDeferResolveEntry(id))];
48
+ return [...inputs, ...getActionDependencies(config, options).map(id => toEntryPath(id))];
49
49
  };
50
50
  const plugin = {
51
51
  title,
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDeferResolveEntry, toDeferResolveProductionEntry, toDependency, toProductionEntry, } from '../../util/input.js';
1
+ import { toModule, toEntryPath, toDependency, toEntry } from '../../util/input.js';
2
2
  import { get } from '../../util/object.js';
3
3
  import { isInternal, join, normalize } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
@@ -31,11 +31,13 @@ const getOutputInput = (output, outputConfig, dir) => {
31
31
  const subfolder = normalize(folder)
32
32
  .split('/')
33
33
  .filter(segment => segment !== '' && segment !== '.' && segment !== '..');
34
- return toProductionEntry(join(dir, output, '**', ...subfolder, `${filePerOperation ? '*' : fileName}${extension}`));
34
+ return toEntry(join(dir, output, '**', ...subfolder, `${filePerOperation ? '*' : fileName}${extension}`), {
35
+ production: true,
36
+ });
35
37
  }
36
38
  return output.endsWith('/')
37
- ? toProductionEntry(join(dir, `${output}**`))
38
- : toDeferResolveProductionEntry(output, { dir });
39
+ ? toEntry(join(dir, `${output}**`), { production: true })
40
+ : toEntryPath(output, { production: true, dir });
39
41
  };
40
42
  const resolveConfig = (config, options) => {
41
43
  const codegenConfigs = isGraphqlProjectsConfigTypes(config)
@@ -53,7 +55,7 @@ const resolveConfig = (config, options) => {
53
55
  .map(configOutput => (configOutput.preset ? configOutput.preset : undefined))
54
56
  .filter((preset) => typeof preset === 'string')
55
57
  .map(presetName => isInternal(presetName)
56
- ? toDeferResolve(presetName, { dir: options.cwd })
58
+ ? toModule(presetName, { dir: options.cwd })
57
59
  : presetName.startsWith('@graphql-codegen/')
58
60
  ? presetName
59
61
  : `@graphql-codegen/${presetName}${presetName.endsWith('-preset') ? '' : '-preset'}`);
@@ -72,7 +74,7 @@ const resolveConfig = (config, options) => {
72
74
  if (typeof plugin !== 'string')
73
75
  return [];
74
76
  if (isInternal(plugin))
75
- return [toDeferResolveEntry(plugin, { dir: options.cwd })];
77
+ return [toEntryPath(plugin, { dir: options.cwd })];
76
78
  return [toDependency(getPluginPackageName(plugin))];
77
79
  });
78
80
  return [...presets, ...flatPlugins, ...nestedPlugins, ...outputs].map(id => typeof id === 'string' ? toDependency(id) : id);
@@ -30,9 +30,13 @@ export declare const Plugins: {
30
30
  docusaurus: import("../types/config.ts").Plugin;
31
31
  dotenv: import("../types/config.ts").Plugin;
32
32
  drizzle: import("../types/config.ts").Plugin;
33
+ 'electron-builder': import("../types/config.ts").Plugin;
33
34
  'electron-forge': import("../types/config.ts").Plugin;
34
35
  'electron-vite': import("../types/config.ts").Plugin;
35
36
  eleventy: import("../types/config.ts").Plugin;
37
+ ember: import("../types/config.ts").Plugin;
38
+ 'ember-template-lint': import("../types/config.ts").Plugin;
39
+ 'env-cmd': import("../types/config.ts").Plugin;
36
40
  esbuild: import("../types/config.ts").Plugin;
37
41
  eslint: import("../types/config.ts").Plugin;
38
42
  evalite: import("../types/config.ts").Plugin;
@@ -73,6 +77,7 @@ export declare const Plugins: {
73
77
  'lockfile-lint': import("../types/config.ts").Plugin;
74
78
  'lost-pixel': import("../types/config.ts").Plugin;
75
79
  lunaria: import("../types/config.ts").Plugin;
80
+ maestro: import("../types/config.ts").Plugin;
76
81
  markdownlint: import("../types/config.ts").Plugin;
77
82
  marko: import("../types/config.ts").Plugin;
78
83
  mastra: import("../types/config.ts").Plugin;
@@ -141,6 +146,7 @@ export declare const Plugins: {
141
146
  rollup: import("../types/config.ts").Plugin;
142
147
  rsbuild: import("../types/config.ts").Plugin;
143
148
  rslib: import("../types/config.ts").Plugin;
149
+ rslint: import("../types/config.ts").Plugin;
144
150
  rspack: import("../types/config.ts").Plugin;
145
151
  rstest: import("../types/config.ts").Plugin;
146
152
  sanity: import("../types/config.ts").Plugin;