Skip to content

Commit

Permalink
fix(build): Patch Astro for underscore issue, again
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Jul 9, 2023
1 parent d2e47ce commit 2dd6593
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 34 deletions.
2 changes: 2 additions & 0 deletions astro.config.mjs
Expand Up @@ -77,6 +77,8 @@ export default defineConfig({
tooltipSuccessBackground: "#e65161",
},
},
useThemedScrollbars: false,
useThemedSelectionColors: false,
styleOverrides: {
uiLineHeight: "inherit",
codeFontSize: "0.875rem",
Expand Down
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -21,7 +21,7 @@
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"astro": "2.8.0",
"astro": "^2.8.0",
"astro-auto-import": "^0.3.0",
"astro-icon": "0.8.1",
"eslint": "^8.44.0",
Expand All @@ -47,13 +47,16 @@
}
}
}
},
"patchedDependencies": {
"astro@2.8.0": "patches/astro@2.8.0.patch"
}
},
"packageManager": "pnpm@8.6.2",
"dependencies": {
"@astrojs/mdx": "^0.19.7",
"@types/igdb-api-node": "^5.0.0",
"astro-expressive-code": "^0.12.1",
"astro-expressive-code": "^0.13.0",
"dotenv": "^16.3.1",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
Expand Down
54 changes: 54 additions & 0 deletions patches/astro@2.8.0.patch
@@ -0,0 +1,54 @@
diff --git a/dist/content/vite-plugin-content-virtual-mod.js b/dist/content/vite-plugin-content-virtual-mod.js
index 37fad4848076936df3e3dfad2c3385c0fe3fd54e..278baeadc06a220ac6e466f76a133de7df31022b 100644
--- a/dist/content/vite-plugin-content-virtual-mod.js
+++ b/dist/content/vite-plugin-content-virtual-mod.js
@@ -4,19 +4,18 @@ import { extname } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import pLimit from "p-limit";
import { AstroError, AstroErrorData } from "../core/errors/index.js";
-import { appendForwardSlash } from "../core/path.js";
import { rootRelativePath } from "../core/util.js";
import { VIRTUAL_MODULE_ID } from "./consts.js";
import {
- getContentEntryIdAndSlug,
- getContentPaths,
- getDataEntryExts,
- getDataEntryId,
- getEntryCollectionName,
- getEntryConfigByExtMap,
- getEntrySlug,
- getEntryType,
- getExtGlob
+ getContentEntryIdAndSlug,
+ getContentPaths,
+ getDataEntryExts,
+ getDataEntryId,
+ getEntryCollectionName,
+ getEntryConfigByExtMap,
+ getEntrySlug,
+ getEntryType,
+ getExtGlob
} from "./utils.js";
function astroContentVirtualModPlugin({
settings
@@ -165,14 +164,14 @@ const UnexpectedLookupMapError = new AstroError({
});
function globWithUnderscoresIgnored(relContentDir, exts) {
const extGlob = getExtGlob(exts);
- const contentDir = appendForwardSlash(relContentDir);
return [
- `${contentDir}**/*${extGlob}`,
- `!${contentDir}_*/**${extGlob}`,
- `!${contentDir}_*${extGlob}`
+ `${relContentDir}/**/*${extGlob}`,
+ `!**/_*/**${extGlob}`,
+ `!**/_*${extGlob}`,
];
}
export {
- astroContentVirtualModPlugin,
- getStringifiedLookupMap
+ astroContentVirtualModPlugin,
+ getStringifiedLookupMap
};
+
70 changes: 38 additions & 32 deletions pnpm-lock.yaml

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

0 comments on commit 2dd6593

Please sign in to comment.