diff --git a/adev-ja/src/app/sub-navigation-data.en.ts b/adev-ja/src/app/routing/sub-navigation-data.en.ts similarity index 92% rename from adev-ja/src/app/sub-navigation-data.en.ts rename to adev-ja/src/app/routing/sub-navigation-data.en.ts index 0306e21208..a8c1634fbf 100644 --- a/adev-ja/src/app/sub-navigation-data.en.ts +++ b/adev-ja/src/app/routing/sub-navigation-data.en.ts @@ -10,15 +10,15 @@ import {isDevMode} from '@angular/core'; import {NavigationItem} from '@angular/docs'; // These 2 imports are expected to be red because they are generated a build time -import FIRST_APP_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/first-app/routes.json'; -import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/learn-angular/routes.json'; -import DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/deferrable-views/routes.json'; -import SIGNALS_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/signals/routes.json'; -import ERRORS_NAV_DATA from '../../src/assets/content/reference/errors/routes.json'; -import EXT_DIAGNOSTICS_NAV_DATA from '../../src/assets/content/reference/extended-diagnostics/routes.json'; +import FIRST_APP_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/first-app/routes.json'; +import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/learn-angular/routes.json'; +import DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/deferrable-views/routes.json'; +import SIGNALS_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/signals/routes.json'; +import ERRORS_NAV_DATA from '../../../src/assets/content/reference/errors/routes.json'; +import EXT_DIAGNOSTICS_NAV_DATA from '../../../src/assets/content/reference/extended-diagnostics/routes.json'; -import {getApiNavigationItems} from './features/references/helpers/manifest.helper'; -import {DEFAULT_PAGES} from './core/constants/pages'; +import {getApiNavigationItems} from '../features/references/helpers/manifest.helper'; +import {DEFAULT_PAGES} from '../core/constants/pages'; interface SubNavigationData { docs: NavigationItem[]; @@ -677,6 +677,66 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ path: 'guide/drag-drop', contentPath: 'guide/drag-drop', }, + // TODO: unwrap to release Angular Aria docs. + ...(isDevMode() + ? [ + { + label: 'Angular Aria', + children: [ + { + label: 'Overview', + path: 'guide/aria/overview', + contentPath: 'guide/aria/overview', + }, + { + label: 'Accordion', + path: 'guide/aria/accordion', + contentPath: 'guide/aria/accordion', + }, + { + label: 'Combobox', + path: 'guide/aria/combobox', + contentPath: 'guide/aria/combobox', + }, + { + label: 'Grid', + path: 'guide/aria/grid', + contentPath: 'guide/aria/grid', + }, + { + label: 'Listbox', + path: 'guide/aria/listbox', + contentPath: 'guide/aria/listbox', + }, + { + label: 'Menu', + path: 'guide/aria/menu', + contentPath: 'guide/aria/menu', + }, + { + label: 'Radio Group', + path: 'guide/aria/radio', + contentPath: 'guide/aria/radio', + }, + { + label: 'Tabs', + path: 'guide/aria/tabs', + contentPath: 'guide/aria/tabs', + }, + { + label: 'Toolbar', + path: 'guide/aria/toolbar', + contentPath: 'guide/aria/toolbar', + }, + { + label: 'Tree', + path: 'guide/aria/tree', + contentPath: 'guide/aria/tree', + }, + ], + }, + ] + : []), ], }, { @@ -985,6 +1045,11 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ path: 'ecosystem/service-workers/getting-started', contentPath: 'ecosystem/service-workers/getting-started', }, + { + label: 'Custom service worker scripts', + path: 'ecosystem/service-workers/custom-service-worker-scripts', + contentPath: 'ecosystem/service-workers/custom-service-worker-scripts', + }, { label: 'Configuration file', path: 'ecosystem/service-workers/config', @@ -1426,6 +1491,18 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [ path: 'reference/migrations/self-closing-tags', contentPath: 'reference/migrations/self-closing-tags', }, + { + label: 'NgClass to Class', + path: 'reference/migrations/ngclass-to-class', + contentPath: 'reference/migrations/ngclass-to-class', + status: 'new', + }, + { + label: 'NgStyle to Style', + path: 'reference/migrations/ngstyle-to-style', + contentPath: 'reference/migrations/ngstyle-to-style', + status: 'new', + }, ], }, ]; diff --git a/adev-ja/src/app/sub-navigation-data.ts b/adev-ja/src/app/routing/sub-navigation-data.ts similarity index 93% rename from adev-ja/src/app/sub-navigation-data.ts rename to adev-ja/src/app/routing/sub-navigation-data.ts index 7749d01a14..548ccde587 100644 --- a/adev-ja/src/app/sub-navigation-data.ts +++ b/adev-ja/src/app/routing/sub-navigation-data.ts @@ -10,15 +10,15 @@ import {isDevMode} from '@angular/core'; import {NavigationItem} from '@angular/docs'; // These 2 imports are expected to be red because they are generated a build time -import FIRST_APP_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/first-app/routes.json'; -import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/learn-angular/routes.json'; -import DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/deferrable-views/routes.json'; -import SIGNALS_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/signals/routes.json'; -import ERRORS_NAV_DATA from '../../src/assets/content/reference/errors/routes.json'; -import EXT_DIAGNOSTICS_NAV_DATA from '../../src/assets/content/reference/extended-diagnostics/routes.json'; +import FIRST_APP_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/first-app/routes.json'; +import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/learn-angular/routes.json'; +import DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/deferrable-views/routes.json'; +import SIGNALS_TUTORIAL_NAV_DATA from '../../../src/assets/tutorials/signals/routes.json'; +import ERRORS_NAV_DATA from '../../../src/assets/content/reference/errors/routes.json'; +import EXT_DIAGNOSTICS_NAV_DATA from '../../../src/assets/content/reference/extended-diagnostics/routes.json'; -import {getApiNavigationItems} from './features/references/helpers/manifest.helper'; -import {DEFAULT_PAGES} from './core/constants/pages'; +import {getApiNavigationItems} from '../features/references/helpers/manifest.helper'; +import {DEFAULT_PAGES} from '../core/constants/pages'; interface SubNavigationData { docs: NavigationItem[]; @@ -396,17 +396,17 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ contentPath: 'guide/routing/rendering-strategies', status: 'new', }, - { - label: 'ルーターリファレンス', - path: 'guide/routing/router-reference', - contentPath: 'guide/routing/router-reference', - }, { label: 'ルートの動作のカスタマイズ', path: 'guide/routing/customizing-route-behavior', contentPath: 'guide/routing/customizing-route-behavior', status: 'new', }, + { + label: 'ルーターリファレンス', + path: 'guide/routing/router-reference', + contentPath: 'guide/routing/router-reference', + }, { label: 'ルート遷移アニメーション', path: 'guide/routing/route-transition-animations', @@ -672,11 +672,71 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ }, ], }, - { + { label: 'Drag and drop', path: 'guide/drag-drop', contentPath: 'guide/drag-drop', }, + // TODO: unwrap to release Angular Aria docs. + ...(isDevMode() + ? [ + { + label: 'Angular Aria', + children: [ + { + label: 'Overview', + path: 'guide/aria/overview', + contentPath: 'guide/aria/overview', + }, + { + label: 'Accordion', + path: 'guide/aria/accordion', + contentPath: 'guide/aria/accordion', + }, + { + label: 'Combobox', + path: 'guide/aria/combobox', + contentPath: 'guide/aria/combobox', + }, + { + label: 'Grid', + path: 'guide/aria/grid', + contentPath: 'guide/aria/grid', + }, + { + label: 'Listbox', + path: 'guide/aria/listbox', + contentPath: 'guide/aria/listbox', + }, + { + label: 'Menu', + path: 'guide/aria/menu', + contentPath: 'guide/aria/menu', + }, + { + label: 'Radio Group', + path: 'guide/aria/radio', + contentPath: 'guide/aria/radio', + }, + { + label: 'Tabs', + path: 'guide/aria/tabs', + contentPath: 'guide/aria/tabs', + }, + { + label: 'Toolbar', + path: 'guide/aria/toolbar', + contentPath: 'guide/aria/toolbar', + }, + { + label: 'Tree', + path: 'guide/aria/tree', + contentPath: 'guide/aria/tree', + }, + ], + }, + ] + : []), ], }, { @@ -985,6 +1045,11 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [ path: 'ecosystem/service-workers/getting-started', contentPath: 'ecosystem/service-workers/getting-started', }, + { + label: '独自のService Workerスクリプト', + path: 'ecosystem/service-workers/custom-service-worker-scripts', + contentPath: 'ecosystem/service-workers/custom-service-worker-scripts', + }, { label: '設定ファイル', path: 'ecosystem/service-workers/config', @@ -1434,6 +1499,18 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [ path: 'reference/migrations/self-closing-tags', contentPath: 'reference/migrations/self-closing-tags', }, + { + label: 'NgClass to Class', + path: 'reference/migrations/ngclass-to-class', + contentPath: 'reference/migrations/ngclass-to-class', + status: 'new', + }, + { + label: 'NgStyle to Style', + path: 'reference/migrations/ngstyle-to-style', + contentPath: 'reference/migrations/ngstyle-to-style', + status: 'new', + }, ], }, ]; diff --git a/tools/update-origin.ts b/tools/update-origin.ts index bad01406f8..ad8caa2130 100644 --- a/tools/update-origin.ts +++ b/tools/update-origin.ts @@ -6,10 +6,9 @@ import { parseArgs } from 'node:util'; import { cpRf, exists } from './lib/fsutils'; import { adevJaDir, rootDir } from './lib/workspace'; -const localizedFilePatterns = [ +const localizedFilePatterns: Array = [ // Text contents - 'src/content/**/*.md', - '!src/content/**/license.md', + ['src/content/**/*.md', '!src/content/**/license.md'], // Tutorial config files 'src/content/tutorials/**/config.json', // Update home files @@ -19,10 +18,10 @@ const localizedFilePatterns = [ 'src/app/features/update/update.component.ts', 'src/app/features/update/update.component.html', // Application files - 'src/app/sub-navigation-data.ts', + 'src/app/routing/sub-navigation-data.ts', 'src/app/core/layout/navigation/navigation.component.html', 'shared-docs/components/table-of-contents/table-of-contents.component.html', - 'shared-docs/components/cookie-popup/cookie-popup.component.html' + 'shared-docs/components/cookie-popup/cookie-popup.component.html', ]; async function main() { @@ -50,20 +49,26 @@ async function resetOrigin(hash: string) { async function copyOriginFiles() { const adevDir = resolve(rootDir, 'origin/adev'); - const adevFiles = await glob(localizedFilePatterns, { - cwd: adevDir, - caseSensitiveMatch: true, - }); // adev-ja 内に同名ファイルの .en.xxx がある場合はそちらを上書きする // .en.xxx がない場合はそのままコピーする - for (const file of adevFiles) { - const src = resolve(adevDir, file); - const ext = extname(file); - const enFilePath = file.replace(`${ext}`, `.en${ext}`); - const isTranslated = await exists(resolve(adevJaDir, enFilePath)); - const dest = resolve(adevJaDir, isTranslated ? enFilePath : file); - await cpRf(src, dest); + for (const pattern of localizedFilePatterns) { + const files = await glob(pattern, { + cwd: adevDir, + caseSensitiveMatch: true, + }); + // 否定パターンではなくパターンに合致するファイルがまったくない場合はエラーとする。 + if (files.length === 0) { + throw new Error(`No files matched: ${JSON.stringify(pattern)}`); + } + for (const file of files) { + const src = resolve(adevDir, file); + const ext = extname(file); + const enFilePath = file.replace(`${ext}`, `.en${ext}`); + const isTranslated = await exists(resolve(adevJaDir, enFilePath)); + const dest = resolve(adevJaDir, isTranslated ? enFilePath : file); + await cpRf(src, dest); + } } }