Skip to content

Commit b9f26a1

Browse files
authored
Refine commands and clean up unused ones (#61)
* Clean up unused commands * move rimraf to dev dependency * update usage accordingly * update test in pipeline
1 parent 50cb227 commit b9f26a1

File tree

8 files changed

+37
-21
lines changed

8 files changed

+37
-21
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WORKDIR /ng-app
1818
COPY package*.json tsconfig*.json angular.json ./
1919
COPY ./src ./src
2020

21-
RUN npm ci --quiet && npm run build-nas
21+
RUN npm ci --quiet && npm run build:nas
2222

2323
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2424

Dockerfile-nas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ WORKDIR /ng-app
1515
COPY package*.json tsconfig*.json angular.json ./
1616
COPY ./src ./src
1717

18-
RUN npm ci --quiet && npm run build-nas
18+
RUN npm ci --quiet && npm run build:nas
1919

2020
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2121

Dockerfile-prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ WORKDIR /ng-app
1515
COPY package*.json tsconfig*.json angular.json ./
1616
COPY ./src ./src
1717

18-
RUN npm ci --quiet && npm run build:aot:prod
18+
RUN npm ci --quiet && npm run build:cross:env
1919

2020
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2121

Dockerfile2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WORKDIR /ng-app
2222

2323
COPY . .
2424

25-
RUN npm run build:aot:prod
25+
RUN npm run build:cross:env
2626

2727
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
2828

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ stages:
101101

102102
- script: |
103103
# Run unit tests in headless Chrome and produce coverage
104-
npm run test-headless -- --no-watch --browsers=ChromeHeadless
104+
npm run test:headless
105105
displayName: 'Run unit tests (headless)'
106106
107107
- stage: Build

package-lock.json

Lines changed: 22 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
},
88
"license": "MIT",
99
"scripts": {
10-
"start": "node server.js",
11-
"dev": "ng serve",
12-
"build-aot": "ng build --aot --prod",
10+
"start": "ng serve",
11+
"start:prod": "ng serve --configuration production",
12+
"start:nas": "ng serve --configuration nas",
13+
"start:mock": "node server.js",
1314
"build": "ng build --configuration production",
14-
"build:aot:prod": "rimraf dist compiled && cross-env BUILD_AOT=1 SOURCE_MAP=0 ng build --prod",
15-
"build-nas": "ng build --configuration nas",
16-
"start-nas": "ng serve --configuration nas",
15+
"build:nas": "ng build --configuration nas",
16+
"build:cross:env": "rimraf dist compiled && cross-env SOURCE_MAP=0 ng build --configuration production",
1717
"test": "ng test",
18-
"test-headless": "ng test --watch=false --browsers=ChromeHeadless",
18+
"test:headless": "ng test --watch=false --browsers=ChromeHeadless",
1919
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
2020
"e2e": "ng e2e"
2121
},
@@ -33,7 +33,6 @@
3333
"@angular/router": "^20.3.6",
3434
"bootstrap": "^4.6.1",
3535
"ngx-monaco-editor-v2": "^20.3.0",
36-
"rimraf": "^2.6.3",
3736
"rxjs": "^6.6.7",
3837
"rxjs-compat": "^6.6.7",
3938
"tslib": "^2.3.1",
@@ -62,6 +61,7 @@
6261
"karma-jasmine-html-reporter": "~2.1.0",
6362
"prettier": "^3.6.2",
6463
"protractor": "~7.0.0",
64+
"rimraf": "^2.6.3",
6565
"ts-node": "~4.1.0",
6666
"typescript": "~5.8.3",
6767
"typescript-eslint": "8.46.0"

src/app/compare-editor/compare-editor.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('TextCompareComponent', () => {
2525
it('should render title in a h1 tag', waitForAsync(async () => {
2626
const fixture = TestBed.createComponent(CompareEditorComponent);
2727
fixture.detectChanges();
28-
const compiled = fixture.debugElement.nativeElement as HTMLElement;
29-
const h1Element = compiled.querySelector('h1');
28+
const compareEditor = fixture.debugElement.nativeElement as HTMLElement;
29+
const h1Element = compareEditor.querySelector('h1');
3030
await expect(h1Element).toBeTruthy('h1 element should exist');
3131
if (h1Element) {
3232
await expect(h1Element.textContent).toContain('Text Compare');

0 commit comments

Comments
 (0)