@jsonic/multisource 0.0.7 → 0.2.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/dist/multisource.d.ts +42 -11
- package/dist/multisource.js +89 -70
- package/dist/multisource.js.map +1 -1
- package/dist/multisource.min.js +1 -0
- package/dist/processor/js.d.ts +5 -0
- package/dist/processor/js.js +27 -0
- package/dist/processor/js.js.map +1 -0
- package/dist/processor/jsonic.d.ts +3 -0
- package/dist/processor/jsonic.js +39 -0
- package/dist/processor/jsonic.js.map +1 -0
- package/dist/resolver/file.d.ts +1 -1
- package/dist/resolver/file.js +43 -20
- package/dist/resolver/file.js.map +1 -1
- package/dist/resolver/mem.d.ts +4 -3
- package/dist/resolver/mem.js +63 -15
- package/dist/resolver/mem.js.map +1 -1
- package/jest.config.js +9 -0
- package/package.json +36 -15
- package/src/multisource.ts +217 -0
- package/src/processor/js.ts +42 -0
- package/src/processor/jsonic.ts +63 -0
- package/src/resolver/file.ts +91 -0
- package/src/resolver/mem.ts +110 -0
- package/dist/test/multisource.test.d.ts +0 -1
- package/dist/test/multisource.test.js +0 -85
- package/dist/test/multisource.test.js.map +0 -1
- package/multisource.ts +0 -152
- package/resolver/file.ts +0 -49
- package/resolver/mem.ts +0 -36
package/dist/multisource.d.ts
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
path: string;
|
|
6
|
-
full: string;
|
|
7
|
-
base: string;
|
|
8
|
-
src?: string;
|
|
1
|
+
import { Jsonic, Context, Rule, Plugin } from 'jsonic';
|
|
2
|
+
interface MultiSourceMeta {
|
|
3
|
+
path?: string;
|
|
4
|
+
deps?: DependencyMap;
|
|
9
5
|
}
|
|
10
|
-
declare
|
|
6
|
+
declare const NONE = "";
|
|
7
|
+
declare type MultiSourceOptions = {
|
|
8
|
+
resolver: Resolver;
|
|
9
|
+
path?: string;
|
|
10
|
+
markchar?: string;
|
|
11
|
+
processor?: {
|
|
12
|
+
[kind: string]: Processor;
|
|
13
|
+
};
|
|
14
|
+
implictExt?: [];
|
|
15
|
+
};
|
|
16
|
+
declare type PathSpec = {
|
|
17
|
+
kind: string;
|
|
18
|
+
path?: string;
|
|
19
|
+
full?: string;
|
|
20
|
+
base?: string;
|
|
21
|
+
abs: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare type Resolution = PathSpec & {
|
|
24
|
+
src?: string;
|
|
25
|
+
val?: any;
|
|
26
|
+
found: boolean;
|
|
27
|
+
};
|
|
28
|
+
declare type Resolver = (spec: PathSpec, popts: MultiSourceOptions, rule: Rule, ctx: Context, jsonic: Jsonic) => Resolution;
|
|
29
|
+
declare type Processor = (res: Resolution, popts: MultiSourceOptions, rule: Rule, ctx: Context, jsonic: Jsonic) => void;
|
|
30
|
+
declare type Dependency = {
|
|
31
|
+
tar: string | typeof TOP;
|
|
32
|
+
src: string;
|
|
33
|
+
wen: number;
|
|
34
|
+
};
|
|
35
|
+
declare type DependencyMap = {
|
|
36
|
+
[tar_full_path: string]: {
|
|
37
|
+
[src_full_path: string]: Dependency;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
11
40
|
declare const TOP: unique symbol;
|
|
12
|
-
declare
|
|
13
|
-
|
|
41
|
+
declare const MultiSource: Plugin;
|
|
42
|
+
declare function resolvePathSpec(popts: MultiSourceOptions, ctx: Context, spec: any, resolvefolder: (path: string) => string): PathSpec;
|
|
43
|
+
export type { Resolver, Resolution, Processor, MultiSourceOptions, Dependency, DependencyMap, MultiSourceMeta, PathSpec, };
|
|
44
|
+
export { MultiSource, resolvePathSpec, NONE, TOP, };
|
package/dist/multisource.js
CHANGED
|
@@ -1,84 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* Copyright (c) 2021 Richard Rodger, MIT License */
|
|
2
|
-
/* $lab:coverage:off$ */
|
|
3
|
-
'use strict';
|
|
4
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
//import { Csv } from './csv'
|
|
14
|
-
/* $lab:coverage:on$ */
|
|
15
|
-
// TODO: .jsonic suffix optional
|
|
16
|
-
// TODO: jsonic-cli should provide basepath
|
|
17
|
-
// TODO: auto load index.jsonic, index.<folder-name>.jsonic
|
|
18
|
-
let DEFAULTS = {
|
|
19
|
-
markchar: '@',
|
|
20
|
-
};
|
|
4
|
+
exports.TOP = exports.NONE = exports.resolvePathSpec = exports.MultiSource = void 0;
|
|
5
|
+
const directive_1 = require("@jsonic/directive");
|
|
6
|
+
const jsonic_1 = require("./processor/jsonic");
|
|
7
|
+
const js_1 = require("./processor/js");
|
|
8
|
+
// Unknown source reference file extension.
|
|
9
|
+
const NONE = '';
|
|
10
|
+
exports.NONE = NONE;
|
|
11
|
+
// The top of the dependence tree.
|
|
21
12
|
const TOP = Symbol('TOP');
|
|
22
13
|
exports.TOP = TOP;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const MultiSource = (jsonic, popts) => {
|
|
15
|
+
const markchar = popts.markchar;
|
|
16
|
+
const resolver = popts.resolver;
|
|
17
|
+
const processor = popts.processor;
|
|
18
|
+
// Normalize implicit extensions to format `.name`.
|
|
19
|
+
const implictExt = (popts.implictExt || []);
|
|
20
|
+
for (let extI = 0; extI < implictExt.length; extI++) {
|
|
21
|
+
let ext = implictExt[extI];
|
|
22
|
+
implictExt[extI] = ext.startsWith('.') ? ext : '.' + ext;
|
|
23
|
+
}
|
|
28
24
|
jsonic.options({
|
|
29
|
-
token: {
|
|
30
|
-
[tn]: { c: markchar }
|
|
31
|
-
},
|
|
32
25
|
error: {
|
|
33
|
-
|
|
26
|
+
multisource_not_found: 'source not found: $path',
|
|
34
27
|
},
|
|
35
28
|
hint: {
|
|
36
|
-
|
|
29
|
+
multisource_not_found: 'TODO: PATH: $path DETAILS: $details',
|
|
37
30
|
},
|
|
38
31
|
});
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// console.log('MS res meta', ctx.meta)
|
|
50
|
-
let val = undefined;
|
|
51
|
-
let path = rule.open[1].val;
|
|
52
|
-
let res = resolver(path, ctx);
|
|
53
|
-
if (null != res.src) {
|
|
54
|
-
let msmeta = ctx.meta.multisource || {};
|
|
55
|
-
let meta = {
|
|
56
|
-
...ctx.meta,
|
|
57
|
-
multisource: {
|
|
58
|
-
...msmeta,
|
|
59
|
-
path: res.full
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
// console.log('MSMETA path', path, res.full)
|
|
63
|
-
val = jsonic(res.src, meta);
|
|
64
|
-
if (msmeta.deps) {
|
|
65
|
-
let depmap = msmeta.deps;
|
|
66
|
-
let parent = (msmeta.path || TOP);
|
|
67
|
-
if (null != parent) {
|
|
68
|
-
(depmap[parent] = depmap[parent] || {})[res.full] = {
|
|
69
|
-
tar: parent,
|
|
70
|
-
src: res.full,
|
|
71
|
-
wen: Date.now()
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
rule.open[0].val = val;
|
|
32
|
+
// Define a directive that can load content from multiple sources.
|
|
33
|
+
let dopts = {
|
|
34
|
+
name: 'multisource',
|
|
35
|
+
open: markchar,
|
|
36
|
+
action: (rule, ctx) => {
|
|
37
|
+
var _a;
|
|
38
|
+
let spec = rule.child.node;
|
|
39
|
+
let res = resolver(spec, popts, rule, ctx, jsonic);
|
|
40
|
+
if (!res.found) {
|
|
41
|
+
return (_a = rule.parent) === null || _a === void 0 ? void 0 : _a.o0.bad('multisource_not_found', { ...res });
|
|
77
42
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
res.kind = null == res.kind ? NONE : res.kind;
|
|
44
|
+
let proc = processor[res.kind] || processor[NONE];
|
|
45
|
+
proc(res, popts, rule, ctx, jsonic);
|
|
46
|
+
rule.node = res.val;
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
jsonic.use(directive_1.Directive, dopts);
|
|
82
50
|
};
|
|
83
51
|
exports.MultiSource = MultiSource;
|
|
52
|
+
// Convenience maker for Processors
|
|
53
|
+
function makeProcessor(process) {
|
|
54
|
+
return (res) => (res.val = process(res.src, res));
|
|
55
|
+
}
|
|
56
|
+
// Default is just to insert file contents as a string.
|
|
57
|
+
const defaultProcessor = makeProcessor((src) => src);
|
|
58
|
+
// TODO: use json plugin to get better error msgs.
|
|
59
|
+
const jsonProcessor = makeProcessor((src) => null == src ? undefined : JSON.parse(src));
|
|
60
|
+
const jsonicProcessor = (0, jsonic_1.makeJsonicProcessor)();
|
|
61
|
+
const jsProcessor = (0, js_1.makeJavaScriptProcessor)();
|
|
62
|
+
MultiSource.defaults = {
|
|
63
|
+
markchar: '@',
|
|
64
|
+
processor: {
|
|
65
|
+
[NONE]: defaultProcessor,
|
|
66
|
+
jsonic: jsonicProcessor,
|
|
67
|
+
jsc: jsonicProcessor,
|
|
68
|
+
json: jsonProcessor,
|
|
69
|
+
js: jsProcessor,
|
|
70
|
+
},
|
|
71
|
+
implictExt: ['jsonic', 'jsc', 'json', 'js'],
|
|
72
|
+
};
|
|
73
|
+
function resolvePathSpec(popts, ctx, spec, resolvefolder) {
|
|
74
|
+
var _a;
|
|
75
|
+
let msmeta = (_a = ctx.meta) === null || _a === void 0 ? void 0 : _a.multisource;
|
|
76
|
+
let base = resolvefolder(null == msmeta || null == msmeta.path ? popts.path : msmeta.path);
|
|
77
|
+
let path = 'string' === typeof spec
|
|
78
|
+
? spec
|
|
79
|
+
: null != spec.path
|
|
80
|
+
? '' + spec.path
|
|
81
|
+
: undefined;
|
|
82
|
+
let abs = !!((path === null || path === void 0 ? void 0 : path.startsWith('/')) || (path === null || path === void 0 ? void 0 : path.startsWith('\\')));
|
|
83
|
+
let full = abs
|
|
84
|
+
? path
|
|
85
|
+
: null != path && '' != path
|
|
86
|
+
? null != base && '' != base
|
|
87
|
+
? base + '/' + path
|
|
88
|
+
: path
|
|
89
|
+
: undefined;
|
|
90
|
+
let kind = null == full ? NONE : (full.match(/\.([^.]*)$/) || [NONE, NONE])[1];
|
|
91
|
+
let res = {
|
|
92
|
+
kind,
|
|
93
|
+
path,
|
|
94
|
+
full,
|
|
95
|
+
base,
|
|
96
|
+
abs,
|
|
97
|
+
found: false,
|
|
98
|
+
};
|
|
99
|
+
// console.log('RES', res)
|
|
100
|
+
return res;
|
|
101
|
+
}
|
|
102
|
+
exports.resolvePathSpec = resolvePathSpec;
|
|
84
103
|
//# sourceMappingURL=multisource.js.map
|
package/dist/multisource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multisource.js","sourceRoot":"","sources":["../multisource.ts"],"names":[],"mappings":"AAAA,oDAAoD
|
|
1
|
+
{"version":3,"file":"multisource.js","sourceRoot":"","sources":["../src/multisource.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAGpD,iDAA+D;AAE/D,+CAAwD;AACxD,uCAAwD;AAUxD,2CAA2C;AAC3C,MAAM,IAAI,GAAG,EAAE,CAAA;AA8Lb,oBAAI;AApIN,kCAAkC;AAClC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;AAoIvB,kBAAG;AAlIL,MAAM,WAAW,GAAW,CAAC,MAAc,EAAE,KAAyB,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAkB,CAAA;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAoB,CAAA;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,SAA0C,CAAA;IAElE,mDAAmD;IACnD,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,C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(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsonicMultiSource=e()}}((function(){var define,module,exports,createModuleFactory=function(e){var t;return function(o){return t||e(t={exports:{},parent:o},t.exports),t.exports}},_$multisource_1=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.NONE=t.resolvePathSpec=t.MultiSource=void 0;const o=_$jsonic_3({});t.NONE="";const n=Symbol("TOP");t.TOP=n;const l=(e,t)=>{const o=t.markchar,n=t.resolver,l=t.processor,i=t.implictExt||[];for(let s=0;s<i.length;s++){let e=i[s];i[s]=e.startsWith(".")?e:"."+e}e.options({error:{multisource_not_found:"source not found: $path"},hint:{multisource_not_found:"TODO: PATH: $path DETAILS: $details"}});let r={name:"multisource",open:o,action:(o,i)=>{var r;let s=o.child.node,u=n(s,t,o,i,e);if(!u.found)return null===(r=o.parent)||void 0===r?void 0:r.o0.bad("multisource_not_found",{...u});u.kind=null==u.kind?"":u.kind,(l[u.kind]||l[""])(u,t,o,i,e),o.node=u.val}};e.use(_$directiveMin_4.Directive,r)};function i(e){return t=>t.val=e(t.src,t)}t.MultiSource=l;const r=i(e=>e),s=i(e=>null==e?void 0:JSON.parse(e)),u=(0,o.makeJsonicProcessor)(),c=(0,_$js_2.makeJavaScriptProcessor)();l.defaults={markchar:"@",processor:{"":r,jsonic:u,jsc:u,json:s,js:c},implictExt:["jsonic","jsc","json","js"]},t.resolvePathSpec=function(e,t,o,n){var l;let i=null===(l=t.meta)||void 0===l?void 0:l.multisource,r=n(null==i||null==i.path?e.path:i.path),s="string"==typeof o?o:null!=o.path?""+o.path:void 0,u=!(!(null==s?void 0:s.startsWith("/"))&&!(null==s?void 0:s.startsWith("\\"))),c=u?s:null!=s&&""!=s?null!=r&&""!=r?r+"/"+s:s:void 0;return{kind:null==c?"":(c.match(/\.([^.]*)$/)||["",""])[1],path:s,full:c,base:r,abs:u,found:!1}}})),_$jsonic_3=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeJsonicProcessor=void 0;const o=_$multisource_1({});t.makeJsonicProcessor=function(){return function(e,t,n,l,i){var r;if(null!=e.src&&null!=e.full){let t=(null===(r=l.meta)||void 0===r?void 0:r.multisource)||{},n={...l.meta||{},multisource:{...t,path:e.full}};if(e.val=i(e.src,n),t.deps){let n=t.deps,l=t.path||o.TOP;if(null!=l){let t={tar:l,src:e.full,wen:Date.now()};n[l]=n[l]||{},n[l][e.full]=t}}}}}})),_$directiveMin_4={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$directiveMin_4.exports?_$directiveMin_4.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicDirective=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Directive=void 0;const t=(e,t)=>{let o=("string"==typeof t.rules?t.rules.split(/\s*,\s*/):t.rules||[]).filter(e=>""!==e),n=t.name,l=t.open,i=t.close,r=t.action;if("string"==typeof r){let t=r;r=o=>o.node=e.util.prop(e.options,t)}let s={},u="#D_open_"+n,c="#D_close_"+n,a=e.fixed(l),d=null==i?null:e.fixed(i);if(null!=a)throw new Error("Directive open token already in use: "+l);s[u]=l,null==d&&null!=i&&(s[c]=i),e.options({fixed:{token:s},error:{[n+"_close"]:null==i?null:"directive "+n+' close "'+i+'" without open "'+l+'"'},hint:{[n+"_close"]:null==i?null:`\nThe ${n} directive must start with the characters "${l}" and end\nwith the characters "${i}". The end characters "${i}" may not\nappear without the start characters "${l}" appearing first:\n"${l}...${i}".\n`}});let f=e.token.CA;a=e.fixed(l),d=null==i?null:e.fixed(i),o.forEach(t=>{e.rule(t,e=>(e.open({s:[a],p:n,n:{dr:1}}),null!=i&&(e.open([{s:[d],c:{n:{dr:0}},e:(e,t)=>t.t0.bad(n+"_close")},{s:[d],b:1}]),e.close({s:[d],b:1})),e))}),e.rule(n,e=>e.clear().bo(e=>e.node={}).open([{p:"val",n:null==i?{}:{pk:-1,il:0}}]).bc((...e)=>r(...e)).close(null!=i?[{s:[d]},{s:[f,d]}]:[]))};return e.Directive=t,t.defaults={rules:"val,pair,elem"},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$directiveMin_4=_$directiveMin_4.exports;var _$js_2={};function makeJavaScriptProcessor(e){const t=t=>{t.val=evaluate(t,e)};return t.opts=e,t}function evaluate(res,opts){let out=void 0;if(!0!==(null==opts?void 0:opts.evalOnly))out=require(res.full);else{let exports=null,module={exports:exports};eval(res.src),out=module.exports}return out}return Object.defineProperty(_$js_2,"__esModule",{value:!0}),_$js_2.makeJavaScriptProcessor=void 0,_$js_2.makeJavaScriptProcessor=makeJavaScriptProcessor,_$multisource_1(),_$multisource_1}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2021 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.makeJavaScriptProcessor = void 0;
|
|
5
|
+
function makeJavaScriptProcessor(opts) {
|
|
6
|
+
const JavaScriptProcessor = (res) => {
|
|
7
|
+
res.val = evaluate(res, opts);
|
|
8
|
+
};
|
|
9
|
+
JavaScriptProcessor.opts = opts;
|
|
10
|
+
return JavaScriptProcessor;
|
|
11
|
+
}
|
|
12
|
+
exports.makeJavaScriptProcessor = makeJavaScriptProcessor;
|
|
13
|
+
// TODO: too simplistic - handle more module cases
|
|
14
|
+
function evaluate(res, opts) {
|
|
15
|
+
let out = undefined;
|
|
16
|
+
if (true !== (opts === null || opts === void 0 ? void 0 : opts.evalOnly) && undefined !== typeof (require)) {
|
|
17
|
+
out = require(res.full);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
let exports = null;
|
|
21
|
+
let module = { exports };
|
|
22
|
+
eval(res.src);
|
|
23
|
+
out = module.exports;
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js.js","sourceRoot":"","sources":["../../src/processor/js.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AASpD,SAAS,uBAAuB,CAAC,IAEhC;IAEC,MAAM,mBAAmB,GAAG,CAC1B,GAAe,EACf,EAAE;QACF,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/B,CAAC,CAAA;IAED,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAA;IAE/B,OAAO,mBAAmB,CAAA;AAC5B,CAAC;AAkBC,0DAAuB;AAhBzB,kDAAkD;AAClD,SAAS,QAAQ,CAAC,GAAe,EAAE,IAAU;IAC3C,IAAI,GAAG,GAAG,SAAS,CAAA;IACnB,IAAI,IAAI,MAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA,IAAI,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7D,GAAG,GAAG,OAAO,CAAE,GAAG,CAAC,IAAe,CAAC,CAAA;KACpC;SACI;QACH,IAAI,OAAO,GAAG,IAAI,CAAA;QAClB,IAAI,MAAM,GAAG,EAAE,OAAO,EAAE,CAAA;QACxB,IAAI,CAAE,GAAG,CAAC,GAAc,CAAC,CAAA;QACzB,GAAG,GAAG,MAAM,CAAC,OAAO,CAAA;KACrB;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright (c) 2021 Richard Rodger, MIT License */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.makeJsonicProcessor = void 0;
|
|
5
|
+
const multisource_1 = require("../multisource");
|
|
6
|
+
function makeJsonicProcessor() {
|
|
7
|
+
return function JsonicProcessor(res, _popts, _rule, ctx, jsonic) {
|
|
8
|
+
var _a;
|
|
9
|
+
if (null != res.src && null != res.full) {
|
|
10
|
+
// Pass down any meta info.
|
|
11
|
+
let msmeta = ((_a = ctx.meta) === null || _a === void 0 ? void 0 : _a.multisource) || {};
|
|
12
|
+
let meta = {
|
|
13
|
+
...(ctx.meta || {}),
|
|
14
|
+
multisource: {
|
|
15
|
+
...msmeta,
|
|
16
|
+
path: res.full
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
// console.log('PM', meta, res)
|
|
20
|
+
res.val = jsonic(res.src, meta);
|
|
21
|
+
// Build dependency tree branch.
|
|
22
|
+
if (msmeta.deps) {
|
|
23
|
+
let depmap = msmeta.deps;
|
|
24
|
+
let parent = (msmeta.path || multisource_1.TOP);
|
|
25
|
+
if (null != parent) {
|
|
26
|
+
let dep = {
|
|
27
|
+
tar: parent,
|
|
28
|
+
src: res.full,
|
|
29
|
+
wen: Date.now()
|
|
30
|
+
};
|
|
31
|
+
depmap[parent] = depmap[parent] || {};
|
|
32
|
+
depmap[parent][res.full] = dep;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
exports.makeJsonicProcessor = makeJsonicProcessor;
|
|
39
|
+
//# sourceMappingURL=jsonic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonic.js","sourceRoot":"","sources":["../../src/processor/jsonic.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAKpD,gDAQuB;AAGvB,SAAS,mBAAmB;IAE1B,OAAO,SAAS,eAAe,CAC7B,GAAe,EACf,MAA0B,EAC1B,KAAW,EACX,GAAY,EACZ,MAAc;;QAEd,IAAI,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE;YAEvC,2BAA2B;YAC3B,IAAI,MAAM,GAAoB,CAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,WAAW,KAAI,EAAE,CAAA;YACzD,IAAI,IAAI,GAAG;gBACT,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;gBACnB,WAAW,EAAE;oBACX,GAAG,MAAM;oBACT,IAAI,EAAE,GAAG,CAAC,IAAI;iBACf;aACF,CAAA;YAED,+BAA+B;YAC/B,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YAE/B,gCAAgC;YAChC,IAAI,MAAM,CAAC,IAAI,EAAE;gBACf,IAAI,MAAM,GAAI,MAAM,CAAC,IAAsB,CAAA;gBAC3C,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,iBAAG,CAAW,CAAA;gBAC3C,IAAI,IAAI,IAAI,MAAM,EAAE;oBAClB,IAAI,GAAG,GAAe;wBACpB,GAAG,EAAE,MAAM;wBACX,GAAG,EAAE,GAAG,CAAC,IAAI;wBACb,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;qBAChB,CAAA;oBACD,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;oBACrC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;iBAC/B;aACF;SACF;IACH,CAAC,CAAA;AACH,CAAC;AAKC,kDAAmB"}
|
package/dist/resolver/file.d.ts
CHANGED
package/dist/resolver/file.js
CHANGED
|
@@ -6,31 +6,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.makeFileResolver = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const multisource_1 = require("../multisource");
|
|
10
|
+
const mem_1 = require("./mem");
|
|
9
11
|
function makeFileResolver() {
|
|
10
|
-
return function FileResolver(
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
return function FileResolver(spec, popts, _rule, ctx) {
|
|
13
|
+
let ps = (0, multisource_1.resolvePathSpec)(popts, ctx, spec, resolvefolder);
|
|
14
|
+
let src = undefined;
|
|
15
|
+
// console.log(ps)
|
|
16
|
+
if (null != ps.full) {
|
|
17
|
+
ps.full = path_1.default.resolve(ps.full);
|
|
18
|
+
src = load(ps.full);
|
|
19
|
+
if (null == src && multisource_1.NONE === ps.kind) {
|
|
20
|
+
let potentials = (0, mem_1.buildPotentials)(ps, popts, (...s) => path_1.default.resolve(s.reduce((a, p) => path_1.default.join(a, p))));
|
|
21
|
+
for (let path of potentials) {
|
|
22
|
+
if (null != (src = load(path))) {
|
|
23
|
+
ps.full = path;
|
|
24
|
+
ps.kind = (path.match(/\.([^.]*)$/) || [multisource_1.NONE, multisource_1.NONE])[1];
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
(null == basepath ? path : path_1.default.resolve(basepath, path));
|
|
26
|
-
let src = fs_1.default.readFileSync(fullpath).toString();
|
|
27
|
-
return {
|
|
28
|
-
path: path,
|
|
29
|
-
full: fullpath,
|
|
30
|
-
base: basepath,
|
|
30
|
+
let res = {
|
|
31
|
+
...ps,
|
|
31
32
|
src,
|
|
33
|
+
found: null != src
|
|
32
34
|
};
|
|
35
|
+
return res;
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
exports.makeFileResolver = makeFileResolver;
|
|
39
|
+
function resolvefolder(path) {
|
|
40
|
+
let folder = path;
|
|
41
|
+
let pathstats = fs_1.default.statSync(path);
|
|
42
|
+
if (pathstats.isFile()) {
|
|
43
|
+
let pathdesc = path_1.default.parse(path);
|
|
44
|
+
folder = pathdesc.dir;
|
|
45
|
+
}
|
|
46
|
+
return folder;
|
|
47
|
+
}
|
|
48
|
+
// TODO: in multisource.ts, generate an error token if cannot resolve
|
|
49
|
+
function load(path) {
|
|
50
|
+
// console.log('LOAD', path)
|
|
51
|
+
try {
|
|
52
|
+
return fs_1.default.readFileSync(path).toString();
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
// NOTE: don't need this, as in all cases, we consider failed
|
|
56
|
+
// reads to indicate non-existence.
|
|
57
|
+
}
|
|
58
|
+
}
|
|
36
59
|
//# sourceMappingURL=file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../resolver/file.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/resolver/file.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AAIvB,gDAMuB;AAGvB,+BAEc;AAGd,SAAS,gBAAgB;IAEvB,OAAO,SAAS,YAAY,CAC1B,IAAS,EACT,KAAyB,EACzB,KAAW,EACX,GAAY;QAEZ,IAAI,EAAE,GAAG,IAAA,6BAAe,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QACzD,IAAI,GAAG,GAAG,SAAS,CAAA;QAEnB,kBAAkB;QAElB,IAAI,IAAI,IAAI,EAAE,CAAC,IAAI,EAAE;YACnB,EAAE,CAAC,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YAE/B,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YAEnB,IAAI,IAAI,IAAI,GAAG,IAAI,kBAAI,KAAK,EAAE,CAAC,IAAI,EAAE;gBACnC,IAAI,UAAU,GACZ,IAAA,qBAAe,EAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAClC,cAAI,CAA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.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Resolver } from '../multisource';
|
|
2
|
-
declare function makeMemResolver(
|
|
1
|
+
import { MultiSourceOptions, Resolver, PathSpec } from '../multisource';
|
|
2
|
+
declare function makeMemResolver(filemap: {
|
|
3
3
|
[fullpath: string]: string;
|
|
4
4
|
}): Resolver;
|
|
5
|
-
|
|
5
|
+
declare function buildPotentials(ps: PathSpec, popts: MultiSourceOptions, pathjoin: (...parts: string[]) => string): string[];
|
|
6
|
+
export { buildPotentials, makeMemResolver, };
|
package/dist/resolver/mem.js
CHANGED
|
@@ -1,23 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeMemResolver = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
exports.makeMemResolver = exports.buildPotentials = void 0;
|
|
4
|
+
const multisource_1 = require("../multisource");
|
|
5
|
+
function makeMemResolver(filemap) {
|
|
6
|
+
return function MemResolver(spec, popts, _rule, ctx) {
|
|
7
|
+
let ps = (0, multisource_1.resolvePathSpec)(popts, ctx, spec, makeresolvefolder(filemap));
|
|
8
|
+
let src = undefined;
|
|
9
|
+
if (null != ps.full) {
|
|
10
|
+
src = filemap[ps.full];
|
|
11
|
+
if (null == src && multisource_1.NONE === ps.kind) {
|
|
12
|
+
let potentials = buildPotentials(ps, popts, (...s) => s.reduce((a, p) => a + '/' + p));
|
|
13
|
+
for (let path of potentials) {
|
|
14
|
+
if (null != (src = filemap[path])) {
|
|
15
|
+
ps.full = path;
|
|
16
|
+
ps.kind = (path.match(/\.([^.]*)$/) || [multisource_1.NONE, multisource_1.NONE])[1];
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
let res = {
|
|
23
|
+
...ps,
|
|
18
24
|
src,
|
|
25
|
+
found: null != src
|
|
19
26
|
};
|
|
27
|
+
return res;
|
|
20
28
|
};
|
|
21
29
|
}
|
|
22
30
|
exports.makeMemResolver = makeMemResolver;
|
|
31
|
+
function makeresolvefolder(filemap) {
|
|
32
|
+
return function resolvefolder(path) {
|
|
33
|
+
let folder = path;
|
|
34
|
+
if (filemap[path]) {
|
|
35
|
+
folder = (path
|
|
36
|
+
.replace(/[\\\/]+$/, '')
|
|
37
|
+
.match(/[\\\/]+([^\\\/]+)$/) || ['', ''])[1];
|
|
38
|
+
// console.log('PF', path, folder)
|
|
39
|
+
}
|
|
40
|
+
// console.log('RF', folder)
|
|
41
|
+
return folder;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function buildPotentials(ps, popts, pathjoin) {
|
|
45
|
+
let full = ps.full;
|
|
46
|
+
let potentials = [];
|
|
47
|
+
let implictExt = popts.implictExt || [];
|
|
48
|
+
// Implicit extensions.
|
|
49
|
+
for (let ext of implictExt) {
|
|
50
|
+
potentials.push(full + ext);
|
|
51
|
+
}
|
|
52
|
+
// Folder index file.
|
|
53
|
+
for (let ext of implictExt) {
|
|
54
|
+
potentials.push(pathjoin(full, 'index' + ext));
|
|
55
|
+
}
|
|
56
|
+
// Folder index file (includes folder name).
|
|
57
|
+
if (null != ps.path) {
|
|
58
|
+
let folder = (ps.path
|
|
59
|
+
.replace(/[\\\/]+$/, '')
|
|
60
|
+
.match(/[^\\\/]+$/) || [])[0];
|
|
61
|
+
if (null != folder) {
|
|
62
|
+
for (let ext of implictExt) {
|
|
63
|
+
potentials.push(pathjoin(full, 'index.' + folder + ext));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// console.log(potentials)
|
|
68
|
+
return potentials;
|
|
69
|
+
}
|
|
70
|
+
exports.buildPotentials = buildPotentials;
|
|
23
71
|
//# sourceMappingURL=mem.js.map
|
package/dist/resolver/mem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mem.js","sourceRoot":"","sources":["../../resolver/mem.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mem.js","sourceRoot":"","sources":["../../src/resolver/mem.ts"],"names":[],"mappings":";;;AAIA,gDAOuB;AAGvB,SAAS,eAAe,CAAC,OAAuC;IAE9D,OAAO,SAAS,WAAW,CACzB,IAAS,EACT,KAAyB,EACzB,KAAW,EACX,GAAY;QAEZ,IAAI,EAAE,GAAG,IAAA,6BAAe,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAA;QACtE,IAAI,GAAG,GAAG,SAAS,CAAA;QAEnB,IAAI,IAAI,IAAI,EAAE,CAAC,IAAI,EAAE;YACnB,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YAEtB,IAAI,IAAI,IAAI,GAAG,IAAI,kBAAI,KAAK,EAAE,CAAC,IAAI,EAAE;gBACnC,IAAI,UAAU,GACZ,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAClC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;gBAEpC,KAAK,IAAI,IAAI,IAAI,UAAU,EAAE;oBAC3B,IAAI,IAAI,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE;wBACjC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAA;wBACd,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAI,EAAE,kBAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;wBACvD,MAAK;q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