Skip to content

Commit f75f1a1

Browse files
committed
front: switch to ESM
The next commit will require ESM instead of CJS (the default). Rename @rtk-query/codegen-openapi config files to .cts: that CLI tool uses require() to load the config files, and this doesn't work with ESM. The next commit will switch the whole project to ESM, so rename these individual files to selectively opt-out of ESM.
1 parent 34c0b8e commit f75f1a1

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

front/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "osrd",
33
"version": "0.1.0",
44
"private": true,
5+
"type": "module",
56
"dependencies": {
67
"@ag-media/react-pdf-table": "^1.0.1",
78
"@hookform/resolvers": "^3.3.4",

front/scripts/generate-types.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/sh
2-
npx @rtk-query/codegen-openapi src/config/openapi-editoast-config.ts
2+
npx @rtk-query/codegen-openapi src/config/openapi-editoast-config.cts
33
if [ $? -ne 0 ]; then
4-
echo "npx @rtk-query/codegen-openapi src/config/openapi-editoast-config.ts command failed. Exit the script"
4+
echo "npx @rtk-query/codegen-openapi src/config/openapi-editoast-config.cts command failed. Exit the script"
55
exit 1
66
fi
77
yarn eslint --fix src/common/api/generatedEditoastApi.ts --no-ignore
8-
npx @rtk-query/codegen-openapi src/config/openapi-gateway-config.ts
8+
npx @rtk-query/codegen-openapi src/config/openapi-gateway-config.cts
99
if [ $? -ne 0 ]; then
10-
echo "npx @rtk-query/codegen-openapi src/config/openapi-gateway-config.ts command failed. Exit the script"
10+
echo "npx @rtk-query/codegen-openapi src/config/openapi-gateway-config.cts command failed. Exit the script"
1111
exit 1
1212
fi
1313
yarn eslint --fix src/common/api/osrdGatewayApi.ts --no-ignore

0 commit comments

Comments
 (0)