Skip to content

Commit

Permalink
Merge branch 'main' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Jan 7, 2025
2 parents ee0112e + 386ddeb commit 9a9b0eb
Show file tree
Hide file tree
Showing 19 changed files with 594 additions and 264 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,15 @@
"contributions": [
"infra"
]
},
{
"login": "mattlewis92",
"name": "Matt Lewis",
"avatar_url": "https://avatars.githubusercontent.com/u/6425649?v=4",
"profile": "https://mattlewis.me/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ tmpanalogapp*

.nx/cache
.nx/workspace-data
vite.config.*.timestamp*
vite.config.*.timestamp*
.vite-inspect
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-127-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-128-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<!-- prettier-ignore-end -->

Expand Down Expand Up @@ -276,6 +276,7 @@ Thanks goes to these wonderful people for contributing to Analog ([emoji key](ht
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexrosepizant"><img src="https://avatars.githubusercontent.com/u/7753376?v=4?s=100" width="100px;" alt="Alex Rose-Pizant"/><br /><sub><b>Alex Rose-Pizant</b></sub></a><br /><a href="#infra-alexrosepizant" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mattlewis.me/"><img src="https://avatars.githubusercontent.com/u/6425649?v=4?s=100" width="100px;" alt="Matt Lewis"/><br /><sub><b>Matt Lewis</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=mattlewis92" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
10 changes: 8 additions & 2 deletions apps/analog-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import analog from '@analogjs/platform';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig, Plugin, splitVendorChunkPlugin } from 'vite';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import inspect from 'vite-plugin-inspect';

// Only run in Netlify CI
let base = process.env['URL'] || 'http://localhost:3000';
Expand All @@ -14,7 +15,7 @@ if (process.env['NETLIFY'] === 'true') {
}

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
export default defineConfig(({ mode, isSsrBuild }) => {
return {
root: __dirname,
publicDir: 'src/public',
Expand Down Expand Up @@ -47,7 +48,12 @@ export default defineConfig(({ mode }) => {
}),
nxViteTsPaths(),
visualizer() as Plugin,
splitVendorChunkPlugin(),
// splitVendorChunkPlugin(),
!isSsrBuild &&
inspect({
build: true,
outputDir: '../../.vite-inspect/analog-app',
}),
],
test: {
reporters: ['default'],
Expand Down
1 change: 1 addition & 0 deletions apps/docs-app/docs/contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Andres is a software engineer for HeroDevs, Angular and Firebase GDE.
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexrosepizant"><img src="https://avatars.githubusercontent.com/u/7753376?v=4?s=100" width="100px;" alt="Alex Rose-Pizant"/><br /><sub><b>Alex Rose-Pizant</b></sub></a><br /><a href="#infra-alexrosepizant" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mattlewis.me/"><img src="https://avatars.githubusercontent.com/u/6425649?v=4?s=100" width="100px;" alt="Matt Lewis"/><br /><sub><b>Matt Lewis</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=mattlewis92" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
272 changes: 141 additions & 131 deletions apps/docs-app/docs/features/deployment/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,137 @@ import TabItem from '@theme/TabItem';

Analog supports deployment to many providers with little or no additional configuration using [Nitro](https://nitro.unjs.io) as its underlying server engine. You can find more providers in the [Nitro deployment docs](https://nitro.unjs.io/deploy).

## Zerops

:::info
[Zerops](https://zerops.io) is the **official** deployment partner for AnalogJS.
:::

Analog supports deploying both static and server-side rendered apps to [Zerops](https://zerops.io) with a simple configuration file.

> One Zerops project can contain multiple Analog projects. See example repositories for [static](https://github.com/zeropsio/recipe-analog-static) and [server-side rendered](https://github.com/zeropsio/recipe-analog-nodejs) Analog apps for a quick start.
### Static (SSG) Analog app

If your project is not SSG Ready, set up your project for [Static Site Generation](/docs/features/server/static-site-generation).

#### 1. Create a project in Zerops

Projects and services can be added either through a [Project add](https://app.zerops.io/dashboard/project-add) wizard or imported using a YAML structure:

```yml
project:
name: recipe-analog
services:
- hostname: app
type: static
```
This creates a project called `recipe-analog` with a Zerops Static service called `app`.

#### 2. Add zerops.yml configuration

To tell Zerops how to build and run your site, add a `zerops.yml` to your repository:

```yml
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- dist/analog/public/~
run:
base: static
```

#### 3. [Trigger the build & deploy pipeline](#build--deploy-your-code)

### Server-side rendered (SSR) Analog app

If your project is not SSR Ready, set up your project for [Server Side Rendering](/docs/features/server/server-side-rendering).

#### 1. Create a project in Zerops

Projects and services can be added either through a [Project add](https://app.zerops.io/dashboard/project-add) wizard or imported using a YAML structure:

```yml
project:
name: recipe-analog
services:
- hostname: app
type: nodejs@20
```

This creates a project called `recipe-analog` with a Zerops Node.js service called `app`.

#### 2. Add zerops.yml configuration

To tell Zerops how to build and run your site, add a `zerops.yml` to your repository:

```yml
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- node_modules
- dist
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
start: node dist/analog/server/index.mjs
```

#### 3. [Trigger the build & deploy pipeline](#build-deploy-your-code)

---

### Build & deploy your code

#### Trigger the pipeline by connecting the service with your GitHub / GitLab repository

Your code can be deployed automatically on each commit or a new tag by connecting the service with your GitHub / GitLab repository. This connection can be set up in the service detail.

#### Trigger the pipeline using Zerops CLI (zcli)

You can also trigger the pipeline manually from your terminal or your existing CI/CD by using Zerops CLI.

1. Install the Zerops CLI.

```bash
# To download the zcli binary directly,
# use https://github.com/zeropsio/zcli/releases
npm i -g @zerops/zcli
```

2. Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.

3. Log in using your access token with the following command:

```bash
zcli login <token>
```

4. Navigate to the root of your app (where `zerops.yml` is located) and run the following command to trigger the deploy:

```bash
zcli push
```

#### Trigger the pipeline using GitHub / Gitlab

You can also check out [Github Integration](https://docs.zerops.io/references/github-integration) / [Gitlab Integration](https://docs.zerops.io/references/gitlab-integration) in [Zerops Docs](https://docs.zerops.io/) for git integration.

## Netlify

Analog supports deploying on [Netlify](https://netlify.com/) with minimal configuration.
Expand Down Expand Up @@ -161,9 +292,17 @@ BUILD_PRESET=cloudflare-pages npm run build
npx wrangler pages dev ./dist/analog/public
```

## Firebase
## Firebase App Hosting

Analog supports [Firebase App Hosting](https://firebase.google.com/docs/app-hosting) with no additional configuration out of the box.

**Note**: You need to be on the **Blaze plan** to deploy Analog applications with Firebase App Hosting.

Analog supports [Firebase Hosting](https://firebase.google.com/docs/hosting) with Cloud Functions out of the box.
Follow the [Getting Started instructions](https://firebase.google.com/docs/app-hosting/get-started#step-1:) to connect your GitHub repository to Firebase App Hosting.

## Firebase Hosting

Analog supports [Firebase Hosting](https://firebase.google.com/docs/hosting) with Cloud Functions and [Firebase App Hosting](https://firebase.google.com/docs/app-hosting) out of the box.

See a [Sample Repo](https://github.com/brandonroberts/analog-angular-firebase-example) with Firebase configured

Expand Down Expand Up @@ -462,132 +601,3 @@ jobs:
echo "DRY_RUN_OPTION=$DRY_RUN_OPTION"
npx angular-cli-ghpages --no-silent --dir="${{env.TARGET_DIR}}" $CNAME_OPTION $DRY_RUN_OPTION
```
## Zerops
Analog supports deploying both static and server-side rendered apps to [Zerops](https://zerops.io) with a simple configuration file.
:::info
One Zerops project can contain multiple Analog projects. See example repositories for [static](https://github.com/zeropsio/recipe-analog-static) and [server-side rendered](https://github.com/zeropsio/recipe-analog-nodejs) Analog apps for a quick start.
:::
### Static (SSG) Analog app
If your project is not SSG Ready, set up your project for [Static Site Generation](/docs/features/server/static-site-generation).
#### 1. Create a project in Zerops
Projects and services can be added either through a [Project add](https://app.zerops.io/dashboard/project-add) wizard or imported using a YAML structure:
```yml
project:
name: recipe-analog
services:
- hostname: app
type: static
```
This creates a project called `recipe-analog` with a Zerops Static service called `app`.

#### 2. Add zerops.yml configuration

To tell Zerops how to build and run your site, add a `zerops.yml` to your repository:

```yml
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- dist/analog/public/~
run:
base: static
```

#### 3. [Trigger the build & deploy pipeline](#build--deploy-your-code)

### Server-side rendered (SSR) Analog app

If your project is not SSR Ready, set up your project for [Server Side Rendering](/docs/features/server/server-side-rendering).

#### 1. Create a project in Zerops

Projects and services can be added either through a [Project add](https://app.zerops.io/dashboard/project-add) wizard or imported using a YAML structure:

```yml
project:
name: recipe-analog
services:
- hostname: app
type: nodejs@20
```

This creates a project called `recipe-analog` with a Zerops Node.js service called `app`.

#### 2. Add zerops.yml configuration

To tell Zerops how to build and run your site, add a `zerops.yml` to your repository:

```yml
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- node_modules
- dist
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
start: node dist/analog/server/index.mjs
```

#### 3. [Trigger the build & deploy pipeline](#build-deploy-your-code)

---

### Build & deploy your code

#### Trigger the pipeline by connecting the service with your GitHub / GitLab repository

Your code can be deployed automatically on each commit or a new tag by connecting the service with your GitHub / GitLab repository. This connection can be set up in the service detail.

#### Trigger the pipeline using Zerops CLI (zcli)

You can also trigger the pipeline manually from your terminal or your existing CI/CD by using Zerops CLI.

1. Install the Zerops CLI.

```bash
# To download the zcli binary directly,
# use https://github.com/zeropsio/zcli/releases
npm i -g @zerops/zcli
```

2. Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.

3. Log in using your access token with the following command:

```bash
zcli login <token>
```

4. Navigate to the root of your app (where `zerops.yml` is located) and run the following command to trigger the deploy:

```bash
zcli push
```

#### Trigger the pipeline using Github / Gitlab

You can also check out [Github Integration](https://docs.zerops.io/references/github-integration) / [Gitlab Integration](https://docs.zerops.io/references/gitlab-integration) in [Zerops Docs](https://docs.zerops.io/) for git integration.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Andres ist Softwareentwickler für HeroDevs, Angular und Firebase GDE.
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexrosepizant"><img src="https://avatars.githubusercontent.com/u/7753376?v=4?s=100" width="100px;" alt="Alex Rose-Pizant"/><br /><sub><b>Alex Rose-Pizant</b></sub></a><br /><a href="#infra-alexrosepizant" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mattlewis.me/"><img src="https://avatars.githubusercontent.com/u/6425649?v=4?s=100" width="100px;" alt="Matt Lewis"/><br /><sub><b>Matt Lewis</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=mattlewis92" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Andres es un ingeniero en software para HeroDevs, GDE en Angular y Firebase.
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexrosepizant"><img src="https://avatars.githubusercontent.com/u/7753376?v=4?s=100" width="100px;" alt="Alex Rose-Pizant"/><br /><sub><b>Alex Rose-Pizant</b></sub></a><br /><a href="#infra-alexrosepizant" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mattlewis.me/"><img src="https://avatars.githubusercontent.com/u/6425649?v=4?s=100" width="100px;" alt="Matt Lewis"/><br /><sub><b>Matt Lewis</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=mattlewis92" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 2 additions & 0 deletions libs/card/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default defineConfig(({ mode }) => {
setupFiles: ['src/test-setup.ts'],
include: ['**/*.spec.ts'],
cacheDir: '../../node_modules/.vitest',
pool: 'vmForks',
fileParallelism: false,
},
define: {
'import.meta.vitest': mode !== 'production',
Expand Down
Loading

0 comments on commit 9a9b0eb

Please sign in to comment.