@learncard/dynamic-loader-plugin 1.0.51 → 1.1.1
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/dist/dynamic-loader-plugin.cjs.development.js +8 -8
- package/dist/dynamic-loader-plugin.cjs.development.js.map +1 -1
- package/dist/dynamic-loader-plugin.cjs.production.min.js +1 -1
- package/dist/dynamic-loader-plugin.cjs.production.min.js.map +2 -2
- package/dist/dynamic-loader-plugin.esm.js +7 -5
- package/dist/dynamic-loader-plugin.esm.js.map +1 -1
- package/package.json +6 -6
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -18,28 +19,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
20
|
|
|
20
21
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
23
24
|
DynamicLoaderPlugin: () => DynamicLoaderPlugin
|
|
24
25
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
27
|
var DynamicLoaderPlugin = {
|
|
27
28
|
name: "Dynamic Loader",
|
|
28
29
|
displayName: "Dynamic Loader",
|
|
29
30
|
description: "Resolve JSON-LD Contexts dynamically via fetch",
|
|
30
31
|
context: {
|
|
31
|
-
resolveStaticDocument: async () => void 0,
|
|
32
|
-
resolveRemoteDocument: async (_learnCard, uri) => {
|
|
32
|
+
resolveStaticDocument: /* @__PURE__ */ __name(async () => void 0, "resolveStaticDocument"),
|
|
33
|
+
resolveRemoteDocument: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
33
34
|
try {
|
|
34
35
|
const response = await fetch(uri);
|
|
35
|
-
if (response.status !== 200)
|
|
36
|
-
throw new Error("Status Code not 200!");
|
|
36
|
+
if (response.status !== 200) throw new Error("Status Code not 200!");
|
|
37
37
|
return await response.json();
|
|
38
38
|
} catch (error) {
|
|
39
39
|
_learnCard.debug?.("Error fetching remote context!", error);
|
|
40
40
|
return void 0;
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}, "resolveRemoteDocument")
|
|
43
43
|
},
|
|
44
44
|
methods: {}
|
|
45
45
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { DynamicLoaderPluginType } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const DynamicLoaderPlugin: DynamicLoaderPluginType = {\n name: 'Dynamic Loader',\n displayName: 'Dynamic Loader',\n description: 'Resolve JSON-LD Contexts dynamically via fetch',\n context: {\n resolveStaticDocument: async () => undefined,\n resolveRemoteDocument: async (_learnCard, uri) => {\n try {\n const response = await fetch(uri);\n\n if (response.status !== 200) throw new Error('Status Code not 200!');\n\n return await response.json();\n } catch (error) {\n _learnCard.debug?.('Error fetching remote context!', error);\n\n return undefined;\n }\n },\n },\n methods: {},\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAM,sBAA+C;AAAA,EACxD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,uBAAuB,mCAAY,QAAZ;AAAA,IACvB,uBAAuB,8BAAO,YAAY,QAAQ;AAC9C,UAAI;AACA,cAAM,WAAW,MAAM,MAAM,GAAG;AAEhC,YAAI,SAAS,WAAW,IAAK,OAAM,IAAI,MAAM,sBAAsB;AAEnE,eAAO,MAAM,SAAS,KAAK;AAAA,MAC/B,SAAS,OAAO;AACZ,mBAAW,QAAQ,kCAAkC,KAAK;AAE1D,eAAO;AAAA,MACX;AAAA,IACJ,GAZuB;AAAA,EAa3B;AAAA,EACA,SAAS,CAAC;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var a=(t,e)=>r(t,"name",{value:e,configurable:!0});var d=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},y=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!m.call(t,n)&&n!==o&&r(t,n,{get:()=>e[n],enumerable:!(c=i(e,n))||c.enumerable});return t};var u=t=>y(r({},"__esModule",{value:!0}),t);var f={};d(f,{DynamicLoaderPlugin:()=>l});module.exports=u(f);var l={name:"Dynamic Loader",displayName:"Dynamic Loader",description:"Resolve JSON-LD Contexts dynamically via fetch",context:{resolveStaticDocument:a(async()=>{},"resolveStaticDocument"),resolveRemoteDocument:a(async(t,e)=>{try{let o=await fetch(e);if(o.status!==200)throw new Error("Status Code not 200!");return await o.json()}catch(o){t.debug?.("Error fetching remote context!",o);return}},"resolveRemoteDocument")},methods:{}};
|
|
2
2
|
//# sourceMappingURL=dynamic-loader-plugin.cjs.production.min.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { DynamicLoaderPluginType } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const DynamicLoaderPlugin: DynamicLoaderPluginType = {\n name: 'Dynamic Loader',\n displayName: 'Dynamic Loader',\n description: 'Resolve JSON-LD Contexts dynamically via fetch',\n context: {\n resolveStaticDocument: async () => undefined,\n resolveRemoteDocument: async (_learnCard, uri) => {\n try {\n const response = await fetch(uri);\n\n if (response.status !== 200) throw new Error('Status Code not 200!');\n\n return await response.json();\n } catch (error) {\n _learnCard.debug?.('Error fetching remote context!', error);\n\n return undefined;\n }\n },\n },\n methods: {},\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAOO,IAAMI,EAA+C,CACxD,KAAM,iBACN,YAAa,iBACb,YAAa,iDACb,QAAS,CACL,sBAAuBC,EAAA,SAAS,GAAT,yBACvB,sBAAuBA,EAAA,MAAOC,EAAYC,IAAQ,CAC9C,GAAI,CACA,IAAMC,EAAW,MAAM,MAAMD,CAAG,EAEhC,GAAIC,EAAS,SAAW,IAAK,MAAM,IAAI,MAAM,sBAAsB,EAEnE,OAAO,MAAMA,EAAS,KAAK,CAC/B,OAASC,EAAO,CACZH,EAAW,QAAQ,iCAAkCG,CAAK,EAE1D,MACJ,CACJ,EAZuB,wBAa3B,EACA,QAAS,CAAC,CACd",
|
|
6
|
+
"names": ["index_exports", "__export", "DynamicLoaderPlugin", "__toCommonJS", "DynamicLoaderPlugin", "__name", "_learnCard", "uri", "response", "error"]
|
|
7
7
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/index.ts
|
|
2
5
|
var DynamicLoaderPlugin = {
|
|
3
6
|
name: "Dynamic Loader",
|
|
4
7
|
displayName: "Dynamic Loader",
|
|
5
8
|
description: "Resolve JSON-LD Contexts dynamically via fetch",
|
|
6
9
|
context: {
|
|
7
|
-
resolveStaticDocument: async () => void 0,
|
|
8
|
-
resolveRemoteDocument: async (_learnCard, uri) => {
|
|
10
|
+
resolveStaticDocument: /* @__PURE__ */ __name(async () => void 0, "resolveStaticDocument"),
|
|
11
|
+
resolveRemoteDocument: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
9
12
|
try {
|
|
10
13
|
const response = await fetch(uri);
|
|
11
|
-
if (response.status !== 200)
|
|
12
|
-
throw new Error("Status Code not 200!");
|
|
14
|
+
if (response.status !== 200) throw new Error("Status Code not 200!");
|
|
13
15
|
return await response.json();
|
|
14
16
|
} catch (error) {
|
|
15
17
|
_learnCard.debug?.("Error fetching remote context!", error);
|
|
16
18
|
return void 0;
|
|
17
19
|
}
|
|
18
|
-
}
|
|
20
|
+
}, "resolveRemoteDocument")
|
|
19
21
|
},
|
|
20
22
|
methods: {}
|
|
21
23
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { DynamicLoaderPluginType } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const DynamicLoaderPlugin: DynamicLoaderPluginType = {\n name: 'Dynamic Loader',\n displayName: 'Dynamic Loader',\n description: 'Resolve JSON-LD Contexts dynamically via fetch',\n context: {\n resolveStaticDocument: async () => undefined,\n resolveRemoteDocument: async (_learnCard, uri) => {\n try {\n const response = await fetch(uri);\n\n if (response.status !== 200) throw new Error('Status Code not 200!');\n\n return await response.json();\n } catch (error) {\n _learnCard.debug?.('Error fetching remote context!', error);\n\n return undefined;\n }\n },\n },\n methods: {},\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;AAOO,IAAM,sBAA+C;AAAA,EACxD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,uBAAuB,mCAAY,QAAZ;AAAA,IACvB,uBAAuB,8BAAO,YAAY,QAAQ;AAC9C,UAAI;AACA,cAAM,WAAW,MAAM,MAAM,GAAG;AAEhC,YAAI,SAAS,WAAW,IAAK,OAAM,IAAI,MAAM,sBAAsB;AAEnE,eAAO,MAAM,SAAS,KAAK;AAAA,MAC/B,SAAS,OAAO;AACZ,mBAAW,QAAQ,kCAAkC,KAAK;AAE1D,eAAO;AAAA,MACX;AAAA,IACJ,GAZuB;AAAA,EAa3B;AAAA,EACA,SAAS,CAAC;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/dynamic-loader-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/dynamic-loader-plugin.esm.js",
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
],
|
|
10
10
|
"author": "Learning Economy Foundation (www.learningeconomy.io)",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/
|
|
12
|
+
"homepage": "https://github.com/learningeconomy/LearnCard/tree/main/packages/plugins/dynamic-loader/README.md",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "
|
|
15
|
+
"url": "https://github.com/learningeconomy/LearnCard"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/learningeconomy/LearnCard/issues"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^29.2.2",
|
|
22
22
|
"@types/node": "^17.0.31",
|
|
23
23
|
"aqu": "0.4.3",
|
|
24
|
-
"esbuild": "^0.
|
|
24
|
+
"esbuild": "^0.27.1",
|
|
25
25
|
"esbuild-jest": "^0.5.0",
|
|
26
26
|
"esbuild-plugin-copy": "^1.3.0",
|
|
27
27
|
"jest": "^29.3.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@learncard/core": "9.
|
|
33
|
+
"@learncard/core": "9.4.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
|