-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(templates/angular-sanity): Add template
- Loading branch information
1 parent
6dc9ba7
commit ef36895
Showing
50 changed files
with
23,000 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SANITY_STUDIO_PROJECT_ID=tigv5ouc | ||
SANITY_STUDIO_DATASET=production |
39 changes: 39 additions & 0 deletions
39
templates/angular/sanity-angular-clean/.github/workflows/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
templates/angular/sanity-angular-clean/custom-webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
|
Oops, something went wrong.