diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f301e6..bee0738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.3.6] - 2024-02-08 +## [1.3.7] - 2024-02-08 ### Fixed diff --git a/package.json b/package.json index 42c12b1..c4e6765 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "flytax", - "version": "1.3.6", - "patchVersion": "b", + "version": "1.3.7", "type": "module", "scripts": { "build": "rollup -c", diff --git a/rollup.config.js b/rollup.config.js index 7529e15..0126021 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,7 +9,7 @@ import copy from 'rollup-plugin-copy'; import replace from '@rollup/plugin-replace'; const {markdown} = require('svelte-preprocess-markdown'); const workbox = require('rollup-plugin-workbox-inject'); -import {version, patchVersion} from './package.json'; +import {version} from './package.json'; import watchAssets from 'rollup-plugin-watch-assets'; import html from '@open-wc/rollup-plugin-html'; import {DATASET} from './src/stores'; @@ -27,7 +27,6 @@ const relPath = (url) => url.replace('./', './public/'); // public path for a lo const U = { 'APP_VERSION': version, - 'PATCH_VERSION': patchVersion, 'process.env.NODE_ENV': (production) ? JSON.stringify('production') : JSON.stringify('development'), 'CONF_PDFJS_WORKER_JS': 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js', 'CONF_PDFJS_JS': 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js', diff --git a/scripts/makeData.js b/scripts/makeData.js index 736c94a..5be35de 100644 --- a/scripts/makeData.js +++ b/scripts/makeData.js @@ -29,15 +29,13 @@ import fs from 'fs'; import got from 'got'; import iconv from 'iconv-lite'; -//ugly -const patchVersion = JSON.parse(fs.readFileSync('package.json', 'utf8')).patchVersion; - const scriptArgs = process.argv.slice(2); const year = (scriptArgs.length === 1) ? scriptArgs[0] : new Date().getFullYear().toString(); const isoStart = `${year}-01-01`; const isoEnd = `${year}-12-31`; const monthsfr = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']; const dataPath = `./data/data${year}.json`; + const csvPath = `./data/flytax-baremes${year}.csv`; const WebpaysURL = "https://www.economie.gouv.fr/dgfip/fichiers_taux_chancellerie/txt/Webpays"; const WebmissURL = "https://www.economie.gouv.fr/dgfip/fichiers_taux_chancellerie/txt/Webmiss"; @@ -328,6 +326,10 @@ const save = (data) => { log(`Saved ${dataPath}`, "green"); } }); + let patchVersion = ''; + if (year === "2023") { + patchVersion = 'b'; //also edit stores.js + } if (patchVersion) { const dataPathPatched = dataPath.replace('.json', `${patchVersion}.json`); fs.writeFile(dataPathPatched, JSON.stringify(data), (err) => { diff --git a/src/stores.js b/src/stores.js index 8042291..1c8b271 100644 --- a/src/stores.js +++ b/src/stores.js @@ -7,10 +7,10 @@ export const BASES = [ {label: "Paris", selected: true, value: ['CDG', 'ORY'], tzConverter: iso2FR}, {label: "Toulouse", selected: false, value: ['TLS'], tzConverter: iso2FR} ].sort((a, b) => (a.label.localeCompare(b.label))); -const patchVersion = "PATCH_VERSION"; + export const DATASET = [ - {label: "2024", selected: false, url: `./data/data2023${patchVersion}.json`}, - {label: "2023", selected: true, url: `./data/data2023${patchVersion}.json`}, + {label: "2024", selected: false, url: `./data/data2023b.json`}, + {label: "2023", selected: true, url: `./data/data2023b.json`}, // see save method in makeData {label: "2022", selected: false, url: "./data/data2022.json"}, {label: "2021", selected: false, url: "./data/data2021.json"}, {label: "2020", selected: false, url: "./data/data2020.json"}, diff --git a/src/sw.js b/src/sw.js index 9c34367..5e96286 100644 --- a/src/sw.js +++ b/src/sw.js @@ -41,7 +41,7 @@ registerRoute( }) ); registerRoute( - ({ url }) => url.pathname.match(/\/data\/data[0-9]{4}\.json/), + ({ url }) => url.pathname.match(/\/data\/data[0-9]{4}.?\.json/), new CacheFirst({ cacheName: dataCacheName, plugins: [