Revert "fix: change node version to 21"

This reverts commit 4b5e946eb9.

# Conflicts:
#	site/package.json
#	yarn.lock
pull/2847/head
Johan Girod 2023-12-15 09:43:53 +01:00
parent f928573072
commit b28fd65586
15 changed files with 465 additions and 455 deletions

View File

@ -6,7 +6,7 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: '21'
node-version: '18.18.2'
cache: 'yarn'
- run: yarn install --immutable
shell: bash

2
.nvmrc
View File

@ -1 +1 @@
21
18.18

View File

@ -56,6 +56,7 @@
"@types/node": "^20.6.3",
"@types/swagger-ui-dist": "^3.30.1",
"chai-http": "^4.4.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vitest": "^0.34.4",
"wait-on": "^7.0.1"

View File

@ -174,7 +174,7 @@ describe('e2e test mon-entreprise api', () => {
return res.text
})
).resolves.toMatchInlineSnapshot(
'"Expected property name or \'}\' in JSON at position 2 (line 1 column 3)"'
'"Unexpected token x in JSON at position 2"'
)
})
})

View File

@ -35,6 +35,9 @@
// remove this when vite support "NodeNext" : https://github.com/vitejs/vite/issues/10481 or https://github.com/vitejs/vite/issues/8993
"skipLibCheck": true
},
"ts-node": {
"esm": true
},
"include": ["source"],
"exclude": ["**/dist", "vitest.config.ts"]
}

View File

@ -112,6 +112,7 @@ entreprise . imposition . IS:
entreprise . imposition . IS . montant:
unité: €/an
applicable si: prorata temporis > 0
barème:
assiette: résultat imposable
multiplicateur: prorata temporis

View File

@ -64,6 +64,6 @@
},
"packageManager": "yarn@3.5.0",
"engines": {
"node": "^21"
"node": "^18"
}
}

View File

@ -33,6 +33,7 @@
"@types/koa__router": "^12.0.1",
"@types/node": "^20.6.3",
"@types/safe-timers": "^1.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"engines": {

View File

@ -32,7 +32,10 @@
/* Advanced Options */
"forceConsistentCasingInFileNames": true
},
"ts-node": {
"esm": true,
"files": true
},
"include": ["source", "types/**/*.d.ts"],
"exclude": ["**/node_modules", "**/dist", "vitest.config.ts"]
}

View File

@ -1,6 +1,6 @@
import { writeFileSync } from 'node:fs'
import { absoluteSitePaths, generateSiteMap } from '../source/sitePaths.ts'
import { absoluteSitePaths, generateSiteMap } from '../source/sitePaths.js'
const basePathEn =
process.env.VITE_EN_BASE_URL ?? 'http://localhost:3000/infrance'

View File

@ -9,9 +9,8 @@ import { absoluteSitePaths } from '../source/sitePaths.js'
const filename = new URL('./prerender-worker.ts', import.meta.url).href
const pool = new Tinypool({
filename,
execArgv: ['--import', 'tsx/esm'],
execArgv: ['--loader', 'ts-node/esm'],
idleTimeout: 2000,
runtime: 'child_process',
})
const sitePathFr = absoluteSitePaths.fr
@ -67,7 +66,6 @@ const redirects = await Promise.all(
urls.map(async (url) => {
const path = await (pool.run({
site,
url,
lang: site === 'mon-entreprise' ? 'fr' : 'en',
}) as Promise<string>)

View File

@ -37,12 +37,12 @@
"start:netlify": "sed 's|:SITE_EN|/infrance|g' netlify.base.toml | sed 's|:SITE_FR|/mon-entreprise|g' | sed 's|:API_URL|http://localhost:3004|g' | sed 's|\\[\\[redirects\\]\\]|\\[\\[redirects\\]\\]\\n force = true|g' > netlify.toml && HMR_CLIENT_PORT=8888 netlify dev",
"build:iframe-script": "NODE_OPTIONS='--max-old-space-size=4096'; vite build --config build/vite-iframe-script.config.ts",
"build:simulator-data": "vite build --config build/vite-build-simulation-data.config.ts",
"build:prerender": "tsx build/prerender.ts",
"build:sitemap": "tsx build/build-sitemap.ts",
"build:prerender": "ts-node-esm build/prerender.ts",
"build:sitemap": "ts-node-esm build/build-sitemap.ts",
"build:ssr": "NODE_OPTIONS='--max-old-space-size=4096'; vite build --ssr ./source/entries/entry-server.tsx --outDir ./dist/ssr --emptyOutDir && echo '{\"type\": \"module\"}' > dist/package.json",
"build:yaml-to-dts": "tsx build/build-yaml-to-dts.ts",
"build:yaml-to-dts": "ts-node-esm build/build-yaml-to-dts.ts",
"algolia:clean": "node scripts/search/clean.js",
"algolia:update": "yarn build:simulator-data && tsx ./scripts/search/update-data.ts",
"algolia:update": "yarn build:simulator-data && ts-node-esm ./scripts/search/update-data.ts",
"i18n:rules:check": "node scripts/i18n/check-missing-rule-translation.js",
"i18n:rules:translate": "node scripts/i18n/translate-rules.js",
"i18n:ui:check": "i18next -c scripts/i18n/parser.config.js && node scripts/i18n/check-missing-UI-translation.js",
@ -93,6 +93,7 @@
"redux": "^4.2.1",
"reselect": "^4.1.8",
"styled-components": "^6.0.8",
"stylis": "^4.3.0",
"whatwg-fetch": "^3.6.19"
},
"devDependencies": {
@ -130,16 +131,17 @@
"netlify-cli": "^17.10.1",
"serve-static": "^1.15.0",
"storybook": "^7.4.3",
"tinypool": "^0.8.1",
"tsx": "^4.6.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.5",
"vitest": "^0.34.4",
"workbox-expiration": "^7.0.0",
"workbox-navigation-preload": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0",
"workbox-window": "^7.0.0",
"xml2js": "^0.4.23",
"yaml": "^2.3.2"
}

View File

@ -13,16 +13,16 @@
"node": "^18"
},
"scripts": {
"extract-NAF-from-PDF": "tsx ./extract-NAF-data/convert-pdf.ts",
"extract-guichet": "tsx ./NomenclatureGuichet/extract.ts",
"fetch-nombre-etablissements": "tsx ./nombre-etablissements-par-code-ape/fetch-json.ts",
"merge-data": "tsx ./NAF-search/merge-data.ts",
"extract-NAF-from-PDF": "ts-node-esm ./extract-NAF-data/convert-pdf.ts",
"extract-guichet": "ts-node-esm ./NomenclatureGuichet/extract.ts",
"fetch-nombre-etablissements": "ts-node-esm ./nombre-etablissements-par-code-ape/fetch-json.ts",
"merge-data": "ts-node-esm ./NAF-search/merge-data.ts",
"build": "yarn extract-NAF-from-PDF && yarn extract-guichet && yarn fetch-nombre-etablissements && yarn merge-data"
},
"devDependencies": {
"csv": "^6.2.7",
"csv-parser": "^3.0.0",
"pdfdataextract": "^3.2.0",
"tsx": "^4.6.2"
"ts-node": "^10.9.1"
}
}

View File

@ -10,7 +10,6 @@
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"allowJs": true,
"allowImportingTsExtensions": true,
"isolatedModules": true,
"paths": {
"@/*": ["*"]
@ -26,7 +25,9 @@
"noEmit": true,
"strict": true
},
"ts-node": {
"transpileOnly": true
},
"include": [
"source",
"scripts",

866
yarn.lock

File diff suppressed because it is too large Load Diff