Skip to content

Commit 013ee44

Browse files
committed
feat(ng-styled): update
1 parent 6881f89 commit 013ee44

36 files changed

Lines changed: 727 additions & 309 deletions

.commitlintrc.js

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1+
const { value } = require('@commitlint/config-angular-type-enum');
2+
const {
3+
utils: { getProjects },
4+
} = require('@commitlint/config-nx-scopes');
5+
16
module.exports = {
27
extends: ['@commitlint/config-angular'],
38
rules: {
4-
'type-enum': [
5-
2,
6-
'always',
7-
[
8-
// Minor
9-
'feat',
10-
// Patch
11-
'build',
12-
'docs',
13-
'fix',
14-
'perf',
15-
'refactor',
16-
// None
17-
'chore',
18-
'ci',
19-
'revert',
20-
'test',
21-
],
22-
],
9+
'body-leading-blank': [0, 'never'],
2310
'scope-empty': [0],
24-
'scope-enum': [
25-
2,
26-
'always',
27-
['docs', 'test', 'package', 'website', 'ng-styled'],
28-
],
11+
'scope-enum': (ctx) =>
12+
getProjects(ctx).then((packages) => [
13+
2,
14+
'always',
15+
[...packages, ...value(), 'package'],
16+
]),
2917
},
3018
ignores: [(message) => message.toLowerCase().startsWith('wip')],
3119
};

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
"files": ["*.js", "*.jsx"],
3131
"extends": ["plugin:@nrwl/nx/javascript"],
3232
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
3340
}
3441
]
3542
}

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-node@v1
2525
with:
26-
node-version: '14'
26+
node-version: '18'
2727

2828
- name: Install Dependencies 🔧
2929
run: npm install --no-package-lock
@@ -47,7 +47,7 @@ jobs:
4747

4848
- uses: actions/setup-node@v1
4949
with:
50-
node-version: '14'
50+
node-version: '18'
5151

5252
- name: Install Dependencies
5353
run: npm install --no-package-lock
@@ -69,7 +69,7 @@ jobs:
6969

7070
- uses: actions/setup-node@v1
7171
with:
72-
node-version: '14'
72+
node-version: '18'
7373

7474
- name: Install Dependencies
7575
run: npm install --no-package-lock

angular.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

apps/ng-styled-webpage-e2e/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"root": "apps/ng-styled-webpage-e2e",
2+
"name": "ng-styled-webpage-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "apps/ng-styled-webpage-e2e/src",
45
"projectType": "application",
56
"targets": {

apps/ng-styled-webpage/.browserslistrc

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
module.exports = {
1+
/* eslint-disable */
2+
export default {
23
displayName: 'ng-styled-webpage',
34
preset: '../../jest.preset.js',
45
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],

apps/ng-styled-webpage/project.json

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
{
2+
"name": "ng-styled-webpage",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
24
"projectType": "application",
3-
"root": "apps/ng-styled-webpage",
45
"sourceRoot": "apps/ng-styled-webpage/src",
56
"prefix": "",
67
"targets": {
78
"build": {
89
"executor": "@angular-devkit/build-angular:browser",
9-
"outputs": ["{options.outputPath}"],
10+
"outputs": [
11+
"{options.outputPath}"
12+
],
1013
"options": {
1114
"outputPath": "dist/apps/ng-styled-webpage/browser",
1215
"index": "apps/ng-styled-webpage/src/index.html",
1316
"main": "apps/ng-styled-webpage/src/main.ts",
14-
"polyfills": "apps/ng-styled-webpage/src/polyfills.ts",
17+
"polyfills": [
18+
"zone.js"
19+
],
1520
"tsConfig": "apps/ng-styled-webpage/tsconfig.app.json",
1621
"assets": [
1722
"apps/ng-styled-webpage/src/favicon.ico",
1823
"apps/ng-styled-webpage/src/assets"
1924
],
2025
"styles": [],
21-
"scripts": []
26+
"scripts": [],
27+
"allowedCommonJsDependencies": [
28+
"ts-deepmerge"
29+
]
2230
},
2331
"configurations": {
2432
"production": {
@@ -82,9 +90,11 @@
8290
},
8391
"test": {
8492
"executor": "@nrwl/jest:jest",
85-
"outputs": ["coverage/apps/ng-styled-webpage"],
93+
"outputs": [
94+
"{workspaceRoot}/coverage/{projectRoot}"
95+
],
8696
"options": {
87-
"jestConfig": "apps/ng-styled-webpage/jest.config.js",
97+
"jestConfig": "apps/ng-styled-webpage/jest.config.ts",
8898
"passWithNoTests": true
8999
}
90100
},
@@ -111,7 +121,21 @@
111121
"extractLicenses": false
112122
}
113123
},
114-
"defaultConfiguration": "production"
124+
"defaultConfiguration": "production",
125+
"production": {
126+
"outputHashing": "media",
127+
"fileReplacements": [
128+
{
129+
"replace": "apps/ng-styled-webpage/src/environments/environment.ts",
130+
"with": "apps/ng-styled-webpage/src/environments/environment.prod.ts"
131+
}
132+
]
133+
},
134+
"development": {
135+
"optimization": false,
136+
"sourceMap": true,
137+
"extractLicenses": false
138+
}
115139
},
116140
"serve-ssr": {
117141
"executor": "@nguniversal/builders:ssr-dev-server",
@@ -130,7 +154,9 @@
130154
"prerender": {
131155
"executor": "@nguniversal/builders:prerender",
132156
"options": {
133-
"routes": ["/"]
157+
"routes": [
158+
"/"
159+
]
134160
},
135161
"configurations": {
136162
"production": {
@@ -163,4 +189,4 @@
163189
}
164190
},
165191
"tags": []
166-
}
192+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { NgModule } from '@angular/core';
2+
import { RouterModule, Routes } from '@angular/router'; // CLI imports router
3+
import { LayoutComponent } from './layout/layout.component';
4+
5+
const routes: Routes = [
6+
{
7+
path: '',
8+
component: LayoutComponent,
9+
children: [
10+
{
11+
path: '',
12+
loadChildren: () =>
13+
import(
14+
/* webpackChunkName: "home" */
15+
/* webpackPrefetch: true */
16+
'./page/home/home.module'
17+
).then((m) => m.HomeModule),
18+
pathMatch: 'full',
19+
},
20+
],
21+
},
22+
// otherwise redirect to home
23+
{ path: '**', redirectTo: '' },
24+
]; // sets up routes constant where you define your routes
25+
26+
// configures NgModule imports and exports
27+
@NgModule({
28+
imports: [RouterModule.forRoot(routes)],
29+
exports: [RouterModule],
30+
})
31+
export class AppRoutingModule {}

apps/ng-styled-webpage/src/app/shared/code/code.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { GITHUB_STYLES } from './code.component.styles';
55
@Component({
66
selector: 'ng-styled-code',
77
templateUrl: './code.component.html',
8-
styleUrls: ['./code.component.css'],
98
changeDetection: ChangeDetectionStrategy.OnPush,
109
})
1110
@Styled(({ css }) => {

0 commit comments

Comments
 (0)