@inseefr/lunatic 2.7.0-rc.3 → 2.7.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "2.7.0-rc.
|
|
3
|
+
"version": "2.7.0-rc.5",
|
|
4
4
|
"workersVersion": "0.3.0-experimental",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"scripts/build/workers-paths.js"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"test:e2e": "playwright test",
|
|
36
|
-
"test:e2e:visual": "playwright test --headed --debug e2e/pairwise.spec.ts",
|
|
37
|
-
"test:e2e:codegen": "playwright codegen http://localhost:9999/iframe.html?viewMode=story&id=",
|
|
38
|
-
"test:storybook": "test-storybook --url http://localhost:9999 --maxWorkers=4 --no-cache",
|
|
34
|
+
"test": "npm run prepare-workers && vitest run",
|
|
35
|
+
"test:e2e": "npm run prepare-workers && playwright test",
|
|
36
|
+
"test:e2e:visual": "npm run prepare-workers && playwright test --headed --debug e2e/pairwise.spec.ts",
|
|
37
|
+
"test:e2e:codegen": "npm run prepare-workers && playwright codegen http://localhost:9999/iframe.html?viewMode=story&id=",
|
|
38
|
+
"test:storybook": "npm run prepare-workers && test-storybook --url http://localhost:9999 --maxWorkers=4 --no-cache",
|
|
39
39
|
"test-watch": "vitest",
|
|
40
40
|
"check": "tsc",
|
|
41
41
|
"lint": "eslint ./src",
|
|
@@ -45,14 +45,13 @@
|
|
|
45
45
|
"format:check": "npm run _format -- --list-different",
|
|
46
46
|
"test-coverage": "vitest run --coverage",
|
|
47
47
|
"build-workers": "node ./scripts/build/build-workers.js",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"storybook": "
|
|
52
|
-
"build-storybook": "storybook build"
|
|
48
|
+
"prepare-workers": "npm run build-workers && node ./scripts/build/add-workers-to-public.js",
|
|
49
|
+
"build": "babel src --out-dir lib --extensions \".ts,.js,.tsx,.jsx\" --copy-files && tsc --project tsconfig.prod.json && npm run build-workers",
|
|
50
|
+
"storybook": "npm run prepare-workers && storybook dev -p 9999 --no-open",
|
|
51
|
+
"build-storybook": "npm run prepare-workers && storybook build"
|
|
53
52
|
},
|
|
54
53
|
"bin": {
|
|
55
|
-
"add-lunatic-
|
|
54
|
+
"add-lunatic-workes": "./scripts/build/add-workers-to-public.js"
|
|
56
55
|
},
|
|
57
56
|
"keywords": [
|
|
58
57
|
"react",
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const fs = require('fs');
|
|
3
|
-
const {
|
|
3
|
+
const { currentPublicFolder, workersPath } = require('./workers-paths');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Copy worker only if not exists
|
|
7
7
|
*/
|
|
8
8
|
const copyWorkerToPublicFolder = () => {
|
|
9
|
-
if (!fs.existsSync(
|
|
10
|
-
fs.mkdirSync(
|
|
9
|
+
if (!fs.existsSync(currentPublicFolder)) {
|
|
10
|
+
fs.mkdirSync(currentPublicFolder, { recursive: true });
|
|
11
11
|
}
|
|
12
12
|
const isAppendWorkerExists = fs.existsSync(workersPath.append.dest);
|
|
13
13
|
const isLabelWorkerExists = fs.existsSync(workersPath.label.dest);
|
|
14
14
|
const isSearchingWorkerExists = fs.existsSync(workersPath.searching.dest);
|
|
15
15
|
|
|
16
16
|
if (!isAppendWorkerExists) {
|
|
17
|
+
console.log(`Copy : ${workersPath.append.name} to ${currentPublicFolder}`);
|
|
17
18
|
fs.copyFileSync(workersPath.append.source, workersPath.append.dest);
|
|
19
|
+
} else {
|
|
20
|
+
console.log(
|
|
21
|
+
`${workersPath.append.name} is already in ${currentPublicFolder} -> Skipped`
|
|
22
|
+
);
|
|
18
23
|
}
|
|
19
24
|
if (!isLabelWorkerExists) {
|
|
25
|
+
console.log(`Copy : ${workersPath.label.name} to ${currentPublicFolder}`);
|
|
20
26
|
fs.copyFileSync(workersPath.label.source, workersPath.label.dest);
|
|
27
|
+
} else {
|
|
28
|
+
console.log(
|
|
29
|
+
`${workersPath.label.name} is already in ${currentPublicFolder} -> Skipped`
|
|
30
|
+
);
|
|
21
31
|
}
|
|
22
32
|
if (!isSearchingWorkerExists) {
|
|
33
|
+
console.log(
|
|
34
|
+
`Copy : ${workersPath.searching.name} to ${currentPublicFolder}`
|
|
35
|
+
);
|
|
23
36
|
fs.copyFileSync(workersPath.searching.source, workersPath.searching.dest);
|
|
37
|
+
} else {
|
|
38
|
+
console.log(
|
|
39
|
+
`${workersPath.searching.name} is already in ${currentPublicFolder} -> Skipped`
|
|
40
|
+
);
|
|
24
41
|
}
|
|
25
42
|
};
|
|
26
43
|
|
|
@@ -4,27 +4,24 @@ const path = require('path');
|
|
|
4
4
|
var version = PACKAGE.workersVersion;
|
|
5
5
|
|
|
6
6
|
const currentPublicFolder = path.resolve(`${process.cwd()}/public/workers`);
|
|
7
|
-
const
|
|
8
|
-
__dirname,
|
|
9
|
-
'../../workers-release'
|
|
10
|
-
);
|
|
7
|
+
const workersReleaseFolder = path.resolve(__dirname, '../../workers-release');
|
|
11
8
|
|
|
12
9
|
const workersPath = {
|
|
13
10
|
append: {
|
|
14
11
|
name: 'Append worker',
|
|
15
|
-
source: `${
|
|
12
|
+
source: `${workersReleaseFolder}/lunatic-append-worker-${version}.js`,
|
|
16
13
|
dest: `${currentPublicFolder}/lunatic-append-worker-${version}.js`,
|
|
17
14
|
webpack: `${path.resolve(__dirname)}/webpack-append-worker.config.js`,
|
|
18
15
|
},
|
|
19
16
|
label: {
|
|
20
17
|
name: 'Label worker',
|
|
21
|
-
source: `${
|
|
18
|
+
source: `${workersReleaseFolder}/lunatic-label-worker-${version}.js`,
|
|
22
19
|
dest: `${currentPublicFolder}/lunatic-label-worker-${version}.js`,
|
|
23
20
|
webpack: `${path.resolve(__dirname)}/webpack-label-worker.config.js`,
|
|
24
21
|
},
|
|
25
22
|
searching: {
|
|
26
23
|
name: 'Searching worker',
|
|
27
|
-
source: `${
|
|
24
|
+
source: `${workersReleaseFolder}/lunatic-searching-worker-${version}.js`,
|
|
28
25
|
dest: `${currentPublicFolder}/lunatic-searching-worker-${version}.js`,
|
|
29
26
|
webpack: `${path.resolve(__dirname)}/webpack-searching-worker.config.js`,
|
|
30
27
|
},
|
|
@@ -32,6 +29,6 @@ const workersPath = {
|
|
|
32
29
|
|
|
33
30
|
module.exports = {
|
|
34
31
|
currentPublicFolder: currentPublicFolder,
|
|
35
|
-
|
|
32
|
+
workersReleaseFolder: workersReleaseFolder,
|
|
36
33
|
workersPath: workersPath,
|
|
37
34
|
};
|