generated from nhcarrigan/template
feat: new site #1
@@ -37,11 +37,11 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: pnpm install
|
||||
|
||||
# - name: Lint Source Files
|
||||
# run: pnpm run lint
|
||||
- name: Lint Source Files
|
||||
run: pnpm run lint
|
||||
|
||||
# - name: Verify Build
|
||||
# run: pnpm run build
|
||||
- name: Verify Build
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run Tests
|
||||
run: pnpm run test
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import NaomisConfig from "@nhcarrigan/eslint-config";
|
||||
|
||||
export default [
|
||||
...NaomisConfig,
|
||||
]
|
||||
@@ -0,0 +1,47 @@
|
||||
import NaomisConfig from "@nhcarrigan/eslint-config";
|
||||
|
||||
const srcRules = NaomisConfig.find((rule) => rule.files?.includes("src/**/*.ts"));
|
||||
const testRules = NaomisConfig.find((rule) => rule.files?.includes("test/**/*.spec.ts"));
|
||||
|
||||
export default [
|
||||
...NaomisConfig,
|
||||
{
|
||||
files: ["src/**/*.ts"],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: "./tsconfig.app.json"
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
...srcRules?.plugins,
|
||||
},
|
||||
rules: {
|
||||
...srcRules?.rules,
|
||||
"new-cap": "off",
|
||||
// This causes a circular fix error?
|
||||
"stylistic/no-multi-spaces": "off",
|
||||
// This must be off because this is not a module.
|
||||
"import/extensions": "off",
|
||||
// This is a web app
|
||||
"no-console": "off",
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["src/**/*.spec.ts"],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: "./tsconfig.spec.json"
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
...testRules?.plugins,
|
||||
},
|
||||
rules: {
|
||||
...testRules?.rules,
|
||||
// This must be off because this is not a module.
|
||||
"import/extensions": "off",
|
||||
// We turn this off because the test bed has weak types.
|
||||
"@typescript-eslint/consistent-type-assertions": "off",
|
||||
}
|
||||
}
|
||||
]
|
||||
+12
-8
@@ -1,11 +1,15 @@
|
||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import {
|
||||
type ApplicationConfig,
|
||||
provideBrowserGlobalErrorListeners,
|
||||
} from "@angular/core";
|
||||
import { provideRouter } from "@angular/router";
|
||||
import { routes } from "./app.routes";
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideRouter(routes)
|
||||
]
|
||||
providers: [ provideBrowserGlobalErrorListeners(), provideRouter(routes) ],
|
||||
};
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import { Routes } from '@angular/router';
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import type { Routes } from "@angular/router";
|
||||
|
||||
export const routes: Routes = [];
|
||||
|
||||
+20
-7
@@ -1,23 +1,36 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { App } from './app';
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { TestBed } from "@angular/core/testing";
|
||||
import { describe, beforeEach, it, expect } from "vitest";
|
||||
import { App } from "./app";
|
||||
|
||||
describe('App', () => {
|
||||
describe("app", () => {
|
||||
beforeEach(async() => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ App ],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', () => {
|
||||
it("should create the app", () => {
|
||||
expect.assertions(1);
|
||||
const fixture = TestBed.createComponent(App);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
expect(app, "did not compile").toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render title', async () => {
|
||||
it("should render title", async() => {
|
||||
expect.assertions(1);
|
||||
const fixture = TestBed.createComponent(App);
|
||||
await fixture.whenStable();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, lore');
|
||||
expect(
|
||||
compiled.querySelector("h1")?.textContent,
|
||||
"did not render title",
|
||||
).toContain(
|
||||
"Hello, lore",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
+14
-6
@@ -1,12 +1,20 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { Component, signal } from "@angular/core";
|
||||
import { RouterOutlet } from "@angular/router";
|
||||
|
||||
/**
|
||||
* The root component for the application.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [ RouterOutlet ],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.css'
|
||||
selector: "app-root",
|
||||
styleUrl: "./app.css",
|
||||
templateUrl: "./app.html",
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('lore');
|
||||
protected readonly title = signal("lore");
|
||||
}
|
||||
|
||||
+13
-5
@@ -1,6 +1,14 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { App } from './app/app';
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { bootstrapApplication } from "@angular/platform-browser";
|
||||
import { App } from "./app/app";
|
||||
import { appConfig } from "./app/app.config";
|
||||
|
||||
bootstrapApplication(App, appConfig)
|
||||
.catch((err) => console.error(err));
|
||||
bootstrapApplication(App, appConfig).
|
||||
// eslint-disable-next-line unicorn/prefer-top-level-await -- No top level await in a web app
|
||||
catch((error: unknown) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"outDir": "./out-tsc/spec",
|
||||
"types": [
|
||||
"vitest/globals"
|
||||
]
|
||||
],
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user