From 19d5e89cea4bf78258e3c6cb36ccdabb4f9a8a95 Mon Sep 17 00:00:00 2001 From: Suguru Inatomi Date: Fri, 21 Nov 2025 17:01:05 +0900 Subject: [PATCH] chore(tools): exclude tutorials/README.md from sync - Add tutorials/README.md to exclusion patterns - Remove file from adev-ja directory - This file is not intended for translation --- adev-ja/src/content/tutorials/README.md | 108 ------------------------ tools/update-origin.ts | 1 + 2 files changed, 1 insertion(+), 108 deletions(-) delete mode 100644 adev-ja/src/content/tutorials/README.md diff --git a/adev-ja/src/content/tutorials/README.md b/adev-ja/src/content/tutorials/README.md deleted file mode 100644 index af5d77a0bf..0000000000 --- a/adev-ja/src/content/tutorials/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Angular embedded docs tutorial - -- [Tutorial files](#tutorial-files) -- [Tutorials directory structure](#tutorials-directory-structure) -- [Reserved tutorials directories](#reserved-tutorials-directories) - -## Tutorial files - -The tutorials content consists of the tutorial content, source code and configuration. - -### Content: `README.md` - -The tutorial content must be located in a `README.md` file in the tutorial directory. - -Taking the `learn-angular` tutorial as an example, see: [`src/content/tutorials/learn-angular/intro/README.md`](/src/content/tutorials/learn-angular/intro/README.md) - -### Configuration: `config.json` - -Each tutorial is defined by a `config.json`, which can have the following options: - -- `title`: defines the tutorial title used in the tutorial nav -- `nextTutorial`: the path of the next tutorial (only in `intro/` step) -- `src`: the relative path to an external directory, which defines the tutorial source code used in the embedded editor -- `answerSrc`: the relative path to an external directory, which defines the tutorial answer used in the embedded editor -- `openFiles`: an array of files to be open in the editor -- `type`: the type denotes how the tutorial will be presented and which components are necessary for that tutorial - - `cli`: a tutorial with a `cli` type will contain only the content and an interactive terminal with the Angular CLI - - `editor`: used for the complete embedded editor, containing the code editor, the preview, an interactive terminal and the console with outputs from the dev server - - `local`: disables the embedded editor and shows only the content - - `editor-only`: a special config used for the tutorial playground and the homepage playground, which disables the content and shows only the embedded editor - -### Source code - -The tutorial source code includes every file in the tutorial directory, except `README.md` and `config.json`. - -The tutorial source code has precedence over the [`common`](#common) project file, so if a file exists in both [`common`](#common) and in the tutorial directory, containing the same relative path, the tutorial file will override the [`common`](#common) file. - -## Tutorials directory structure - -A tutorial is composed of an introduction and steps. Both the intro and each step contains its own content, config and source code. - -Taking the `learn-angular` tutorial as an example: - -### Introduction - -[`src/content/tutorials/learn-angular/intro`](/src/content/tutorials/learn-angular/intro) - -is the introduction of the tutorial, which will live in the `/tutorials/learn-angular` route. - -### Steps - -[`src/content/tutorials/learn-angular/steps`](/src/content/tutorials/learn-angular/steps) is the directory that contains the tutorial steps. - -These are some examples from the `learn-angular` tutorial: - -- [`learn-angular/steps/1-components-in-angular`](/src/content/tutorials/learn-angular/steps/1-components-in-angular): The route will be `/tutorials/learn-angular/components-in-angular` -- [`learn-angular/steps/2-updating-the-component-class`](/src/content/tutorials/learn-angular/steps/2-updating-the-component-class): The route will be `/tutorials/learn-angular/updating-the-component-class` - -Each step directory must start with a number followed by a hyphen, then followed by the step pathname. - -- The number denotes the step, defining which will be the previous and next step within a tutorial. -- The hyphen is a delimiter :). -- The pathname taken from the directory name defines the step URL. - -## Reserved tutorials directories - -### `common` - -The common project is a complete Angular project that is reused by all tutorials. It contains all -dependencies(`package.json`, `package-lock.json`), project configuration(`tsconfig.json`, `angular.json`) and main files to bootstrap the application(`index.html`, `main.ts`, `app.module.ts`). - -A common project is used for a variety of reasons: - -- Avoid duplication of files in tutorials. -- Optimize in-app performance by requesting the common project files and dependencies only once, benefiting from the - browser cache on subsequent requests. -- Require a single `npm install` for all tutorials, therefore reducing the time to interactive with the tutorial - when navigating different tutorials and steps. -- Provide a consistent environment for all tutorials. -- Allow each tutorial to focus on the specific source code for what's being taught and not on the project setup. - -See [`src/content/tutorials/common`](/src/content/tutorials/common) - -### `playground` - -The playground contains the source code for the tutorials playground at `/playground`. It should not contain any content. - -See [`src/content/tutorials/playground`](/src/content/tutorials/playground) - -### `homepage` - -The homepage contains the source code for the homepage playground. It should not contain any content. - -See [`src/content/tutorials/homepage`](/src/content/tutorials/homepage) - -## Update dependencies - -To update the dependencies of all tutorials you can run the following script - -```bash -rm ./adev/src/content/tutorials/homepage/package-lock.json ./adev/src/content/tutorials/first-app/common/package-lock.json ./adev/src/content/tutorials/learn-angular/common/package-lock.json ./adev/src/content/tutorials/playground/common/package-lock.json ./adev/src/content/tutorials/deferrable-views/common/package-lock.json - -npm i --package-lock-only --prefix ./adev/src/content/tutorials/homepage -npm i --package-lock-only --prefix ./adev/src/content/tutorials/first-app/common -npm i --package-lock-only --prefix ./adev/src/content/tutorials/learn-angular/common -npm i --package-lock-only --prefix ./adev/src/content/tutorials/playground/common -npm i --package-lock-only --prefix ./adev/src/content/tutorials/deferrable-views/common -``` diff --git a/tools/update-origin.ts b/tools/update-origin.ts index 007cd3cfc2..0d31905bdd 100644 --- a/tools/update-origin.ts +++ b/tools/update-origin.ts @@ -13,6 +13,7 @@ const localizedFilePatterns: Array = [ '!src/content/**/license.md', '!src/content/kitchen-sink.md', '!src/content/examples/**/readme.md', + '!src/content/tutorials/README.md', ], // Tutorial config files 'src/content/tutorials/**/config.json',