-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy scully example from vercel/vercel (#1031)
- Loading branch information
1 parent
a1a148a
commit 232821b
Showing
37 changed files
with
9,438 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,4 @@ | ||
{ | ||
"repoId": "46af5832-8fee-459b-b18b-8bba203a5b1f", | ||
"lastSync": 0 | ||
} |
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,13 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
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 | ||
# Only exists if Bazel was run | ||
/bazel-out | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# profiling files | ||
chrome-profiler-events*.json | ||
speed-measure-plugin*.json | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.vercel |
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,21 @@ | ||
![Scully Logo](https://github.com/vercel/vercel/blob/main/packages/frameworks/logos/scully.svg) | ||
|
||
# Scully Example | ||
|
||
This directory is a brief example of a [Scully](https://scully.io) site that can be deployed to Vercel with zero configuration. | ||
|
||
## Deploy Your Own | ||
|
||
Deploy your own Scully project with Vercel. | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/framework-boilerplates/scully) | ||
|
||
_Live Example: https://scully-template.vercel.app_ | ||
|
||
### How We Created This Example | ||
|
||
To get started deploying Scully with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project: | ||
|
||
```shell | ||
$ vercel init scully | ||
``` |
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,116 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"scully": { | ||
"projectType": "application", | ||
"schematics": {}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist/scully", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"polyfills": "src/polyfills.ts", | ||
"tsConfig": "tsconfig.app.json", | ||
"aot": true, | ||
"assets": ["src/favicon.ico", "src/assets"], | ||
"styles": ["src/styles.css"], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "src/environments/environment.ts", | ||
"with": "src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"extractCss": true, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true, | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "2mb", | ||
"maximumError": "5mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "6kb", | ||
"maximumError": "10kb" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"options": { | ||
"browserTarget": "scully:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "scully:build:production" | ||
} | ||
} | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "scully:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"main": "src/test.ts", | ||
"polyfills": "src/polyfills.ts", | ||
"tsConfig": "tsconfig.spec.json", | ||
"karmaConfig": "karma.conf.js", | ||
"assets": ["src/favicon.ico", "src/assets"], | ||
"styles": ["src/styles.css"], | ||
"scripts": [] | ||
} | ||
}, | ||
"lint": { | ||
"builder": "@angular-devkit/build-angular:tslint", | ||
"options": { | ||
"tsConfig": [ | ||
"tsconfig.app.json", | ||
"tsconfig.spec.json", | ||
"e2e/tsconfig.json" | ||
], | ||
"exclude": ["**/node_modules/**"] | ||
} | ||
}, | ||
"e2e": { | ||
"builder": "@angular-devkit/build-angular:protractor", | ||
"options": { | ||
"protractorConfig": "e2e/protractor.conf.js", | ||
"devServerTarget": "scully:serve" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"devServerTarget": "scully:serve:production" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defaultProject": "scully", | ||
"cli": { | ||
"analytics": false | ||
} | ||
} |
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,7 @@ | ||
--- | ||
title: First post | ||
description: blog description | ||
publish: false | ||
--- | ||
|
||
# First post |
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,7 @@ | ||
--- | ||
title: Second post | ||
description: blog description | ||
publish: false | ||
--- | ||
|
||
# Second post |
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,12 @@ | ||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | ||
# For additional information regarding the format and rule options, please see: | ||
# https://github.com/browserslist/browserslist#queries | ||
|
||
# You can see what browsers were selected by your queries by running: | ||
# npx browserslist | ||
|
||
> 0.5% | ||
last 2 versions | ||
Firefox ESR | ||
not dead | ||
not IE 9-11 # For IE 9-11 support, remove 'not'. |
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,32 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/1.0/config/configuration-file.html | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('@angular-devkit/build-angular/plugins/karma'), | ||
], | ||
client: { | ||
clearContext: false, // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, './coverage/scully-blog'), | ||
reports: ['html', 'lcovonly', 'text-summary'], | ||
fixWebpackSourcePaths: true, | ||
}, | ||
reporters: ['progress', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false, | ||
restartOnFileChange: true, | ||
}); | ||
}; |
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,53 @@ | ||
{ | ||
"name": "scully", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build && scully", | ||
"test": "ng test", | ||
"lint": "ng lint", | ||
"scully": "scully" | ||
}, | ||
"private": true, | ||
"engines": { | ||
"node": "16.x" | ||
}, | ||
"dependencies": { | ||
"@angular/animations": "~9.0.0-rc.7", | ||
"@angular/common": "~9.0.0-rc.7", | ||
"@angular/compiler": "~9.0.0-rc.7", | ||
"@angular/core": "~9.0.0-rc.7", | ||
"@angular/forms": "~9.0.0-rc.7", | ||
"@angular/platform-browser": "~9.0.0-rc.7", | ||
"@angular/platform-browser-dynamic": "~9.0.0-rc.7", | ||
"@angular/router": "~9.0.0-rc.7", | ||
"@scullyio/init": "0.0.9", | ||
"@scullyio/ng-lib": "latest", | ||
"@scullyio/scully": "latest", | ||
"rxjs": "6.5.3", | ||
"tslib": "1.10.0", | ||
"zone.js": "~0.10.2" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "~0.900.0-rc.7", | ||
"@angular/cli": "~9.0.0-rc.7", | ||
"@angular/compiler-cli": "~9.0.0-rc.7", | ||
"@angular/language-service": "~9.0.0-rc.7", | ||
"@types/node": "^12.11.1", | ||
"@types/jasmine": "~3.5.0", | ||
"@types/jasminewd2": "~2.0.3", | ||
"codelyzer": "^5.1.2", | ||
"jasmine-core": "~3.5.0", | ||
"jasmine-spec-reporter": "~4.2.1", | ||
"karma": "~4.3.0", | ||
"karma-chrome-launcher": "~3.1.0", | ||
"karma-coverage-istanbul-reporter": "~2.1.0", | ||
"karma-jasmine": "~2.0.1", | ||
"karma-jasmine-html-reporter": "^1.4.2", | ||
"protractor": "~5.4.2", | ||
"ts-node": "~8.3.0", | ||
"tslint": "~5.18.0", | ||
"typescript": "~3.6.4" | ||
} | ||
} |
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,11 @@ | ||
exports.config = { | ||
projectRoot: './src/app', | ||
routes: { | ||
'/blog/:slug': { | ||
type: 'contentFolder', | ||
slug: { | ||
folder: './blog', | ||
}, | ||
}, | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
framework-boilerplates/scully/src/app/app-routing.module.ts
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,15 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'blog', | ||
loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule), | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule {} |
Empty file.
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,9 @@ | ||
<ul> | ||
<li *ngFor="let post of posts$ | async"> | ||
<a [routerLink]="post.route">{{ post.title }}</a> | ||
</li> | ||
</ul> | ||
|
||
<hr /> | ||
|
||
<router-outlet></router-outlet> |
33 changes: 33 additions & 0 deletions
33
framework-boilerplates/scully/src/app/app.component.spec.ts
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,33 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { AppComponent } from './app.component'; | ||
|
||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [RouterTestingModule], | ||
declarations: [AppComponent], | ||
}).compileComponents(); | ||
})); | ||
|
||
it('should create the app', () => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.componentInstance; | ||
expect(app).toBeTruthy(); | ||
}); | ||
|
||
it(`should have as title 'scully-blog'`, () => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.componentInstance; | ||
expect(app.title).toEqual('scully-blog'); | ||
}); | ||
|
||
it('should render title', () => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.nativeElement; | ||
expect(compiled.querySelector('.content span').textContent).toContain( | ||
'scully-blog app is running!' | ||
); | ||
}); | ||
}); |
Oops, something went wrong.