Skip to content

Commit

Permalink
Merge branch 'migrate-to-angular-18' into tekniskmuseum-styling
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/app/admin/admin.component.html
#	src/app/admin/info/info.component.html
#	src/app/game/game-draw/services/drawing.service.ts
#	src/app/game/game-intermediate-result/game-intermediate-result.component.html
#	src/app/game/game-multiplayer/services/pairing.service.ts
#	src/app/game/game-multiplayer/services/web-socket.service.ts
#	src/app/game/game-result/game-result.component.html
#	src/app/welcome/welcome.component.html
#	src/app/welcome/welcome.component.ts
#	src/environments/environment.ts
#	src/styles.scss
  • Loading branch information
ThomasBakkenMoe-Computas committed Jun 13, 2024
2 parents 16be586 + 1e04a56 commit ca006a9
Show file tree
Hide file tree
Showing 80 changed files with 585 additions and 32,756 deletions.
12 changes: 0 additions & 12 deletions .browserslistrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_FOREST_0AAFB1303 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/src" # App source code path
app_build_command: "npm run build:ci"
output_location: "dist/tekniskmuseum" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_FOREST_0AAFB1303 }}
action: "close"
name: Deploy to computas instance of Kunstige Jens Azure Static Web Apps CI/CD

on:
push:
branches:
- master

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_HAPPY_BUSH_01C322703 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: 'upload'
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_build_command: 'npm run build -- --configuration computas'
app_location: '/' # App source code path
api_location: '' # Api source code path - optional
output_location: '/dist/tekniskmuseum' # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_HAPPY_BUSH_01C322703 }}
action: 'close'
50 changes: 0 additions & 50 deletions .github/workflows/azure.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/deploy.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/main.yml

This file was deleted.

28 changes: 13 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Lint, Test & Build
name: Lint & Build

on:
push:
Expand All @@ -10,27 +10,25 @@ on:

jobs:
build:
name: Lint & Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [21.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Checkout ✔️
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci
- name: Setup bun 🥟
uses: oven-sh/setup-bun@v1

- name: Lint
run: npm run lint
- name: Install dependencies 📝
run: bun install

- name: Test
run: npm run test:ci
- name: Run Lint 🧼
run: bun run lint

- name: Build
run: npm run build:ci
- name: Build 🛠️
run: bun run build
26 changes: 11 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# compiled output
# Compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
# Node
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
npm-debug.log
yarn-error.log

# IDEs and editors
/.idea
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
# System files
.DS_Store
Thumbs.db
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
# Tekniskmuseum

## Setup
Dette er repoet som står for front-end biten av Teknisk Museum-prosjektet "Kunstig Jens". Her finner du svar på de viktigste tingene du trenger å kunne for å starte opp applikasjonen.

Run `npm install`
## Oppsett

## Development server
1. Prosjektet bruker [Bun](https://bun.sh) for pakkebehandling og kjøring av kode. Om du ikke har installert Bun, kan det gjøres slik:

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
```shell
# For MacOS, Linux, og WSL
curl -fsSL https://bun.sh/install | bash

## Documentation
https://confluence.computas.com/display/SO/Teknisk+museum
# For Windows
powershell -c "irm bun.sh/install.ps1|iex"
```

2. Deretter kan du installere avhengighetene i prosjektet ved å kjøre

```shell
bun install
```

3. Til slutt kan du starte opp det lokale utviklingsmiljøet ved å kjøre

```shell
bun run start
```

## Forskjellige miljøer

Om man ønsker å gå mot forskjellige miljøer, er det satt opp et sett med forskjellige konfigurasjoner i prosjektet. Disse finner man i mappen `/src/environments/`. Om man f.eks. ønsker å bruke konfigurasjonen "Computas", kan man gjøre det ved å legge til argumentet `--configuration` når man starter opp det lokale utviklingsmiljøet. Det vil si at man da kjører scriptet

```shell
bun run start --configuration computas
```

## Oppstår det problemer i teamet forbundet med bruk av Bun?

Ikke noe problem! Dere kan enkelt gå over til mer tradisjonelle verktøy som Yarn eller NPM. Da er det bare å gjøre følgende:

- Slett `bun.lockb` filen.
- Endre workflowene i `.github/workflows` til å ikke bruke Bun (dvs erstatt trinnet `uses: oven-sh/setup-bun@v1` samt andre kall som bruker Bun).
- Skriv inn ny pakkebehandler i feltet `cli.packageManager` i `angular.json`.
- Lag en ny lockfil med den nye pakkebehandleren ved å kjøre hhv. `npm i` eller `yarn`.
Loading

0 comments on commit ca006a9

Please sign in to comment.