Skip to content

Commit 6ed14b0

Browse files
docs: ✏️ add docs\Reference\config_es.md (#1082)
Co-authored-by: Jorge Cano <[email protected]>
1 parent 30686a9 commit 6ed14b0

File tree

3 files changed

+210
-4
lines changed

3 files changed

+210
-4
lines changed

docs/Reference/command-line-options_es.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ npx scully --logSeverity=none
156156

157157
Opciones disponibles:
158158

159-
| option | result |
159+
| opción | resultado |
160160
| --------- | ------------------------------------------- |
161161
| `normal` | tood |
162162
| `warning` | Sólo advertencias y errores |

docs/Reference/config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This option can be modified according to your needs.
110110
#### logFileSeverity
111111

112112
Determines what of the Scully output will be written into the `scully.log` file in the root of the project.
113-
Due to the fact that this option is _in_ the config, the default `warning` setting will be used until the config is fully processed. If there are errors and/or warnings raised during the processing fo the config, those _will_ be logged. You can override this behavior by using the `--logSeverity` command line parameter.
113+
Due to the fact that this option is _in_ the config, the default `warning` setting will be used until the config is fully processed. If there are errors and/or warnings raised during the processing of the config, those _will_ be logged. You can override this behavior by using the `--logSeverity` command line parameter.
114114

115115
| option | result |
116116
| --------- | --------------------------------------- |
@@ -183,7 +183,7 @@ Connects your application to a different host. This is useful when using your ow
183183

184184
#### guessParserOptions
185185

186-
The`guessParserOptions` that get passed to the `guess-parser` library.
186+
The `guessParserOptions` that get passed to the `guess-parser` library.
187187

188188
Currently, the only supported property is `excludedFiles`, and it excludes files from the `guess-parser` route discovery process.
189189

@@ -200,7 +200,7 @@ When the server gets a request for a route (file) that does not exist on the fil
200200

201201
| option | result |
202202
| -------------- | ------------------------------------------------------------ |
203-
| `""` (default) | Will render a 404 page, and raise a waring during rendering. |
203+
| `""` (default) | Will render a 404 page, and raise a warning during rendering. |
204204
| `index` | Will render the `index.html` from the dist root folder. |
205205
| `baseOnly` | Will use express route matcher on unhandled routes only. |
206206
| `404` | Will render the `404.html` from the dist root folder. |

docs/Reference/config_es.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
lang: es
3+
position: 100
4+
published: true
5+
title: Configuración de Scully
6+
---
7+
8+
# Configuración de Scully
9+
10+
<div class="docs-link_table">
11+
<a class="view-in-repo" href="https://github.com/scullyio/scully/blob/main/libs/scully/src/lib/utils/interfacesandenums.ts"></a>
12+
</div>
13+
14+
## Visión General
15+
16+
La parte central de un proyecto Scully es el archivo `scully.<projectname>.config.ts`. Este archivo exporta la configuración de Scully para la aplicación.
17+
18+
Si eres nuevo con Scully, recomendamos leer la documentacion [primeros pasos](docs/learn/getting-started/requirements).
19+
20+
El estructura del archivo `scully.<projectname>.config.ts` es:
21+
22+
## Interfaz
23+
24+
```typescript
25+
export interface ScullyConfig {
26+
/** is this a bare project (without angular.json?) */
27+
bareProject?: boolean;
28+
/** the name of the project we are using. Provided by Scully itself */
29+
projectName?: string;
30+
/** the folder where project is. Can be any off the projects in a repo, read from angular.json */
31+
projectRoot?: string;
32+
/** the folder where the project sources resides, read from angular.json */
33+
sourceRoot?: string;
34+
/** Array with string ID's of the content-renderers that will be run on all routes */
35+
defaultPostRenderers?: (string | symbol)[];
36+
/** the root of the project (where angular.json lives) */
37+
homeFolder?: string;
38+
/** the destination of the Scully generated files */
39+
outDir?: string;
40+
/** the folder used by the scully server to serve the generated files. defaults to outDir */
41+
outHostFolder?: string;
42+
/** the place where distribution files of the project are. Should be a subfolder of dist. */
43+
distFolder?: string;
44+
/** the folder used to serve the angular distribution files, defaults to distFolder */
45+
hostFolder?: string;
46+
/** transferState only inlined into page, and not written into separate data.json */
47+
inlineStateOnly?: boolean;
48+
/** Set what is what is written to the logfile, defaults to warnings and errors */
49+
logFileSeverity?: LogSeverity;
50+
/** routes that need additional processing have their configuration in here */
51+
routes: RouteConfig;
52+
/** routes that are in the application but have no route in the router */
53+
extraRoutes?: string | string[] | Promise<string[] | string>;
54+
/** Port-number where the original application is served */
55+
appPort?: number;
56+
/** Boolean that determines saving of site-tumbnails files */
57+
thumbnails?: boolean;
58+
/** port-number where the Scully generated files are available */
59+
staticPort?: number;
60+
/** port for the live reload service */
61+
reloadPort?: number;
62+
/** optional proxy config file, uses the same config file as the CLI */
63+
proxyConfig?: string;
64+
/** optional launch-options for puppeteer */
65+
puppeteerLaunchOptions?: LaunchOptions;
66+
/** hostname to use for local server, defaults to `localhost` */
67+
hostName?: string;
68+
/** optional hostURL, if this is provided, we are going to use this server instead of the build-in one. */
69+
hostUrl?: string;
70+
/** optional guessParserOptions, if this is provided we are going to pass those options to the guess parser. */
71+
guessParserOptions?: GuessParserOptions;
72+
/** the maximum of concurrent puppeteer tabs open. defaults to the available amounts of cores */
73+
maxRenderThreads?: number;
74+
/** the resource types to ignore when generating pages via Puppeteer */
75+
ignoreResourceTypes?: ResourceType[];
76+
/** how to handle 404 in Scully server */
77+
handle404?: string;
78+
}
79+
```
80+
81+
## Properties
82+
83+
La interfaz `ScullyConfig` provee los parametros para configurar como Scully trabaja en un proyecto.
84+
85+
#### projectRoot
86+
87+
El nombre del proyecto que Scully generará el contenido estático.
88+
89+
#### homeFolder
90+
91+
Una referencia a la carpeta raíz del proyecto Angular.
92+
Esta propiedad es para uso interno, y por defecto para la ubicación para el archivo angular.json.
93+
94+
#### outDir
95+
96+
La ubicación de la carpeta donde Scully dejará los archivos estáticos.
97+
No debe ser igual al utilizado en `distFolder`.
98+
Por defecto es:
99+
100+
```URL
101+
./dist/static
102+
```
103+
104+
#### distFolder
105+
106+
Ubicación a la carpeta dist de la aplicación Angular.
107+
Scully toma la ubicación del archivo `angular.json` y la usará esta carpeta para el renderizado.
108+
Esta opción puede ser modificada a tus necesidades.
109+
110+
#### logFileSeverity
111+
112+
Determina cuáles de las salidas de Scully será escritas dentro del archivo `scully.log` en la raíz del proyecto.
113+
Debido a que esta opción se encuentra _dentro_ de la configuración, por defecto se usará el valor `warning` hasta que la configuración se haya procesado por completo. Si existen errores o advertencias durante el procesamiento de la de configuración, _serán_ guardadas en el archivo. Puedes sobreescribir esta características usando el parámetro `--logSeverity` desde la línea de comandos.
114+
115+
| opción | resultado |
116+
| --------- | ------------------------------------------- |
117+
| `normal` | tood |
118+
| `warning` | Sólo advertencias y errores |
119+
| `error` | Sólo errors |
120+
| `none` | Nada pero se creará un archivo `scully.log` |
121+
122+
#### routes
123+
124+
Scully tiene dos tipos de rutas, [rutas no manejadas](/docs/concepts/unhandled-routes) y [rutas manejadas](/docs/concepts/handled-routes):
125+
126+
Todas las rutas no manejadas con información dinámica necesitan ser manejadas por un complemento de rutas. Cuando hay una ruta con datos dinámicos que no tiene configuración, será informada en la pantalla y se no se procesará.
127+
128+
> **Esto significa que NO HAY ARCHIVOS ESTATICOS para rutas con DATOS DINÁMICOS**
129+
130+
Para mas información sobre complementos router, vista la documentación de [complementos](/docs/Reference/plugins/overview).
131+
132+
#### extraRoutes
133+
134+
Permite a los desarrolladores agregar un arreglo de rutas no manejadas. Esas rutas pueden existir en AngularJS, React o cualquier otro framework.
135+
136+
```typescript
137+
extraRoutes: [
138+
'/foo/:id',
139+
new Promise('/bar/:barId'),
140+
new Promise(['/foo/:fooId', '/bar/:id']),
141+
];
142+
```
143+
144+
#### appPort
145+
146+
Scully provee un servidor para renderizar la aplicación Angular. Esto significa que toma tu aplicación de la carpeta dist y la aloja en `http://localhost:1864`.(al menos que no hayas modificado la configuración por defecto). Es en esta ubicación donde el proceso de renderizado observa cuando debe renderizar.
147+
148+
Configura el puerto donde la aplicación Angular se ejecuta.
149+
150+
Por defecto es el puerto: `1864`.
151+
152+
#### staticPort
153+
154+
Similar a [appPort](#appport-number), `staticport` provee un servidor para renderizar los archivos estáticos compilados por Scully. Esto significa que, (al menos que no hayas modificado la configuración por defecto) puedes examinar el resultado de Scully en `http://localhost:1668`.
155+
156+
El puerto por defecto es: `1668`
157+
158+
#### proxyConfig
159+
160+
Toma el nombre del archivo relativo para el archivo de configuración de proxy.
161+
162+
Para mas detalles visita [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
163+
Scully usa el mismo formato de configuración que [webpackDevServer](https://webpack.js.org/configuration/dev-server/#devserverproxy)
164+
Esta es una propiedad opcional, y es sólo utilizada por [Angular CLI](https://angular.io/guide/build#proxying-to-a-backend-server)
165+
166+
También puede ser provisto con el parámetro en la consola de comandos `--proxy filename`.
167+
168+
#### puppeteerLaunchOptions
169+
170+
Si la aplicación se encuentra en un entorno restringido, las opciones por defecto de puppeteer pueden no funcionar. En este paso, esta opción puede ser sobreescrita con la configuración especifica para ese entorno.
171+
172+
**Una palabra de advertencia,** algunas configuraciones pueden interferir con la manera en que Scullly funciona, creando resultados incorrectos.
173+
Lea mas sobre [puppeteerlaunchoptions](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-puppeteerlaunchoptions) para más información.
174+
175+
#### hostName
176+
177+
Permite configurar un nombre diferente para `localhost`.
178+
179+
#### hostUrl
180+
181+
Conecta tu aplicación a un host diferente. Esto es útil cuando usas tu propio servidor.
182+
183+
#### guessParserOptions
184+
185+
El `guessParserOptions`que se pasa a la librería `guess-parser`.
186+
187+
Actualmento sólo soporta la propiedad `excludedFiles`, y es excluida del proceso de descubrimiento de rutas del `guess-parser`.
188+
189+
#### ignoreResourceTypes
190+
191+
El arreglo `ignoreResourceTypes` es pasado a `puppeteerRenderPlugin`.
192+
Cualqueir `ResourceType` que es observado y se encuentra en este arreglo, es ignorado por la instancia de Puppeteer que renderiza la página solicitada.
193+
Por ejemplo, si agregas un `image` y `font`, todas las peticiones de imágenes y fuentes cargadas en tus páginas serán ignoradas.
194+
195+
#### handle404
196+
197+
Cómo maneja el servidor de Scully las rutas que **no** estan provistas en tu aplicación.
198+
cuando el servidor recibe una petición de una ruta (file) que no existen en el sistema de archivos, esta opción define como manejar esta ruta.
199+
200+
| opción | resultado |
201+
| -------------- | ----------------------------------------------------------------------------- |
202+
| `""` (defecto) | Renderizará una página 404 y diparará una advertencia durante el renderizado. |
203+
| `index` | Renderizará `index.html` de la carpeta raíz dist. |
204+
| `baseOnly` | Usará express para comparar las rutas no manejadas. |
205+
| `404` | Renderizará `404.html` de la carpeta raíz dist. |
206+
| `none` | Dejará que express maneja la petición |

0 commit comments

Comments
 (0)