Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpro-nl/knip
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.38.6
Choose a base ref
...
head repository: webpro-nl/knip
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.39.0
Choose a head ref
  • 3 commits
  • 6 files changed
  • 3 contributors

Commits on Nov 3, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    548270d View commit details
  2. Suppress report for @astrojs/check (#332)

    * Suppress report for `@astrojs/check`
    
    * Fix test
    
    * Remove unnecessary assertion
    risu729 authored Nov 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc2eea8 View commit details
  3. Release 2.39.0

    webpro committed Nov 3, 2023
    Copy the full SHA
    7fe8c11 View commit details
Showing with 18 additions and 7 deletions.
  1. +5 −1 fixtures/plugins/astro/package.json
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
  4. +1 −0 src/constants.ts
  5. +8 −2 src/plugins/astro/index.ts
  6. +1 −1 src/version.ts
6 changes: 5 additions & 1 deletion fixtures/plugins/astro/package.json
Original file line number Diff line number Diff line change
@@ -7,12 +7,16 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"check": "astro check"
},
"dependencies": {
"@astrojs/mdx": "*",
"@astrojs/rss": "*",
"@astrojs/sitemap": "*",
"astro": "*"
},
"devDependencies": {
"@astrojs/check": "*"
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "knip",
"version": "2.38.6",
"version": "2.39.0",
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
"homepage": "https://github.com/webpro/knip",
"repository": "github:webpro/knip",
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ export const GLOBAL_IGNORE_PATTERNS = ['**/node_modules/**', '.yarn'];
export const IGNORED_GLOBAL_BINARIES = [
'bash',
'bun',
'bunx',
'cat',
'cd',
'chmod',
10 changes: 8 additions & 2 deletions src/plugins/astro/index.ts
Original file line number Diff line number Diff line change
@@ -18,9 +18,15 @@ export const ENTRY_FILE_PATTERNS = ['astro.config.{js,cjs,mjs,ts}', 'src/content
export const PRODUCTION_ENTRY_FILE_PATTERNS = ['src/pages/**/*.{astro,mdx,js,ts}', 'src/content/**/*.mdx'];

export const findDependencies: GenericPluginCallback = async (configFilePath, options) => {
const { config } = options;
const { config, manifest } = options;

return config.entry
const dependencies = config.entry
? config.entry.map(toProductionEntryPattern)
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];

if (manifest.scripts && Object.values(manifest.scripts).some(script => /astro (--.+ )?check/.test(script))) {
dependencies.push('@astrojs/check');
}

return dependencies;
};
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '2.38.6';
export const version = '2.39.0';