Skip to content

Commit 205cc6d

Browse files
authored
Revert back to Laravel Mix (#428)
* Revert "use terser to fix #426 (#427)" This reverts commit 4c80c4e. * Revert "switch laravel mix to vite (#423)" This reverts commit cb53072.
1 parent 4c80c4e commit 205cc6d

File tree

99 files changed

+76980
-7111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+76980
-7111
lines changed

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ module.exports = {
1010
'plugin:import/errors',
1111
'plugin:import/typescript',
1212
],
13+
globals: {
14+
Lang: 'readonly',
15+
TSMLReactConfig: 'readonly',
16+
Translation: 'readonly',
17+
},
1318
'overrides': [
1419
{
1520
'env': {

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v2
1515

1616
- name: Setup Node
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v2
1818
with:
19-
node-version: '18'
20-
- run: npm ci
19+
node-version: '16'
20+
cache: 'npm'
21+
- run: npm install
2122
- run: npm run test-coverage
22-
- run: npm run build
23+
- run: npx mix --production
2324

2425
- name: Coveralls
2526
uses: coverallsapp/github-action@master

.gitignore

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
pnpm-debug.log*
8-
lerna-debug.log*
9-
10-
node_modules
11-
dist
12-
dist-ssr
13-
*.local
14-
15-
# Editor directories and files
1+
/node_modules
162
mix-manifest.json
173
npm-debug.log
184
coverage
@@ -21,9 +7,4 @@ playwright-report/
217
public/custom
228
.vscode
239
.DS_Store
24-
.idea
25-
*.suo
26-
*.ntvs*
27-
*.njsproj
28-
*.sln
29-
*.sw?
10+
.idea

babel.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import("@babel/core").TransformOptions} */
2+
module.exports = {
3+
presets: [
4+
['@babel/preset-env', { targets: { node: 'current' } }],
5+
'@babel/preset-typescript',
6+
],
7+
};

eslint.config.js

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

src/types/Settings.ts renamed to index.d.ts

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import type { Language } from '@code4recovery/spec';
1+
/* eslint-disable no-unused-vars */
22

3-
import type { Translation } from './Translation';
3+
type Translation = import('./src/types/Translation').Translation;
4+
type Lang = import('@code4recovery/spec').Language;
45

5-
export type Settings = {
6+
interface TSMLReactConfig {
7+
cache: boolean;
68
calendar_enabled: boolean;
79
columns: string[];
810
conference_providers: Record<string, string>;
@@ -12,10 +14,10 @@ export type Settings = {
1214
mode: 'search' | 'location' | 'me';
1315
region: string[];
1416
search: string;
15-
time: Settings['times'];
17+
time: TSMLReactConfig['times'];
1618
type: string[];
1719
view: 'table' | 'map';
18-
weekday: Settings['weekdays'];
20+
weekday: TSMLReactConfig['weekdays'];
1921
};
2022
distance_options: number[];
2123
distance_unit: 'mi' | 'km';
@@ -24,7 +26,7 @@ export type Settings = {
2426
filters: Array<'region' | 'distance' | 'weekday' | 'time' | 'type'>;
2527
flags?: string[];
2628
in_person_types: string[];
27-
language: Language;
29+
language: Lang;
2830
map: {
2931
markers: {
3032
location: {
@@ -43,8 +45,39 @@ export type Settings = {
4345
title: boolean;
4446
};
4547
strings: {
46-
[lang in Language]: Translation;
48+
[lang in Lang]: Translation;
4749
};
4850
times: Array<'morning' | 'midday' | 'evening' | 'night'>;
4951
weekdays: string[];
50-
};
52+
}
53+
54+
declare var tsml_react_config: TSMLReactConfig | undefined;
55+
56+
//google analytics globals
57+
declare var gtag:
58+
| ((
59+
type: 'event',
60+
action: string,
61+
params: {
62+
event_category: string;
63+
event_label: string;
64+
}
65+
) => void)
66+
| undefined;
67+
68+
declare var ga:
69+
| ((
70+
type: 'send',
71+
params: {
72+
hitType: 'event';
73+
eventCategory: string;
74+
eventAction: string;
75+
eventLabel: string;
76+
}
77+
) => void)
78+
| undefined;
79+
80+
//declaration merge for IE compat
81+
interface Navigator {
82+
msSaveBlob: (blob: Blob, name: string) => void;
83+
}

jest.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import("@jest/types").Config.InitialOptions} */
2+
module.exports = {
3+
testEnvironment: 'jsdom',
4+
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
5+
collectCoverageFrom: [
6+
'<rootDir>/src/**/*.(j|t)s*',
7+
'!<rootDir>/src/(types|i18n)/*',
8+
'!<rootDir>/**/__snapshots__/*',
9+
'!<rootDir>/src/**/index.ts',
10+
],
11+
moduleNameMapper: {
12+
'\\.(css)$': '<rootDir>/test/__mocks__/styleMock.js',
13+
},
14+
};

jest.config.ts

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

jest.setup.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import '@testing-library/jest-dom/extend-expect';
2+
import React from 'react';
3+
4+
global.React = React;
5+
6+
const savedLocation = window.location;
7+
const savedHistory = window.history;
8+
9+
beforeEach(() => {
10+
delete window.location;
11+
delete window.history;
12+
13+
window.history = {
14+
pushState: jest.fn(),
15+
};
16+
17+
window.location = new URL('https://test.com');
18+
window.location.reload = jest.fn();
19+
});
20+
21+
afterEach(() => {
22+
window.location = savedLocation;
23+
window.history = savedHistory;
24+
});

jest.setup.ts

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

0 commit comments

Comments
 (0)