whereto-bike 0.0.5 → 0.0.7

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "whereto-bike",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "description": "Open-source cycling platform — the CMS for cycling",
6
6
  "license": "AGPL-3.0",
7
7
  "repository": {
@@ -44,7 +44,7 @@ jobs:
44
44
  uses: actions/cache@v5
45
45
  with:
46
46
  path: .astro
47
- key: astro-${{ hashFiles('blog/**') }}
47
+ key: astro-${{ github.run_id }}
48
48
  restore-keys: astro-
49
49
 
50
50
  - name: Resolve VIDEO_PREFIX from wrangler config
@@ -56,7 +56,7 @@ jobs:
56
56
  uses: actions/cache@v5
57
57
  with:
58
58
  path: .astro
59
- key: astro-${{ hashFiles('blog/**') }}
59
+ key: astro-${{ github.run_id }}
60
60
  restore-keys: astro-
61
61
 
62
62
  - name: Restore dist cache
@@ -130,7 +130,7 @@ jobs:
130
130
  CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
131
131
 
132
132
  deploy-lambda:
133
- if: vars.VIDEO_PREFIX != ''
133
+ if: vars.VIDEO_PREFIX != '' && vars.SKIP_LAMBDA_DEPLOY != 'true'
134
134
  runs-on: ubuntu-latest
135
135
  environment: production
136
136
  steps:
@@ -7,7 +7,8 @@
7
7
  "build": "astro build",
8
8
  "preview": "astro preview",
9
9
  "setup": "node scripts/setup.js",
10
- "sync": "node node_modules/whereto-bike/sync.js"
10
+ "sync": "node node_modules/whereto-bike/sync.js",
11
+ "postinstall": "node node_modules/whereto-bike/scripts/patch-astro-renderers.js"
11
12
  },
12
13
  "dependencies": {
13
14
  "@astrojs/cloudflare": "^13.0.0-beta.11",
@@ -65,7 +65,7 @@ function run(cmd, opts = {}) {
65
65
 
66
66
  function commandExists(cmd) {
67
67
  try {
68
- safeExec(`which ${cmd}`, { stdio: 'pipe' });
68
+ safeExec(`command -v ${cmd}`, { stdio: 'pipe', shell: true });
69
69
  return true;
70
70
  } catch {
71
71
  return false;
@@ -7,7 +7,9 @@ import { routeShape } from '../../lib/route-insights';
7
7
  import { difficultyLabel, scoreRoute } from '../../lib/difficulty';
8
8
  import { paths, routeSlug } from '../../lib/paths';
9
9
  import { defaultLocale } from '../../lib/i18n/locale-utils';
10
- import { loadBuildPlan, filterByBuildPlan } from '../../lib/content/build-plan.server';
10
+ // NOTE: This is a single-output endpoint (not parameterized), so it must NOT
11
+ // use filterByBuildPlan — doing so would produce a partial index in incremental
12
+ // mode, overwriting the full one from the previous build.
11
13
 
12
14
  export const prerender = true;
13
15
 
@@ -21,7 +23,7 @@ export const GET: APIRoute = async ({ currentLocale }) => {
21
23
  const config = getCityConfig();
22
24
  const locale = currentLocale || defaultLocale();
23
25
  const allRoutes = await getCollection('routes');
24
- const published = filterByBuildPlan(allRoutes.filter(isPublished), loadBuildPlan(), 'route');
26
+ const published = allRoutes.filter(isPublished);
25
27
 
26
28
  const allScores = published
27
29
  .map(r => scoreRoute(r))
package/sync.js CHANGED
@@ -11,6 +11,7 @@
11
11
  * - scripts/setup.js — interactive setup helper
12
12
  * - astro.config.mjs — Astro config
13
13
  * - tsconfig.json — TypeScript config
14
+ * - package.json — scripts only (merged, preserving name/deps)
14
15
  */
15
16
 
16
17
  import fs from 'node:fs';
@@ -101,6 +102,22 @@ for (const rel of sourceFiles) {
101
102
  }
102
103
  }
103
104
 
105
+ // --- Sync package.json scripts from template ---
106
+ const templatePkgPath = path.join(templateRoot, 'package.json.tpl');
107
+ if (fs.existsSync(templatePkgPath)) {
108
+ const templatePkg = JSON.parse(renderTemplate(fs.readFileSync(templatePkgPath, 'utf-8'), vars));
109
+ const blogPkgPath = path.join(cwd, 'package.json');
110
+ const blogPkg = JSON.parse(fs.readFileSync(blogPkgPath, 'utf-8'));
111
+
112
+ const before = JSON.stringify(blogPkg.scripts);
113
+ blogPkg.scripts = { ...blogPkg.scripts, ...templatePkg.scripts };
114
+ if (JSON.stringify(blogPkg.scripts) !== before) {
115
+ fs.writeFileSync(blogPkgPath, JSON.stringify(blogPkg, null, 2) + '\n');
116
+ console.log(' updated package.json (scripts)');
117
+ updated++;
118
+ }
119
+ }
120
+
104
121
  // --- Summary ---
105
122
  if (updated === 0) {
106
123
  console.log(' Everything is up to date.');