Skip to content

Commit

Permalink
Update packages (#301)
Browse files Browse the repository at this point in the history
* update packages

* update code for new packages

* fix eslint config

* fix eslint command; resolve eslint errors

* resolve prettier warning

* fix typo

* update github ci

* fix node cache path

* upgrade node to v22 LTS

* Update packages  use params for analytics change (#302)

* Update params with analytics_params

* Use const now for url

* minor formatting

---------

Co-authored-by: Nathan Franklin <[email protected]>
  • Loading branch information
rstijerina and nathanfranklin authored Jan 15, 2025
1 parent a06303c commit bf19dda
Show file tree
Hide file tree
Showing 31 changed files with 12,382 additions and 8,448 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = 2
[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
185 changes: 83 additions & 102 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,113 @@ name: CI

on:
push:
branches: [ master ]
branches: [main]
pull_request:
branches: [ '**' ]
branches: ["**"]

jobs:
Angular-Unit-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd angular
touch src/environments/jwt.js
npm ci
- name: Unit Tests
run: |
cd angular
npm run test:ci
- uses: actions/checkout@v4

- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 14
cache: npm
cache-dependency-path: angular/package-lock.json

- name: npm ci
working-directory: angular
run: |
touch src/environments/jwt.js
npm ci
- name: Unit Tests
working-directory: angular
run: npm run test:ci

Angular-Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd angular
npm ci
- name: Linting
run: |
cd angular
npm run lint
- uses: actions/checkout@v4

- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 14
cache: npm
cache-dependency-path: angular/package-lock.json

- name: npm ci
working-directory: angular
run: npm ci

- name: Linting
working-directory: angular
run: npm run lint

React-Unit-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 20.10.x
- uses: actions/checkout@v4

- uses: actions/cache@v1
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 22
cache: npm
cache-dependency-path: react/package-lock.json

- name: npm ci
run: |
cd react
npm ci
working-directory: react
run: npm ci

- name: Unit Tests
working-directory: react
run: |
cd react
cp src/secret_local.example.ts src/secret_local.ts
npm run test
React-Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 20.10.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd react
npm ci
- name: Linting
run: |
cd react
npm run lint
- uses: actions/checkout@v4

- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: react/package-lock.json

- name: npm ci
working-directory: react
run: npm ci

- name: Linting
working-directory: react
run: npm run lint

React-Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 20.10.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd react
npm ci
- name: Build
run: |
cd react
cp src/secret_local.example.ts src/secret_local.ts
npm run build
- uses: actions/checkout@v4

- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: react/package-lock.json

- name: npm ci
working-directory: react
run: npm ci

- name: Build
working-directory: react
run: |
cp src/secret_local.example.ts src/secret_local.ts
npm run build
3 changes: 0 additions & 3 deletions react/.eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions react/.eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions react/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.10.0-alpine3.18 as node
FROM node:22-alpine AS node

RUN mkdir /www
COPY react /www
Expand All @@ -10,7 +10,7 @@ COPY react/src/secret_local.example.ts src/secret_local.ts
RUN npm ci
RUN npm run build

FROM nginx:1.24-alpine
FROM nginx:stable-alpine
WORKDIR /
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=node /www/dist/ /usr/share/nginx/html
53 changes: 53 additions & 0 deletions react/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import { fixupPluginRules } from '@eslint/compat';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default tseslint.config([
{
ignores: ['**/dist/', '**/build/', '**/coverage/*'],
},
eslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
jsxA11y.flatConfigs.recommended,
tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
},
{
plugins: {
'react-hooks': fixupPluginRules(eslintPluginReactHooks),
},

languageOptions: {
globals: {
...globals.browser,
...globals.jest,
...globals.node,
},

ecmaVersion: 'latest',
sourceType: 'module',
},

settings: {
react: {
version: 'detect',
},
},

rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
...eslintPluginReactHooks.configs.recommended.rules,
},
},
]);
2 changes: 1 addition & 1 deletion react/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
Loading

0 comments on commit bf19dda

Please sign in to comment.