Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(templates/astro-sanity): Add template #159

Merged
merged 5 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions templates/angular/sanity-angular-clean/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SANITY_STUDIO_PROJECT_ID=r0z1eifg
SANITY_STUDIO_DATASET=clean-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Main Edge Deploy

on:
pull_request:
types:
- closed
branches:
- "main"

jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: yarn

- name: Install Azion CLI
run: |
curl -o azionlinux https://downloads.azion.com/linux/x86_64/azion
sudo mv azionlinux /usr/bin/azion
sudo chmod u+x /usr/bin/azion
- name: Azion Action Deploy
run: |
azion -t ${{ secrets.AZION_PERSONAL_TOKEN }}
azion deploy
48 changes: 48 additions & 0 deletions templates/angular/sanity-angular-clean/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
.angular

# Azion
.edge
.vulcan

29 changes: 29 additions & 0 deletions templates/angular/sanity-angular-clean/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Angular

This directory is a brief example of an [Angular](https://angular.io/) app.

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.0.1

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
147 changes: 147 additions & 0 deletions templates/angular/sanity-angular-clean/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-test": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js"
},
"allowedCommonJsDependencies": [
"@sanity/image-url",
"event-source-polyfill",
"parse-headers",
"debug"
],
"outputPath": "dist/",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
"configurations": {
"production": {
"browserTarget": "angular-test:build:production"
},
"development": {
"browserTarget": "angular-test:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-test:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/angular-test/server",
"main": "server.ts",
"tsConfig": "tsconfig.server.json"
},
"configurations": {
"production": {
"outputHashing": "media"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"sourceMap": true,
"extractLicenses": false,
"vendorChunk": true
}
},
"defaultConfiguration": "production"
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"configurations": {
"development": {
"browserTarget": "angular-test:build:development",
"serverTarget": "angular-test:server:development"
},
"production": {
"browserTarget": "angular-test:build:production",
"serverTarget": "angular-test:server:production"
}
},
"defaultConfiguration": "development"
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"routes": ["/"]
},
"configurations": {
"production": {
"browserTarget": "angular-test:build:production",
"serverTarget": "angular-test:server:production"
},
"development": {
"browserTarget": "angular-test:build:development",
"serverTarget": "angular-test:server:development"
}
},
"defaultConfiguration": "production"
}
}
}
},
"cli": {
"analytics": "c5cce991-b4fe-4e80-9de3-4e2adfe42a68"
}
}
8 changes: 8 additions & 0 deletions templates/angular/sanity-angular-clean/azion.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
build: {
preset: {
name: 'angular'
}
}
}

18 changes: 18 additions & 0 deletions templates/angular/sanity-angular-clean/custom-webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { EnvironmentPlugin } = require('webpack');
// Add additional requirements here

// If you're using dotenv
require('dotenv').config()

// Export a configuration object
// See [Wepack's documentation](https://webpack.js.org/configuration/) for additional ideas of how to
// customize your build beyond what Angular provides.
module.exports = {
plugins: [
new EnvironmentPlugin([
// Insert the keys to your environment variables here.
// Eg: APP_API_ENDPOINT="http://localhost:3000/api/v1"
SANITY_STUDIO_PROJECT_ID,
SANITY_STUDIO_DATASET
])
}
8 changes: 8 additions & 0 deletions templates/angular/sanity-angular-clean/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Clean Angular App with Sanity",
"message": "A minimal Angular site with Sanity",
"preset": "angular",
"mode": "deliver",
"path": "/sanity-angular-clean"
}

Loading
Loading