Skip to content

Commit 0f5bfce

Browse files
authored
Merge pull request #134 from CloudCannon/better-generate-perf
Use cheaper comparisons for the astro extension check
2 parents cd1187a + d6c8e98 commit 0f5bfce

File tree

4 files changed

+41
-40
lines changed

4 files changed

+41
-40
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",

package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"author": "CloudCannon <support@cloudcannon.com>",
3232
"devDependencies": {
33-
"@biomejs/biome": "2.4.4",
33+
"@biomejs/biome": "2.4.6",
3434
"@cloudcannon/configuration-types": "0.0.53",
3535
"@types/he": "^1.2.3",
3636
"@types/js-yaml": "^4.0.9",

src/ssgs/astro.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { MarkdownSettings, Paths } from '@cloudcannon/configuration-types';
22
import { getDecapPaths } from '../external.ts';
33
import type { ExternalConfig } from '../index.ts';
4-
import { extname, stripBottomPath } from '../utility.ts';
4+
import { stripBottomPath } from '../utility.ts';
55
import Ssg, {
66
addBuildSuggestion,
77
type BuildCommands,
@@ -65,7 +65,8 @@ export default class Astro extends Ssg {
6565
for (let j = 0; j < collectionPaths.length; j++) {
6666
for (let i = 0; i < options.filePaths.length; i++) {
6767
if (
68-
extname(options.filePaths[i]) === '.astro' &&
68+
options.filePaths[i].endsWith('.astro') &&
69+
options.filePaths[i].startsWith(collectionPaths[j]) &&
6970
stripBottomPath(options.filePaths[i]) === collectionPaths[j]
7071
) {
7172
astroFilePaths[collectionPaths[j]] = true;

0 commit comments

Comments
 (0)