Commit 208f7d79 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Use Svelte Kit package instead of dist.

parent 5dcb04a8
......@@ -4,7 +4,6 @@ node_modules
!/example.env
/.svelte-kit
/build/
/dist/
/package/
static/img_old/
data_catalogue_2021-02-07.sql
......
.svelte-kit/**
build/**
dist/**
node_modules/**
package/**
static/**
......@@ -64,7 +64,7 @@ npm run configure
### Updating database when drop-box directory change
```bash
node --experimental-specifier-resolution=node -- dist/scripts/update_ddis_on_directory_changes.mjs --output ../public_data/ --verbose adisp
node --experimental-specifier-resolution=node -- package/scripts/update_ddis_on_directory_changes.js --output ../public_data/ --verbose adisp
```
### Fetching DDI Files
......@@ -73,40 +73,40 @@ node --experimental-specifier-resolution=node -- dist/scripts/update_ddis_on_dir
```bash
# ADISP (OAI-PMH): Contains every french DDIs
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_oai-pmh_ddis.mjs --url http://www.progedo-adisp.fr/oai/oai2.php ../public_data/adisp-oai-pmh-ddi/
node --experimental-specifier-resolution=node -- package/scripts/retrieve_oai-pmh_ddis.js --url http://www.progedo-adisp.fr/oai/oai2.php ../public_data/adisp-oai-pmh-ddi/
```
#### Fetching DDI Files from Dataverse Servers
```bash
# data.sciencespo
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_dataverse_ddis.mjs --tree cdsp --url https://data.sciencespo.fr/ --verbose ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- package/scripts/retrieve_dataverse_ddis.js --tree cdsp --url https://data.sciencespo.fr/ --verbose ../public_data/sciencespo-dataverse-ddi/
```
#### Fetching DDI Files from Nesstar Servers
```bash
# ADISP (public Nesstar) : Contains some French & English DDIs
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.progedo-adisp.fr/ ../public_data/adisp-nesstar-ddi/
node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://nesstar.progedo-adisp.fr/ ../public_data/adisp-nesstar-ddi/
# CDSP Sciences Po (obsolete & closed)
# node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.sciences-po.fr/ ../public_data/cdsp-nesstar-ddi/
# node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://nesstar.sciences-po.fr/ ../public_data/cdsp-nesstar-ddi/
# INED
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.ined.fr/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://nesstar.ined.fr/ ../public_data/ined-nesstar-ddi/
# INED - Generations and Gender Survey
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://ggpsurvey.ined.fr/ ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://ggpsurvey.ined.fr/ ../public_data/ined-gpgsurvey-nesstar-ddi/
# UK Data Service
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.ukdataservice.ac.uk/ ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://nesstar.ukdataservice.ac.uk/ ../public_data/ukdataservice-nesstar-ddi/
# Norwegian Centre for Research Data
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nsddata.nsd.uib.no ../public_data/nsddata-nesstar-ddi/
node --experimental-specifier-resolution=node package/scripts/retrieve_nesstar_ddis.js --url http://nsddata.nsd.uib.no ../public_data/nsddata-nesstar-ddi/
```
### Repairing DDI Files
```bash
# ADISP
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_oai-pmh_ddis.mjs --source=../public_data/adisp-oai-pmh-ddi/ ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_nesstar_ddis.mjs --source=../public_data/adisp-nesstar-ddi/ ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_ined_nesstar_ddis.mjs --source=../public_data/ined-nesstar-ddi/ ../public_data/ined-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node package/scripts/repair_adisp_oai-pmh_ddis.js --source=../public_data/adisp-oai-pmh-ddi/ ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node package/scripts/repair_adisp_nesstar_ddis.js --source=../public_data/adisp-nesstar-ddi/ ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node package/scripts/repair_ined_nesstar_ddis.js --source=../public_data/ined-nesstar-ddi/ ../public_data/ined-nesstar-ddi-repaired/
```
### Indexing DDI files
......@@ -114,29 +114,29 @@ node --experimental-specifier-resolution=node dist/scripts/repair_ined_nesstar_d
#### Indexing Progedo DDI Files
```bash
# node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=adisp ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=adisp ../public_data/adisp-ddis-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=ined ../public_data/ined-nesstar-ddi-repaired/
# node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=adisp ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=adisp ../public_data/adisp-ddis-repaired/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=ined ../public_data/ined-nesstar-ddi-repaired/
```
#### Indexing Other (non Progedo-related) DDI Files
```bash
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=adisp-nesstar ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=adisp-nesstar ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
# Obsolete
# node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp-obsolete ../public_data/cdsp-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=ined/gpgsurvey ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=en --path=ukdataservice ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=no --path=nsddata ../public_data/nsddata-nesstar-ddi/
# node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=cdsp-obsolete ../public_data/cdsp-nesstar-ddi/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=fr --path=ined/gpgsurvey ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=en --path=ukdataservice ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node -- package/scripts/index_codebooks.js --language=no --path=nsddata ../public_data/nsddata-nesstar-ddi/
```
### Extracting Words from CodeBooks for Autocompletion
```bash
node --experimental-specifier-resolution=node -- dist/scripts/index_words.mjs
node --experimental-specifier-resolution=node -- package/scripts/index_words.js
```
## Development
......@@ -146,11 +146,11 @@ node --experimental-specifier-resolution=node -- dist/scripts/index_words.mjs
#### Extracting TypeScript Raw Types from Progedo DDI Files
```bash
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.2.2
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.3
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=2.5
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.2.2
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.3
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=2.5
# Prettify generated TypeScript file:
npm run prettier
......@@ -159,10 +159,10 @@ npm run prettier
#### Extracting TypeScript Raw Types for Other Tests
```bash
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-manual-ddi/ --target=src/raw_types/codebooks_adisp_manual.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-nesstar-ddi/ --target=src/raw_types/codebooks_adisp_nesstar.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/sciencespo-dataverse-ddi/ --target=src/raw_types/codebooks_sciencespo_dataverse.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/ined-nesstar-ddi/ --target=src/raw_types/codebooks_ined_nesstar.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-manual-ddi/ --target=src/raw_types/codebooks_adisp_manual.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- package/scripts/raw_types_from_ddi_files.js ../public_data/adisp-nesstar-ddi/ --target=src/raw_types/codebooks_adisp_nesstar.ts
node --experimental-specifier-resolution=node -- package/scripts/raw_types_from_ddi_files.js ../public_data/sciencespo-dataverse-ddi/ --target=src/raw_types/codebooks_sciencespo_dataverse.ts
node --experimental-specifier-resolution=node -- package/scripts/raw_types_from_ddi_files.js ../public_data/ined-nesstar-ddi/ --target=src/raw_types/codebooks_ined_nesstar.ts
# Prettify generated TypeScript files:
npm run prettier
......
......@@ -68,6 +68,7 @@
"svelte-json-tree": "github:eraviart/svelte-json-tree",
"svelte-preprocess": "^4.7.1",
"svelte-range-slider-pips": "github:eraviart/svelte-range-slider-pips",
"svelte2tsx": "^0.5.6",
"tailwindcss": "^3.0.5",
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
......@@ -3505,6 +3506,15 @@
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/lower-case": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
"integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
"dev": true,
"dependencies": {
"tslib": "^2.0.3"
}
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
......@@ -4231,6 +4241,16 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node_modules/no-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
"integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
"dev": true,
"dependencies": {
"lower-case": "^2.0.2",
"tslib": "^2.0.3"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
......@@ -4464,6 +4484,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/pascal-case": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
"integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==",
"dev": true,
"dependencies": {
"no-case": "^3.0.4",
"tslib": "^2.0.3"
}
},
"node_modules/patch-package": {
"version": "6.4.7",
"resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.4.7.tgz",
......@@ -5905,6 +5935,20 @@
"dev": true,
"license": "MPL-2.0"
},
"node_modules/svelte2tsx": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.5.6.tgz",
"integrity": "sha512-B4WZUtoTdVD+F73H1RQEH3Hrv7m2/ahThmAUkjT5CTWRigQaJqYQpSjisCH1Pzfi9B37YikDnAi4u4uxwYM+iw==",
"dev": true,
"dependencies": {
"dedent-js": "^1.0.1",
"pascal-case": "^3.1.1"
},
"peerDependencies": {
"svelte": "^3.24",
"typescript": "^4.1.2"
}
},
"node_modules/tailwindcss": {
"version": "3.0.23",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.23.tgz",
......@@ -8943,6 +8987,15 @@
"integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==",
"dev": true
},
"lower-case": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
"integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
"dev": true,
"requires": {
"tslib": "^2.0.3"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
......@@ -9400,6 +9453,16 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"no-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
"integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
"dev": true,
"requires": {
"lower-case": "^2.0.2",
"tslib": "^2.0.3"
}
},
"node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
......@@ -9558,6 +9621,16 @@
"lines-and-columns": "^1.1.6"
}
},
"pascal-case": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
"integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==",
"dev": true,
"requires": {
"no-case": "^3.0.4",
"tslib": "^2.0.3"
}
},
"patch-package": {
"version": "6.4.7",
"resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.4.7.tgz",
......@@ -10587,6 +10660,16 @@
"dev": true,
"from": "svelte-range-slider-pips@github:eraviart/svelte-range-slider-pips"
},
"svelte2tsx": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.5.6.tgz",
"integrity": "sha512-B4WZUtoTdVD+F73H1RQEH3Hrv7m2/ahThmAUkjT5CTWRigQaJqYQpSjisCH1Pzfi9B37YikDnAi4u4uxwYM+iw==",
"dev": true,
"requires": {
"dedent-js": "^1.0.1",
"pascal-case": "^3.1.1"
}
},
"tailwindcss": {
"version": "3.0.23",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.23.tgz",
......
......@@ -12,16 +12,13 @@
"build": "svelte-kit build",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"configure": "node --experimental-specifier-resolution=node dist/scripts/configure.mjs",
"configure": "node --experimental-specifier-resolution=node package/scripts/configure.js",
"dev": "svelte-kit dev",
"dist": "npm run dist:lib && npm run dist:tsc ; npm run dist:mjs ; npm run dist:mjs-map",
"dist:lib": "mkdir -p node_modules && cd node_modules/ && rm -f '$lib' && ln -s ../dist/lib/ '$lib'",
"dist:tsc": "tsc --declaration --outDir dist --rootDir src",
"dist:mjs": "find dist/ -name \"*.js\" -exec bash -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;",
"dist:mjs-map": "find dist/ -name \"*.js.map\" -exec bash -c 'mv \"$1\" \"${1%.js.map}\".mjs.map' - '{}' \\;",
"format": "prettier --write --plugin-search-dir=. .",
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"package": "svelte-kit package",
"postinstall": "patch-package",
"prepare": "svelte-kit sync",
"preview": "svelte-kit preview"
},
"dependencies": {
......@@ -83,6 +80,7 @@
"svelte-json-tree": "github:eraviart/svelte-json-tree",
"svelte-preprocess": "^4.7.1",
"svelte-range-slider-pips": "github:eraviart/svelte-range-slider-pips",
"svelte2tsx": "^0.5.6",
"tailwindcss": "^3.0.5",
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
......
......@@ -279,7 +279,7 @@ async function repairAndIndexDdi(
)
await fs.ensureDir(repairedDir)
const repairOutput = await nothrow(
$`node --experimental-specifier-resolution=node dist/scripts/repair_adisp_oai-pmh_ddis.mjs --filename=${filename} --source=${sourceDir} ${repairedDir}`,
$`node --experimental-specifier-resolution=node package/scripts/repair_adisp_oai-pmh_ddis.js --filename=${filename} --source=${sourceDir} ${repairedDir}`,
)
if (repairOutput.exitCode === 0) {
// DDI XML is valid (and repaired).
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment