11import fs from "node:fs" ;
22import path from "node:path" ;
33import {
4- getTemplates ,
4+ getAllTemplates ,
55 readJson ,
66 readJsonC ,
77 readToml ,
@@ -19,7 +19,7 @@ export type LintConfig = {
1919const integrationsPlatCategories = [ "starter" , "storage" , "ai" ] ;
2020
2121export function lint ( config : LintConfig ) {
22- const templates = getTemplates ( config . templateDirectory ) ;
22+ const templates = getAllTemplates ( config . templateDirectory ) ;
2323 const results = templates . flatMap ( ( template ) =>
2424 lintTemplate ( template , config . fix ) ,
2525 ) ;
@@ -42,7 +42,7 @@ const CHECKS = {
4242 "package.json" : [ lintPackageJson ] ,
4343 ".gitignore" : [ lintGitIgnore ] ,
4444} ;
45- const TARGET_COMPATIBILITY_DATE = "2025-04-01 " ;
45+ const TARGET_COMPATIBILITY_DATE = "2025-10-08 " ;
4646const DASH_CONTENT_START_MARKER = "<!-- dash-content-start -->" ;
4747const DASH_CONTENT_END_MARKER = "<!-- dash-content-end -->" ;
4848
@@ -290,6 +290,7 @@ function lintPackageJson(
290290 icon_urls ?: string [ ] ;
291291 preview_image_url ?: string ;
292292 preview_icon_url ?: string ;
293+ publish ?: boolean ;
293294 } ;
294295 } ;
295296
@@ -323,13 +324,16 @@ function lintPackageJson(
323324 ) ;
324325 } ) ;
325326 }
326- // Ensure a preview image URL is set
327- if ( ! pkg . cloudflare . preview_image_url ) {
328- problems . push ( '"cloudflare.preview_image_url" must be defined' ) ;
329- }
330- // Ensure preview_icon_url is set
331- if ( ! pkg . cloudflare . preview_icon_url ) {
332- problems . push ( '"cloudflare.preview_icon_url" must be defined' ) ;
327+ // Only require preview URLs for published templates
328+ if ( pkg . cloudflare . publish === true ) {
329+ // Ensure a preview image URL is set
330+ if ( ! pkg . cloudflare . preview_image_url ) {
331+ problems . push ( '"cloudflare.preview_image_url" must be defined' ) ;
332+ }
333+ // Ensure preview_icon_url is set
334+ if ( ! pkg . cloudflare . preview_icon_url ) {
335+ problems . push ( '"cloudflare.preview_icon_url" must be defined' ) ;
336+ }
333337 }
334338 }
335339
0 commit comments