[]) - Optional - Additional providers to include in the test environment (default: []).
- **teardown.destroyAfterEach** (boolean) - Optional - Whether to destroy the test environment after each test (default: true).
```
--------------------------------
### Install vite-tsconfig-paths with pnpm
Source: https://github.com/analogjs/analog/blob/beta/packages/vitest-angular/README.md
Install the `vite-tsconfig-paths` package as a development dependency using pnpm.
```shell
pnpm install -w vite-tsconfig-paths --dev
```
--------------------------------
### Install vite-tsconfig-paths with npm
Source: https://github.com/analogjs/analog/blob/beta/packages/vitest-angular/README.md
Install the `vite-tsconfig-paths` package as a development dependency using npm.
```shell
npm install vite-tsconfig-paths --save-dev
```
--------------------------------
### Initialize Storybook
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/storybook/index.md
Run this command to initialize Storybook for your project if it's not already set up.
```shell
npx storybook@latest init
```
--------------------------------
### Install Vitest Angular package
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/testing/vitest.md
Install the required development dependency for Vitest integration.
```shell
npm install @analogjs/vitest-angular --save-dev
```
```shell
yarn add @analogjs/vitest-angular --dev
```
```shell
pnpm install -w @analogjs/vitest-angular --save-dev
```
--------------------------------
### Build the Analog application
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/nx/index.md
Compiles the application for production deployment.
```shell
npx nx build analog-app
```
--------------------------------
### Build the Docs Site with Nx
Source: https://github.com/analogjs/analog/blob/beta/AGENTS.md
Build the documentation site using Nx. The 'astro-app' is excluded from the main build.
```bash
pnpm nx build docs-app
```
--------------------------------
### Build and Deploy to Firebase Hosting
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
Build your Analog.js application using the Firebase preset and then deploy it to Firebase Hosting using the Firebase CLI.
```bash
BUILD_PRESET=firebase npm run build
firebase deploy
```
--------------------------------
### Install Capacitor dependencies
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Install core and CLI packages for Capacitor using your preferred package manager.
```shell
npm install @capacitor/core
npm install -D @capacitor/cli
```
```shell
yarn add @capacitor/core
yarn add -D @capacitor/cli
```
```shell
pnpm install @capacitor/core
pnpm install -D @capacitor/cli
```
--------------------------------
### Markdown Content Route Example
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/routing/content.md
Example of a markdown file (`src/app/pages/about.md`) defining an `/about` route with frontmatter.
```markdown
---
title: About
meta:
- name: description
content: About Page Description
- property: og:title
content: About
---
## About Analog
Analog is a meta-framework for Angular.
[Back Home](./)
```
--------------------------------
### Install Firebase Dependencies
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
Install the necessary Firebase Admin SDK and Cloud Functions packages as development dependencies.
```bash
npm install -D firebase-admin firebase-functions firebase-functions-test
```
--------------------------------
### Deploy Analog.js App with Netlify CLI
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
After initialization, use this command to deploy your Analog.js application to Netlify.
```bash
npx netlify deploy
```
--------------------------------
### Configure setupTestBed options
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/testing/vitest.md
Use this configuration to customize the test environment, such as disabling automatic teardown for component inspection.
```ts
setupTestBed({
zoneless: true,
providers: [],
teardown: { destroyAfterEach: false },
});
```
--------------------------------
### Install browser testing dependencies
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/testing/vitest.md
Install Playwright and the Vitest browser provider for running tests in a browser environment.
```shell
npm install @vitest/browser-playwright playwright --save-dev
```
```shell
yarn add @vitest/browser-playwright playwright --dev
```
```shell
pnpm install -w @vitest/browser-playwright playwright
```
--------------------------------
### Install Ionic Framework (pnpm)
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Install the latest version of the Ionic Framework Angular package using pnpm.
```shell
pnpm install @ionic/angular@latest
```
--------------------------------
### Install Ionic Framework (yarn)
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Install the latest version of the Ionic Framework Angular package using yarn.
```shell
yarn add @ionic/angular@latest
```
--------------------------------
### Install Ionic Framework (npm)
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Install the latest version of the Ionic Framework Angular package using npm.
```shell
npm install @ionic/angular@latest
```
--------------------------------
### Create New Analog Project with Bun
Source: https://github.com/analogjs/analog/blob/beta/README.md
Use this command to scaffold a new Analog.js project using Bun. Follow the prompts to configure your project.
```bash
bun create analog@latest
```
--------------------------------
### Build Project for Production
Source: https://github.com/analogjs/analog/blob/beta/packages/create-analog/template-blog/README.md
This command builds the client and server components of the project. Client build artifacts are in `dist/analog/public`, and server build artifacts are in `dist/analog/server`.
```bash
npm run build
```
--------------------------------
### Install Firebase CLI Globally
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
Install the Firebase CLI globally to manage your Firebase projects and deployments from your local machine.
```bash
npm install -g firebase-tools
```
--------------------------------
### Install Browser Testing Packages
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/testing/vitest.md
Install necessary packages for running Vitest tests in a browser environment using Playwright.
```APIDOC
## Install Browser Testing Packages
### Description
Install `@vitest/browser-playwright` and `playwright` to enable experimental browser testing support.
### Installation
#### npm
```shell
npm install @vitest/browser-playwright playwright --save-dev
```
#### Yarn
```shell
yarn add @vitest/browser-playwright playwright --dev
```
#### pnpm
```shell
pnpm install -w @vitest/browser-playwright playwright
```
```
--------------------------------
### Initialize Edgio with Analog Connector
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
Initialize Edgio in your project, specifying the Analog.js connector for seamless integration.
```bash
edgio init --connector=@edgio/analogjs
```
--------------------------------
### Install Angular Material dependencies
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/angular-material/index.md
Install the required Angular CDK and Material packages using your preferred package manager.
```shell
npm install @angular/cdk @angular/material
```
```shell
yarn add @angular/cdk @angular/material
```
```shell
pnpm install @angular/cdk @angular/material
```
--------------------------------
### Build the library
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/guides/libraries.md
Execute the build command for the library project.
```sh
ng build my-lib
```
--------------------------------
### Create New Analog Project with npm
Source: https://github.com/analogjs/analog/blob/beta/README.md
Use this command to scaffold a new Analog.js project using npm. Follow the prompts to configure your project.
```bash
npm create analog@latest
```
--------------------------------
### Install Storybook Package
Source: https://github.com/analogjs/analog/blob/beta/packages/storybook-angular/README.md
Install the Storybook Plugin for Angular and Vite using npm. This command adds the necessary package as a development dependency.
```bash
npm install @analogjs/storybook-angular --save-dev
```
--------------------------------
### Markdown Content File Example
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/routing/content.md
Example of a markdown content file with frontmatter attributes, including title, slug, description, and cover image.
```markdown
---
title: My First Post
slug: 2022-12-27-my-first-post
description: My First Post Description
coverImage: https://images.unsplash.com/photo-1493612276216-ee3925520721?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=464&q=80
---
Hello World
```
--------------------------------
### Sync Project Files
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Synchronize your web assets and configuration with the native platform projects.
```shell
npx cap sync
```
--------------------------------
### Install Zerops CLI
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/deployment/providers.md
Installs the Zerops CLI globally using npm. This command-line tool is used for managing deployments and interacting with Zerops services.
```bash
# To download the zcli binary directly,
# use https://github.com/zeropsio/zcli/releases
npm i -g @zerops/zcli
```
--------------------------------
### Scaffold project with specific template
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/packages/create-analog/overview.md
Use flags to specify the project name and template preset during initialization.
```shell
# npm >=7.0
npm create analog@latest my-angular-app -- --template latest
# npm 6.x
npm create analog@latest my-angular-app -- --template blog
```
```shell
yarn create analog my-angular-app --template blog
```
```shell
pnpm create analog my-angular-app --template blog
```
--------------------------------
### Add Native Platforms
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ionic/index.md
Initialize the Android and iOS project directories within your application.
```shell
npx cap add android
npx cap add ios
```
--------------------------------
### Handle GET Request for Specific Resource
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/api/overview.md
Define an API route that specifically handles GET requests by appending `.get` to the filename. Access route parameters using `getRouterParam`.
```typescript
// /server/routes/api/v1/users/[id].get.ts
import { defineEventHandler, getRouterParam } from 'h3';
export default defineEventHandler(async (event) => {
const id = getRouterParam(event, 'id');
// TODO: fetch user by id
return `User profile of ${id}!`;
});
```
--------------------------------
### Build framework projects
Source: https://github.com/analogjs/analog/blob/beta/CONTRIBUTING.md
Builds all projects locally using Nx from the root folder.
```shell
pnpm build
```
--------------------------------
### Define Search Form with GET Action
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/guides/forms.md
This component defines a search form that uses the GET method. Form inputs will be appended to the current URL as query parameters. Ensure the `FormAction` is imported.
```typescript
// src/app/pages/search.page.ts
import { Component, computed } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { injectLoad, FormAction } from '@analogjs/router';
import type { load } from './search.server';
@Component({
selector: 'app-search-page',
standalone: true,
imports: [FormAction],
template: `
Search
@if (searchTerm()) {
Search Term: {{ searchTerm() }}
}
`,
})
export default class NewsletterComponent {
loader = toSignal(injectLoad(), { requireSync: true });
searchTerm = computed(() => this.loader().searchTerm);
}
```
--------------------------------
### Update test-setup.ts for browser preview
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/testing/vitest.md
Configure the test bed to keep components rendered after tests finish for visual inspection.
```ts
import '@angular/compiler';
import '@analogjs/vitest-angular/setup-snapshots';
import '@analogjs/vitest-angular/setup-serializers';
import { setupTestBed } from '@analogjs/vitest-angular/setup-testbed';
setupTestBed({
teardown: { destroyAfterEach: false }, // Enables visual test preview
});
```
--------------------------------
### Install @angular/localize
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/features/i18n/overview.md
Add the @angular/localize package to your project to enable internationalization features.
```bash
npm install @angular/localize
```
--------------------------------
### Configure AI Assistant with Docs Index
Source: https://github.com/analogjs/analog/blob/beta/apps/docs-app/docs/integrations/ai/index.md
Use the compact index file to provide an AI tool with a lightweight entry point for documentation retrieval.
```text
Use https://analogjs.org/llms.txt as the primary AnalogJS documentation index.
```
--------------------------------
### Pull request title examples
Source: https://github.com/analogjs/analog/blob/beta/CONTRIBUTING.md
Standardized formats for pull request titles.
```text
feat(content): update prismjs to latest version
```
```text
fix(content): fix error when rendering markdown
```