Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ updates:
schedule:
interval: monthly
open-pull-requests-limit: 2
# TypeScript 7 lacks the programmatic API needed by vue-tsc.
# Reconsider after upstream Vue tooling explicitly supports the native compiler.
# TypeScript 6's transpileModule API is used to build the standalone
# browser controller and portable offline Node server. Review TS7 API
# changes and full browser/compiler CI before a major upgrade.
ignore:
- dependency-name: "typescript"
update-types: ["version-update:semver-major"]
# vue-tsc 3.3.14 has a confirmed URL-in-template typecheck regression.
# Permit later patched versions once reviewed; block this one release only.
- dependency-name: "vue-tsc"
versions: ["3.3.14"]
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: npm run scarp:test
- name: Ensure documentation tooling uses TypeScript
run: npm run check:tooling
- name: Verify supported Vue/TypeScript toolchain and dependency-update policy
- name: Verify Scarp-owned TypeScript renderer, parsing libraries and update policy
run: npm run check:toolchain && npm run test:toolchain
- name: Check pages and local links
run: npm run check:docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: npm run check:alpha6-ast && npm run test:alpha6-ast
- name: Validate bilingual compiler host and capability diagnostics
run: npm run check:alpha6-diagnose && npm run test:alpha6-diagnose
- name: Retain transitional compiler/toolchain compatibility checks
- name: Validate independent TypeScript renderer and dependency update policy
run: npm run check:toolchain && npm run test:toolchain
- name: Regression-test complete bilingual sitemap coverage
run: npm run test:sitemap
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Scarp Documentation


**Custom documentation engine:** Scarp Docs now builds from the Scarp-owned TypeScript generator, with bilingual HTML, local search, responsive layout and offline-browser tests. See [architecture and migration gates](SCARP-DOCS-ENGINE.md) and [Issue #70](https://github.com/scarp-lang/scarp-docs/issues/70). Legacy VitePress/Vue validation code and dependencies are transitional and will be removed after the new Pages deployment is verified. No stable release is implied.
**Custom documentation engine:** Scarp Docs now builds from the Scarp-owned TypeScript generator, with bilingual HTML, local search, responsive layout and offline-browser tests. See [architecture and migration gates](SCARP-DOCS-ENGINE.md) and [Issue #70](https://github.com/scarp-lang/scarp-docs/issues/70). The published site uses no VitePress/Vue package. Historical source evidence and configuration text are temporarily retained until all release-policy validators are migrated to the owned engine. No stable release is implied.

Official TypeScript-generated documentation for the experimental [Scarp Programming Language](https://github.com/scarp-lang/scarp).

Expand Down
2 changes: 1 addition & 1 deletion SCARP-DOCS-ENGINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ The engine's test build is generated under artifacts/scarp-engine-preview/scarp-

The renderer escapes unreviewed raw Markdown HTML. It explicitly recognizes only the project's callouts and named widgets; future embedded content must be implemented and tested rather than bypassing HTML safety. The core language reference remains pinned to v0.0.5-alpha.1. The latest published compiler verified at migration start is v0.0.6-alpha.1, not the changing compiler main branch.

The Scarp-owned renderer is now the production-build candidate. The legacy VitePress/Vue dependencies, old theme/config and a few source-evidence checks remain temporarily for compatibility; they are no longer the website renderer or Pages build. Remove them after live Pages, offline archive, and release CI have independently confirmed the new output. Track completion in Issue #70.
The Scarp-owned renderer is now the production-build candidate. The VitePress and vue-tsc npm dependencies have been removed; old theme/config source fixtures and some evidence checks remain temporarily to protect compiler and bilingual regression coverage. None of these remaining files render or serve Pages. Remove them after live Pages, offline archive, and release CI have independently confirmed the new output. Track completion in Issue #70.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"package:offline": "tsx scripts/package-offline.ts",
"test:offline": "tsx scripts/test-offline.ts",
"test:browser-offline": "tsx scripts/test-scarp-offline-browser.ts",
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
"typecheck": "tsc --noEmit -p tsconfig.json",
"check:tooling": "tsx scripts/check-tooling.ts",
"check:toolchain": "tsx scripts/check-toolchain.ts",
"test:toolchain": "tsx scripts/test-toolchain.ts",
Expand Down Expand Up @@ -98,11 +98,9 @@
"test:docs-slug": "tsx scripts/test-docs-slug.ts"
},
"devDependencies": {
"vitepress": "1.6.4",
"@types/node": "26.6.6",
"typescript": "6.0.3",
"tsx": "4.23.15",
"vue-tsc": "3.3.13",
"playwright": "1.64.1",
"axe-core": "4.14.0",
"markdown-it": "14.1.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-toolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if (errors.length) {
for (const error of errors) console.error('FAIL toolchain: ' + error)
process.exitCode = 1
} else {
console.log('PASS: TypeScript 6, Vue SFC checker and Dependabot major-update guard')
console.log('PASS: framework-free Scarp renderer, TypeScript 6 and Dependabot major-update guard')
}
2 changes: 1 addition & 1 deletion scripts/check-tooling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'

// Guard the authored tooling against accidental regressions to JavaScript.
// Markdown, Vue SFC templates and CSS are intentionally retained for VitePress.
// Markdown and CSS are authored project content; old Vue SFC files are temporary legacy evidence, not a website runtime.
const scripts = resolve(fileURLToPath(new URL('.', import.meta.url)))
const files = readdirSync(scripts)
const nonTs = files.filter(name => /\.(?:c?js|mjs|jsx|mts|cts)$/.test(name))
Expand Down
44 changes: 28 additions & 16 deletions scripts/lib/toolchain-policy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Prevent accidental adoption of TypeScript 7 before Vue's embedded-language
* checker can use its native compiler API. This is a deliberate compatibility
* hold, not an assertion that TypeScript 7 is generally unusable.
* Guard the standalone TypeScript documentation build after VitePress removal.
* TS6 is pinned because the engine uses the programmatic transpileModule API;
* review TypeScript 7 API changes before lifting the major-upgrade hold.
*/
export interface ToolchainPackage {
devDependencies?: Record<string, unknown>
Expand All @@ -19,29 +19,41 @@ export function validateToolchain(pkg: ToolchainPackage, dependabotYaml: string)
const errors: string[] = []
const deps = pkg.devDependencies ?? {}
const ts = deps.typescript
const vue = deps['vue-tsc']
// Stay on the supported TypeScript 6 line until Vue tooling supports TS7.
if (typeof ts !== 'string' || !/^6\.0\.\d+$/.test(ts)) {
errors.push('TypeScript must remain pinned to the supported 6.0.x line')
errors.push('TypeScript must remain pinned to the supported 6.0.x transpilation line')
}
if (typeof vue !== 'string' || !/^3\.3\.\d+$/.test(vue)) {
errors.push('Vue SFC type checking must use the reviewed vue-tsc 3.3.x line')
for (const dependency of ['markdown-it','yaml']) {
const version=deps[dependency]
if (typeof version !== 'string' || !/^\d+\.\d+\.\d+$/.test(version)) {
errors.push(dependency + ' must be an explicitly pinned source-parsing dependency')
}
}
if (vue === '3.3.14') {
errors.push('vue-tsc 3.3.14 has an unresolved template URL codegen regression')
for (const removed of ['vitepress','vue-tsc']) {
if (removed in deps) errors.push('Removed framework/checker dependency must not return: ' + removed)
}
if (pkg.scripts?.typecheck !== 'vue-tsc --noEmit -p tsconfig.json') {
errors.push('Vue and TypeScript sources must retain the vue-tsc typecheck gate')

const scripts = pkg.scripts ?? {}
if (scripts.typecheck !== 'tsc --noEmit -p tsconfig.json') {
errors.push('TypeScript-only source must be checked using tsc')
}
if (scripts['docs:build'] !== 'tsx scripts/scarp-site/build.ts --production') {
errors.push('Production docs:build must use the Scarp-owned static site generator')
}
for (const script of ['docs:dev','docs:preview']) {
const value=scripts[script]
if (typeof value !== 'string' || !value.includes('scripts/scarp-site/serve-dev.ts')) {
errors.push(script + ' must use the Scarp-owned local preview server')
}
}

const npm = npmDependabotBlock(dependabotYaml)
if (!npm.includes('ignore:') ||
!/dependency-name:\s*["']?typescript["']?/.test(npm) ||
!npm.includes('version-update:semver-major')) {
errors.push('Dependabot npm updates must ignore TypeScript major versions')
errors.push('Dependabot must retain the TypeScript major-upgrade review gate')
}
if (!/dependency-name:\s*["']?vue-tsc["']?/.test(npm) ||
!npm.includes('versions: ["3.3.14"]')) {
errors.push('Dependabot npm updates must hold vue-tsc 3.3.14 specifically')
if (/dependency-name:\s*["']?(?:vitepress|vue-tsc)["']?/.test(npm)) {
errors.push('Dependabot must not retain obsolete VitePress or vue-tsc rules')
}
return errors
}
53 changes: 36 additions & 17 deletions scripts/test-toolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,42 @@ function mutatePackage(changes: Partial<ToolchainPackage>): ToolchainPackage {
scripts: { ...pkg.scripts, ...changes.scripts }
}
}

let negative=0
function mustFail(name:string,modified:ToolchainPackage,config=yaml,contains?:string):void{
const errors=validateToolchain(modified,config)
assert.ok(errors.length>0,name+' must fail source/toolchain policy')
if(contains)assert.ok(errors.some(error=>error.includes(contains)),
name+' must fail the expected policy')
negative++
}
for (const [name, changed] of [
['TypeScript 7', { typescript: '7.0.2' }],
['unsupported TypeScript prerelease', { typescript: '6.1.0-rc.1' }],
['old Vue checker', { 'vue-tsc': '2.2.12' }],
['regressed Vue checker', { 'vue-tsc': '3.3.14' }]
['unreviewed TypeScript 7', {typescript:'7.0.2'}],
['unsupported TypeScript prerelease', {typescript:'6.1.0-rc.1'}],
['reintroduced VitePress', {vitepress:'1.6.4'}],
['reintroduced vue-tsc', {'vue-tsc':'3.3.13'}],
['unreviewed Markdown parser', {'markdown-it':'latest'}],
['unreviewed YAML parser', {yaml:'latest'}]
] as const) {
assert.ok(validateToolchain(mutatePackage({ devDependencies: changed }), yaml).length,
name + ' must be rejected')
mustFail(name,mutatePackage({devDependencies:changed}))
}
assert.ok(validateToolchain(mutatePackage({
scripts: { typecheck: 'tsc --noEmit -p tsconfig.json' }
}), yaml).some(error => error.includes('vue-tsc')), 'cannot skip Vue SFC checking')
assert.ok(validateToolchain(pkg, yaml.replace('version-update:semver-major', 'version-update:semver-patch'))
.some(error => error.includes('Dependabot')), 'major-upgrade guard must stay enabled')
assert.ok(validateToolchain(pkg, yaml.replace('dependency-name: "typescript"', 'dependency-name: "vitepress"'))
.some(error => error.includes('Dependabot')), 'guard must target TypeScript')
assert.ok(validateToolchain(pkg, yaml.replace('versions: ["3.3.14"]', 'versions: ["3.3.15"]'))
.some(error => error.includes('vue-tsc 3.3.14 specifically')), 'known-regression hold must target the exact release')
console.log('PASS: supported TypeScript and Vue versions, SFC checks and Dependabot guard with eight negative tests')
mustFail('missing Markdown parser',mutatePackage({
devDependencies:{'markdown-it':undefined}
}),yaml,'markdown-it')
mustFail('Vue typechecker in main script',mutatePackage({
scripts:{typecheck:'vue-tsc --noEmit -p tsconfig.json'}
}),yaml,'tsc')
mustFail('VitePress production build',mutatePackage({
scripts:{'docs:build':'vitepress build docs'}
}),yaml,'Scarp-owned')
mustFail('VitePress local developer server',mutatePackage({
scripts:{'docs:dev':'vitepress dev docs'}
}),yaml,'Scarp-owned')
mustFail('incorrect Dependabot scope',pkg,
yaml.replace('dependency-name: "typescript"','dependency-name: "vitepress"'),'Dependabot')
mustFail('disabled major-upgrade review',pkg,
yaml.replace('version-update:semver-major','version-update:semver-patch'),'Dependabot')
mustFail('obsolete VitePress ignore rule',pkg,
yaml.replace('ignore:\n','ignore:\n - dependency-name: "vitepress"\n versions: ["1.6.4"]\n'),
'obsolete')
console.log('PASS: Scarp-owned TypeScript toolchain, source-parser locks, VitePress removal and '+
negative+' negative policy regressions')
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
},
"include": [
"scripts/**/*.ts",
"docs/.vitepress/**/*.ts",
"docs/.vitepress/**/*.mts",
"docs/.vitepress/**/*.vue"
"docs/.vitepress/site-meta.ts",
"docs/.vitepress/local-search.ts",
"docs/.vitepress/theme/lib/**/*.ts"
]
}
Loading