Skip to content

Commit

Permalink
Rails 8; Ruby 3.4; gem updates; package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RISCfuture committed Dec 25, 2024
1 parent 3f7e486 commit 80315d5
Show file tree
Hide file tree
Showing 21 changed files with 2,253 additions and 2,215 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
29 changes: 0 additions & 29 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io
Expand Down
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"recommendations": [
"Vue.volar",
"vitest.explorer",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode"
]
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ End-to-end testing is available with Cypress. To run end-to-end tests, create a
`Procfile` similar to:

```
backend: cd Backend && rvm 3.3.5@flyweight exec rails server -e cypress -b 127.0.0.1
e2e: cd Frontend && yarn run test:e2e:dev
jobs: cd Backend && redis-cli flushall && RAILS_ENV=cypress rvm 3.3.5@flyweight exec bundle exec good_job start
anycable: cd Backend && RAILS_ENV=cypress rvm 3.3.5@greenie exec anycable
ws: cd Backend && rvm 3.3.5@greenie exec bin/anycable-go --port=8080
backend: cd Backend && rvm 3.4.1@flyweight exec rails server -e cypress -b 127.0.0.1
frontend: cd Frontend && yarn test:e2e:dev
jobs: cd Backend && RAILS_ENV=cypress rvm 3.4.1@flyweight exec bundle exec good_job start
anycable: cd Backend && RAILS_ENV=cypress rvm 3.4.1@flyweight exec anycable
ws: cd Backend && rvm 3.4.1@flyweight exec bin/anycable-go --port=8080
```

Install the `foreman` gem to run the Procfile.
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/auth.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('forgot password', () => {
cy.lastEmail()
.its('html')
.then((email: string) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const url = email.match(/"http:\/\/127\.0\.0\.1:4173(.+?)"/)![1]
cy.visit(url)

Expand All @@ -93,7 +93,7 @@ describe('forgot password', () => {
cy.lastEmail()
.its('html')
.then((email: string) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const url = email.match(/"http:\/\/127\.0\.0\.1:4173(.+?)"/)![1]
cy.visit(url)

Expand Down
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import pluginVitest from '@vitest/eslint-plugin'
import pluginCypress from 'eslint-plugin-cypress/flat'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
},

...pluginVue.configs['flat/recommended'],
...vueTsEslintConfig(),

{
files: ['**/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},

{
...pluginVitest.configs.recommended,
files: ['src/**/__tests__/*'],
},

{
...pluginCypress.configs.recommended,
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
'cypress/support/**/*.{js,ts,jsx,tsx}'
],
},
skipFormatting,
]
78 changes: 40 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "yarn@4.4.0+sha512.91d93b445d9284e7ed52931369bc89a663414e5582d00eea45c67ddc459a2582919eece27c412d6ffd1bd0793ff35399381cb229326b961798ce4f4cc60ddfdb",
"packageManager": "yarn@4.5.3",
"name": "flyweight",
"version": "0.0.0",
"private": true,
Expand All @@ -9,73 +9,75 @@
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"test:e2e": "start-server-and-test preview http://127.0.0.1:4173 'cypress run --e2e'",
"test:e2e": "start-server-and-test 'vite preview --host 127.0.0.1 --port 4173' http://127.0.0.1:4173 'cypress run --e2e'",
"test:e2e:dev": "start-server-and-test 'vite dev --host 127.0.0.1 --port 4173' http://127.0.0.1:4173 'cypress open --e2e'",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"type-check": "vue-tsc --build",
"lint": "eslint . --fix",
"format": "prettier --write src/",
"stylelint": "stylelint \"src/**/*.{vue,css,scss,sass}\""
},
"dependencies": {
"@bugsnag/browser-performance": "^2.8.0",
"@bugsnag/js": "^8.0.0",
"@bugsnag/plugin-vue": "^8.0.0",
"@rails/actioncable": "^7.2.100",
"@vuepic/vue-datepicker": "^9.0.2",
"date-fns": "^3.6.0",
"@bugsnag/browser-performance": "^2.10.1",
"@bugsnag/js": "^8.1.2",
"@bugsnag/plugin-vue": "^8.1.1",
"@rails/actioncable": "^8.0.100",
"@vuepic/vue-datepicker": "^10.0.0",
"date-fns": "^4.1.0",
"is-touch-device": "^1.0.1",
"lodash-es": "^4.17.21",
"luxon": "^3.5.0",
"normalize.css": "^8.0.1",
"pinia": "^2.2.2",
"pinia": "^2.3.0",
"ts-results": "^3.3.0",
"vue": "^3.4.38",
"vue-i18n": "^9.14.0",
"vue-router": "^4.4.3"
"vue": "^3.5.13",
"vue-i18n": "^11.0.0",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@flydotio/dockerfile": "^0.5.8",
"@pinia/testing": "^0.1.5",
"@flydotio/dockerfile": "^0.5.9",
"@pinia/testing": "^0.1.7",
"@rushstack/eslint-patch": "^1.10.4",
"@testing-library/cypress": "^10.0.2",
"@testing-library/vue": "^8.1.0",
"@tsconfig/node20": "^20.1.4",
"@types/is-touch-device": "^1.0.2",
"@tsconfig/node22": "^22.0.0",
"@types/is-touch-device": "^1.0.3",
"@types/jsdom": "^21.1.7",
"@types/lodash-es": "^4.17.12",
"@types/luxon": "^3.4.2",
"@types/node": "^22.5.2",
"@types/node": "^22.10.2",
"@types/rails__actioncable": "^6.1.11",
"@types/setimmediate": "^1.0.4",
"@vitejs/plugin-vue": "^5.1.3",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@typescript-eslint/utils": "^8.18.2",
"@vitejs/plugin-vue": "^5.2.1",
"@vitest/eslint-plugin": "^1.1.20",
"@vue/eslint-config-prettier": "^10.1.0",
"@vue/eslint-config-typescript": "^14.2.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"cypress": "^13.14.1",
"@vue/tsconfig": "^0.7.0",
"cypress": "^13.17.0",
"cypress-vite": "^1.5.0",
"eslint": "^8",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-vue": "^9.27.0",
"jsdom": "^25.0.0",
"npm-run-all2": "^6.2.2",
"postal-mime": "^2.2.7",
"postcss": "^8.4.44",
"eslint": "^9.17.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-vue": "^9.32.0",
"jsdom": "^25.0.1",
"npm-run-all2": "^7.0.2",
"postal-mime": "^2.3.2",
"postcss": "^8.4.49",
"postcss-html": "^1.7.0",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"prettier": "^3.4.2",
"sass": "^1.83.0",
"setimmediate": "^1.0.5",
"start-server-and-test": "^2.0.5",
"stylelint": "^16.9.0",
"stylelint-config-recess-order": "^5.1.0",
"stylelint": "^16.8.1",
"stylelint-config-recess-order": "^5.0.1",
"stylelint-config-recommended-scss": "^14.1.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-plugin-vue-devtools": "^7.3.9",
"vite": "^5.3.5",
"vite-plugin-vue-devtools": "^7.3.7",
"vitest": "^2.0.5",
"vue-tsc": "^2.1.4"
"vue-tsc": "^2.0.29"
}
}
2 changes: 1 addition & 1 deletion src/i18n/en/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const en: LocaleMessage<VueMessageType> = {
none: 'Couldn’t find that flight',
owner: 'Here’s what you can see that they can’t:',
loads: {
averageWeight: '({pax} avg. passenger, %{cargo} total cargo)',
averageWeight: '({pax} avg. passenger, {cargo} total cargo)',
createButton: 'Add',
noCargo: 'No cargo',
noPassengers: 'No passengers',
Expand Down
4 changes: 1 addition & 3 deletions src/stores/coding.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable camelcase */

import { isNull, map, omit } from 'lodash-es'
import * as luxon from 'luxon'
import type { Flight, FlightListItem, Load, EditableFlight, Pilot } from '@/types'
Expand All @@ -15,7 +13,7 @@ export type PilotJSONUp = Pilot & {
export type LoadJSONDown = Omit<Load, 'bagsWeight' | 'covid19Vaccination'> & {
bags_weight: number
covid19_vaccination: boolean
// eslint-disable-next-line no-use-before-define

flight?: FlightJSONDown
'destroyed?'?: boolean
}
Expand Down
2 changes: 0 additions & 2 deletions src/stores/modules/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable camelcase,no-shadow */

import { defineStore } from 'pinia'
import type { AccountState, APIResponse, Errors } from '@/stores/types'
import type { PilotJSONUp } from '@/stores/coding'
Expand Down
2 changes: 0 additions & 2 deletions src/stores/modules/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-shadow */

import { defineStore } from 'pinia'
import { clone, isEmpty, isNull, isNumber, isString } from 'lodash-es'
import type { APIResponse, AuthState, Errors } from '@/stores/types'
Expand Down
2 changes: 0 additions & 2 deletions src/stores/modules/flight.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-shadow,no-param-reassign */

import type { Errors, FlightState } from '@/stores/types'
import { defineStore } from 'pinia'
import { clone, cloneDeep, concat, isNil, isNull, isUndefined, some } from 'lodash-es'
Expand Down
2 changes: 0 additions & 2 deletions src/stores/modules/flights.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-shadow,no-param-reassign */

import type { Errors, FlightsState } from '@/stores/types'
import { defineStore } from 'pinia'
import { clone, concat, isEmpty, isNull, some } from 'lodash-es'
Expand Down
2 changes: 0 additions & 2 deletions src/stores/modules/root.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-shadow */

import { isNull, isString } from 'lodash-es'
import config from '@/config'
import type { APIResponse } from '@/stores/types'
Expand Down
3 changes: 1 addition & 2 deletions src/stores/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-empty-interface */

import type { Result } from 'ts-results'
import type { Flight, FlightListItem, Pilot } from '@/types'
import { Subscription } from '@rails/actioncable'
Expand All @@ -10,6 +8,7 @@ import { Subscription } from '@rails/actioncable'
*/
export type Errors = Record<string, string[]>

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface RootState {}

export interface AccountState {
Expand Down
3 changes: 0 additions & 3 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",

"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
Expand All @@ -8,7 +8,6 @@
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",

Expand Down
5 changes: 4 additions & 1 deletion tsconfig.vitest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"extends": "./tsconfig.app.json",
"include" : [
"src/**/__tests__/*",
"env.d.ts"
],
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",

"lib": [],
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

// https://vitejs.dev/config/
// https://vite.dev/config/
export default defineConfig({
server: {
host: 'localhost'
Expand Down
Loading

0 comments on commit 80315d5

Please sign in to comment.