@data-fair/dev-server 2.0.23 → 2.1.0
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/config/custom-environment-variables.js +9 -0
- package/config/default.js +9 -0
- package/config/type/.type/index.d.ts +9 -0
- package/config/type/.type/validate.js +178 -19
- package/config/type/schema.js +24 -0
- package/package.json +2 -1
- package/src/app.js +7 -6
- package/src/index.js +0 -0
- package/src/ui-config.d.ts +9 -0
- package/src/ui-config.js +6 -1
- package/ui/dist/assets/index-CM7LbW6V.js +117 -0
- package/ui/dist/assets/{index-aE7lgwln.css → index-Ds-EVt1Y.css} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-DV7d8S_p.js +0 -117
package/config/default.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"use strict";
|
|
5
5
|
export const validate = validate14;
|
|
6
6
|
export default validate14;
|
|
7
|
-
const schema16 = {"$id":"https://github.com/data-fair/dev-server/config","x-exports":["types","validate"],"x-ajv":{"coerceTypes":"array"},"x-jstt":{"additionalProperties":false},"type":"object","title":"Dev server config","required":["port","dataFair","app"],"properties":{"port":{"type":"number"},"dataFair":{"type":"object","required":["url","owner"],"properties":{"url":{"type":"string"},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string"},"id":{"type":"string"},"department":{"type":"string"}}},"apiKey":{"type":"string"}}},"app":{"type":"object","required":["url","proxyPaths"],"properties":{"url":{"type":"string"},"proxyPaths":{"type":"array","items":{"type":"string"}}}},"serveUi":{"type":"boolean"}}};
|
|
7
|
+
const schema16 = {"$id":"https://github.com/data-fair/dev-server/config","x-exports":["types","validate"],"x-ajv":{"coerceTypes":"array"},"x-jstt":{"additionalProperties":false},"type":"object","title":"Dev server config","required":["port","dataFair","app"],"properties":{"port":{"type":"number"},"dataFair":{"type":"object","required":["url","owner"],"properties":{"url":{"type":"string"},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string"},"id":{"type":"string"},"department":{"type":"string"}}},"apiKey":{"type":"string"}}},"app":{"type":"object","required":["url","proxyPaths"],"properties":{"url":{"type":"string"},"proxyPaths":{"type":"array","items":{"type":"string"}}}},"site":{"type":"object","properties":{"primaryColor":{"type":"string"}}},"theme":{"type":"object","properties":{"default":{"type":"string"}}},"lang":{"type":"object","properties":{"default":{"type":"string"}}},"serveUi":{"type":"boolean"}}};
|
|
8
8
|
|
|
9
9
|
function validate14(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
|
|
10
10
|
/*# sourceURL="https://github.com/data-fair/dev-server/config" */;
|
|
@@ -487,27 +487,30 @@ vErrors.push(err20);
|
|
|
487
487
|
errors++;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
if(data.
|
|
491
|
-
let data12 = data.
|
|
492
|
-
if(typeof data12
|
|
493
|
-
|
|
490
|
+
if(data.site !== undefined){
|
|
491
|
+
let data12 = data.site;
|
|
492
|
+
if(data12 && typeof data12 == "object" && !Array.isArray(data12)){
|
|
493
|
+
if(data12.primaryColor !== undefined){
|
|
494
|
+
let data13 = data12.primaryColor;
|
|
495
|
+
if(typeof data13 !== "string"){
|
|
496
|
+
let dataType9 = typeof data13;
|
|
494
497
|
let coerced9 = undefined;
|
|
495
|
-
if(dataType9 == 'object' && Array.isArray(
|
|
496
|
-
|
|
497
|
-
dataType9 = typeof
|
|
498
|
-
if(typeof
|
|
499
|
-
coerced9 =
|
|
498
|
+
if(dataType9 == 'object' && Array.isArray(data13) && data13.length == 1){
|
|
499
|
+
data13 = data13[0];
|
|
500
|
+
dataType9 = typeof data13;
|
|
501
|
+
if(typeof data13 === "string"){
|
|
502
|
+
coerced9 = data13;
|
|
500
503
|
}
|
|
501
504
|
}
|
|
502
505
|
if(!(coerced9 !== undefined)){
|
|
503
|
-
if(
|
|
504
|
-
coerced9 =
|
|
506
|
+
if(dataType9 == "number" || dataType9 == "boolean"){
|
|
507
|
+
coerced9 = "" + data13;
|
|
505
508
|
}
|
|
506
|
-
else if(
|
|
507
|
-
coerced9 =
|
|
509
|
+
else if(data13 === null){
|
|
510
|
+
coerced9 = "";
|
|
508
511
|
}
|
|
509
512
|
else {
|
|
510
|
-
const err21 = {instancePath:instancePath+"/
|
|
513
|
+
const err21 = {instancePath:instancePath+"/site/primaryColor",schemaPath:"#/properties/site/properties/primaryColor/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
511
514
|
if(vErrors === null){
|
|
512
515
|
vErrors = [err21];
|
|
513
516
|
}
|
|
@@ -518,16 +521,16 @@ errors++;
|
|
|
518
521
|
}
|
|
519
522
|
}
|
|
520
523
|
if(coerced9 !== undefined){
|
|
521
|
-
|
|
522
|
-
if(
|
|
523
|
-
|
|
524
|
+
data13 = coerced9;
|
|
525
|
+
if(data12 !== undefined){
|
|
526
|
+
data12["primaryColor"] = coerced9;
|
|
524
527
|
}
|
|
525
528
|
}
|
|
526
529
|
}
|
|
527
530
|
}
|
|
528
531
|
}
|
|
529
532
|
else {
|
|
530
|
-
const err22 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
533
|
+
const err22 = {instancePath:instancePath+"/site",schemaPath:"#/properties/site/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
531
534
|
if(vErrors === null){
|
|
532
535
|
vErrors = [err22];
|
|
533
536
|
}
|
|
@@ -536,6 +539,162 @@ vErrors.push(err22);
|
|
|
536
539
|
}
|
|
537
540
|
errors++;
|
|
538
541
|
}
|
|
542
|
+
}
|
|
543
|
+
if(data.theme !== undefined){
|
|
544
|
+
let data14 = data.theme;
|
|
545
|
+
if(data14 && typeof data14 == "object" && !Array.isArray(data14)){
|
|
546
|
+
if(data14.default !== undefined){
|
|
547
|
+
let data15 = data14.default;
|
|
548
|
+
if(typeof data15 !== "string"){
|
|
549
|
+
let dataType10 = typeof data15;
|
|
550
|
+
let coerced10 = undefined;
|
|
551
|
+
if(dataType10 == 'object' && Array.isArray(data15) && data15.length == 1){
|
|
552
|
+
data15 = data15[0];
|
|
553
|
+
dataType10 = typeof data15;
|
|
554
|
+
if(typeof data15 === "string"){
|
|
555
|
+
coerced10 = data15;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
if(!(coerced10 !== undefined)){
|
|
559
|
+
if(dataType10 == "number" || dataType10 == "boolean"){
|
|
560
|
+
coerced10 = "" + data15;
|
|
561
|
+
}
|
|
562
|
+
else if(data15 === null){
|
|
563
|
+
coerced10 = "";
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
const err23 = {instancePath:instancePath+"/theme/default",schemaPath:"#/properties/theme/properties/default/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
567
|
+
if(vErrors === null){
|
|
568
|
+
vErrors = [err23];
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
vErrors.push(err23);
|
|
572
|
+
}
|
|
573
|
+
errors++;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if(coerced10 !== undefined){
|
|
577
|
+
data15 = coerced10;
|
|
578
|
+
if(data14 !== undefined){
|
|
579
|
+
data14["default"] = coerced10;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
const err24 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
587
|
+
if(vErrors === null){
|
|
588
|
+
vErrors = [err24];
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
vErrors.push(err24);
|
|
592
|
+
}
|
|
593
|
+
errors++;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if(data.lang !== undefined){
|
|
597
|
+
let data16 = data.lang;
|
|
598
|
+
if(data16 && typeof data16 == "object" && !Array.isArray(data16)){
|
|
599
|
+
if(data16.default !== undefined){
|
|
600
|
+
let data17 = data16.default;
|
|
601
|
+
if(typeof data17 !== "string"){
|
|
602
|
+
let dataType11 = typeof data17;
|
|
603
|
+
let coerced11 = undefined;
|
|
604
|
+
if(dataType11 == 'object' && Array.isArray(data17) && data17.length == 1){
|
|
605
|
+
data17 = data17[0];
|
|
606
|
+
dataType11 = typeof data17;
|
|
607
|
+
if(typeof data17 === "string"){
|
|
608
|
+
coerced11 = data17;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if(!(coerced11 !== undefined)){
|
|
612
|
+
if(dataType11 == "number" || dataType11 == "boolean"){
|
|
613
|
+
coerced11 = "" + data17;
|
|
614
|
+
}
|
|
615
|
+
else if(data17 === null){
|
|
616
|
+
coerced11 = "";
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
const err25 = {instancePath:instancePath+"/lang/default",schemaPath:"#/properties/lang/properties/default/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
620
|
+
if(vErrors === null){
|
|
621
|
+
vErrors = [err25];
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
vErrors.push(err25);
|
|
625
|
+
}
|
|
626
|
+
errors++;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if(coerced11 !== undefined){
|
|
630
|
+
data17 = coerced11;
|
|
631
|
+
if(data16 !== undefined){
|
|
632
|
+
data16["default"] = coerced11;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
const err26 = {instancePath:instancePath+"/lang",schemaPath:"#/properties/lang/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
640
|
+
if(vErrors === null){
|
|
641
|
+
vErrors = [err26];
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
vErrors.push(err26);
|
|
645
|
+
}
|
|
646
|
+
errors++;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if(data.serveUi !== undefined){
|
|
650
|
+
let data18 = data.serveUi;
|
|
651
|
+
if(typeof data18 !== "boolean"){
|
|
652
|
+
let dataType12 = typeof data18;
|
|
653
|
+
let coerced12 = undefined;
|
|
654
|
+
if(dataType12 == 'object' && Array.isArray(data18) && data18.length == 1){
|
|
655
|
+
data18 = data18[0];
|
|
656
|
+
dataType12 = typeof data18;
|
|
657
|
+
if(typeof data18 === "boolean"){
|
|
658
|
+
coerced12 = data18;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if(!(coerced12 !== undefined)){
|
|
662
|
+
if(data18 === "false" || data18 === 0 || data18 === null){
|
|
663
|
+
coerced12 = false;
|
|
664
|
+
}
|
|
665
|
+
else if(data18 === "true" || data18 === 1){
|
|
666
|
+
coerced12 = true;
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
const err27 = {instancePath:instancePath+"/serveUi",schemaPath:"#/properties/serveUi/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
|
|
670
|
+
if(vErrors === null){
|
|
671
|
+
vErrors = [err27];
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
vErrors.push(err27);
|
|
675
|
+
}
|
|
676
|
+
errors++;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if(coerced12 !== undefined){
|
|
680
|
+
data18 = coerced12;
|
|
681
|
+
if(data !== undefined){
|
|
682
|
+
data["serveUi"] = coerced12;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
const err28 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
690
|
+
if(vErrors === null){
|
|
691
|
+
vErrors = [err28];
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
vErrors.push(err28);
|
|
695
|
+
}
|
|
696
|
+
errors++;
|
|
697
|
+
}
|
|
539
698
|
validate14.errors = vErrors;
|
|
540
699
|
return errors === 0;
|
|
541
700
|
}
|
package/config/type/schema.js
CHANGED
|
@@ -63,6 +63,30 @@ export default {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
+
site: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
primaryColor: {
|
|
70
|
+
type: 'string'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
theme: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {
|
|
77
|
+
default: {
|
|
78
|
+
type: 'string'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
lang: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: {
|
|
85
|
+
default: {
|
|
86
|
+
type: 'string'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
66
90
|
serveUi: {
|
|
67
91
|
type: 'boolean'
|
|
68
92
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@data-fair/dev-server",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A development server for optimal development experience of data-fair applications.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dev": "NODE_ENV=development node --watch src/index.js",
|
|
14
14
|
"dev-test-app-minimal": "http-server test-apps/minimal --port=3000 --cors --silent",
|
|
15
15
|
"dev-test-app-vue3": "cd test-apps/vue3 && npm run dev",
|
|
16
|
+
"dev-test-app-modern": "cd test-apps/modern && npm run dev",
|
|
16
17
|
"dev-zellij": "zellij --layout .zellij.kdl",
|
|
17
18
|
"prepublishOnly": "npm run lint && npm run build && npm -w ui run build",
|
|
18
19
|
"lint": "eslint . && npm -w ui run lint",
|
package/src/app.js
CHANGED
|
@@ -183,12 +183,13 @@ app.use('/app', createProxyMiddleware({
|
|
|
183
183
|
meta[name] = content;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
// companion script that lets the embedded app report its height / sync params
|
|
187
|
+
// to the parent <d-frame> ; injected for every mode so the UI mode toggle works
|
|
188
|
+
// without requiring a df:overflow meta (same variant & version as data-fair prod)
|
|
189
|
+
bodyNode.childNodes.push(createElement('script', {
|
|
190
|
+
type: 'text/javascript',
|
|
191
|
+
src: 'https://cdn.jsdelivr.net/npm/@data-fair/frame@0.18/dist/v-iframe-compat/d-frame-content.min.js'
|
|
192
|
+
}));
|
|
192
193
|
output = parse5.serialize(document);
|
|
193
194
|
// proxyRes.headers['content-length'] = output.length
|
|
194
195
|
delete proxyRes.headers['content-length'];
|
package/src/index.js
CHANGED
|
File without changes
|
package/src/ui-config.d.ts
CHANGED
|
@@ -8,6 +8,15 @@ export declare const uiConfig: {
|
|
|
8
8
|
};
|
|
9
9
|
apiKey?: string;
|
|
10
10
|
};
|
|
11
|
+
site: {
|
|
12
|
+
primaryColor?: string;
|
|
13
|
+
} | undefined;
|
|
14
|
+
theme: {
|
|
15
|
+
default?: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
lang: {
|
|
18
|
+
default?: string;
|
|
19
|
+
} | undefined;
|
|
11
20
|
};
|
|
12
21
|
export type UiConfig = typeof uiConfig;
|
|
13
22
|
export default uiConfig;
|
package/src/ui-config.js
CHANGED