Skip to content

Commit 63519d5

Browse files
authored
bump vite to v5 (#87)
bump vite to v5 bump node to v20
1 parent b13c646 commit 63519d5

File tree

10 files changed

+275
-173
lines changed

10 files changed

+275
-173
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
NODE_VERSION: '16.x'
10+
NODE_VERSION: '20.x'
1111

1212
jobs:
1313

.github/workflows/coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 16
15+
node-version: 20
1616
- uses: c-hive/gha-yarn-cache@v2
1717
- name: Install dependencies
1818
run: yarn install

.github/workflows/jest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
with:
16-
node-version: 16
16+
node-version: 20
1717
- name: Install dependencies
1818
run: yarn install
1919
- uses: c-hive/gha-yarn-cache@v2

.github/workflows/playwright.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
with:
16-
node-version: 16
16+
node-version: 20
1717
- uses: c-hive/gha-yarn-cache@v2
1818
- name: Install dependencies
1919
run: yarn install

compat/ember-data-private-build-infra/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function generateDefineConfig(isProd: boolean) {
2626
Object.keys(config.debug).forEach((key) => {
2727
items[`${prefix}.debug.${key}`] = isProd ? false : config.debug[key];
2828
});
29-
return items;
29+
return {};
3030
}
3131

3232
export function getDataConfig(debug: boolean) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"prettier": "^2.8.3",
5050
"tailwindcss-ember-power-select": "^0.4.1",
5151
"typescript": "^4.7.2",
52-
"vite": "4.3.9"
52+
"vite": "5.0.7"
5353
},
5454
"dependencies": {
5555
"@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -122,7 +122,7 @@
122122
"yaml": "^2.2.1"
123123
},
124124
"volta": {
125-
"node": "18.13.0",
125+
"node": "20.10.0",
126126
"yarn": "1.22.19"
127127
}
128128
}

patches/ember-intl+5.7.2.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/node_modules/ember-intl/addon/-private/utils/hydrate.ts b/node_modules/ember-intl/addon/-private/utils/hydrate.ts
2+
index 29610f8..1694a78 100644
3+
--- a/node_modules/ember-intl/addon/-private/utils/hydrate.ts
4+
+++ b/node_modules/ember-intl/addon/-private/utils/hydrate.ts
5+
@@ -1,4 +1,3 @@
6+
-import translations from 'ember-intl/translations';
7+
import type IntlService from '../../services/intl';
8+
9+
/**
10+
@@ -6,7 +5,5 @@ import type IntlService from '../../services/intl';
11+
* @hide
12+
*/
13+
export default function hydrate(service: IntlService) {
14+
- translations.forEach(([locale, translations]) => {
15+
- service.addTranslations(locale, translations);
16+
- });
17+
+
18+
}

plugins/i18n-loader.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@ import { basename, extname, join } from 'path';
44
import { constants } from 'fs';
55
import type { Plugin } from 'vite';
66

7-
const translationsFileName = 'ember-intl/translations';
87
const translationsDir = 'translations';
98

9+
const virtualModuleId = 'ember-intl/translations';
10+
const resolvedVirtualModuleId = '\0virtual:' + virtualModuleId;
11+
1012
export default function i18nLoader(): Plugin {
1113
return {
1214
name: 'i18n-loader',
1315
enforce: 'pre',
14-
1516
resolveId(source) {
16-
if (source === translationsFileName) {
17-
return source;
17+
if (source === virtualModuleId) {
18+
return resolvedVirtualModuleId;
19+
} else {
20+
return null;
1821
}
19-
20-
return null;
2122
},
22-
2323
async load(id) {
24-
if (id !== translationsFileName) {
24+
if (id !== resolvedVirtualModuleId) {
2525
return null;
2626
}
27-
2827
const translations = [];
2928
const files = await readdir(translationsDir);
3029

vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default defineConfig(({ mode }) => {
2727
{
2828
build: {
2929
sourcemap: enableSourceMaps,
30+
chunkSizeWarningLimit: 1000,
3031
rollupOptions: isDev
3132
? {
3233
input: {
@@ -49,6 +50,7 @@ export default defineConfig(({ mode }) => {
4950
App()
5051
.extendDefineConfig({
5152
ENV_DEBUG: isProd ? false : true,
53+
DEBUG: isProd ? false : true,
5254
ENV_CI: false,
5355
})
5456
.addAlias(`@/tests/`, fileURLToPath(new URL(`./tests/`, projectRoot)))

0 commit comments

Comments
 (0)