@123ishatest/louter 0.3.1 → 0.5.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/LouterWarningType-DFSB1Kdo.mjs +4 -0
- package/dist/LouterWarningType-DFvXKHOu.js +1 -0
- package/dist/content/ContentManager.d.ts +1 -0
- package/dist/content/ContentManager.d.ts.map +1 -1
- package/dist/core/LouterWarningType.d.ts +2 -0
- package/dist/core/LouterWarningType.d.ts.map +1 -1
- package/dist/core/references.d.ts +5 -0
- package/dist/core/references.d.ts.map +1 -0
- package/dist/index.cjs.js +120 -95
- package/dist/index.es.js +4262 -3463
- package/dist/node.cjs.js +1 -1
- package/dist/node.es.js +1 -1
- package/dist/validator/LouterValidator.d.ts +2 -0
- package/dist/validator/LouterValidator.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/LouterWarningType-CR_x5jAt.mjs +0 -4
- package/dist/LouterWarningType-D9owEyyk.js +0 -1
package/dist/node.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:fs"),a=require("node:path"),d=require("./LouterWarningType-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:fs"),a=require("node:path"),d=require("./LouterWarningType-DFvXKHOu.js");class f{_contentRoot;constructor(t){this._contentRoot=t}run(t){const e=this.getAllFiles(this._contentRoot);t.files=e.map(s=>({path:s,data:o.readFileSync(s,"utf-8")}))}getAllFiles(t){const e=o.readdirSync(t,{withFileTypes:!0}),s=[];for(const n of e){const c=a.join(t,n.name);n.isDirectory()&&s.push(...this.getAllFiles(c)),n.isFile()&&s.push(c)}return s}}class g{_directory;constructor(t=".louter"){this._directory=t}run(t){t.warnings.forEach(n=>{console.warn(n.path,n.message)}),o.mkdirSync(this._directory,{recursive:!0});const e=t.content,s=a.join(this._directory,"content.generated.json");o.writeFileSync(s,JSON.stringify(e,null,2))}}class S{_directory;constructor(t=".louter"){this._directory=t}run(t){o.mkdirSync(this._directory,{recursive:!0});for(const e in t.kinds){const s=t.kinds[e].toJSONSchema({io:"input"}),n=a.join(this._directory,`${e}.schema.json`);o.writeFileSync(n,JSON.stringify(s,null,2))}}}function l(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function p(r){return l(r)?typeof r.url=="string"&&Array.isArray(r.fileMatch)&&r.fileMatch.every(t=>typeof t=="string"):!1}class _{_settingsPath;constructor(t=".vscode/settings.json"){this._settingsPath=t}run(t){let e={};try{e=JSON.parse(o.readFileSync(this._settingsPath,"utf-8"))}catch{t.warnings.push({type:d.LouterWarningType.InvalidJson,path:this._settingsPath,message:`Could not read or parse ${this._settingsPath}. A new settings file will be created.`})}const s={},n=[];Object.keys(t.kinds).forEach(i=>{s[`.generated/${i}.schema.json`]=[`**/*.${i}.y[a]ml`],n.push({fileMatch:[`**/*.${i}.json`],url:`.generated/${i}.schema.json`})});const c=l(e["yaml.schemas"])?e["yaml.schemas"]:{};e["yaml.schemas"]={...c,...s};const h=Array.isArray(e["json.schemas"])?e["json.schemas"].filter(p):[],u=new Map(n.map(i=>[i.url,i])),y=h.filter(i=>!u.has(i.url));e["json.schemas"]=[...y,...n];const m=a.dirname(this._settingsPath);o.mkdirSync(m,{recursive:!0}),o.writeFileSync(this._settingsPath,`${JSON.stringify(e,null,2)}
|
|
2
2
|
`,"utf-8")}}exports.LouterContentWriter=g;exports.LouterFileLoader=f;exports.LouterJsonSchemaWriter=S;exports.LouterVsCodeSettingsWriter=_;
|
package/dist/node.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync as l, readdirSync as d, mkdirSync as a, writeFileSync as h } from "node:fs";
|
|
2
2
|
import c from "node:path";
|
|
3
|
-
import { L as p } from "./LouterWarningType-
|
|
3
|
+
import { L as p } from "./LouterWarningType-DFSB1Kdo.mjs";
|
|
4
4
|
class J {
|
|
5
5
|
_contentRoot;
|
|
6
6
|
constructor(t) {
|
|
@@ -6,5 +6,7 @@ import { LouterContext } from '../core/LouterContext';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class LouterValidator implements LouterStage {
|
|
8
8
|
run<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
|
|
9
|
+
parse<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
|
|
10
|
+
validateReferences<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=LouterValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LouterValidator.d.ts","sourceRoot":"","sources":["../../src/validator/LouterValidator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"LouterValidator.d.ts","sourceRoot":"","sources":["../../src/validator/LouterValidator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAKhE;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;IACjD,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;IAKnE,KAAK,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;IA8CrE,kBAAkB,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;CAiCnF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@123ishatest/louter",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"vitest": "^4.0.6"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
+
"es-toolkit": "^1.46.1",
|
|
57
58
|
"yaml": "^2.8.2",
|
|
58
59
|
"zod": "^4.3.6"
|
|
59
60
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var i = /* @__PURE__ */ ((d) => (d.MissingKind = "MissingKind", d.InvalidKind = "InvalidKind", d.InvalidYaml = "InvalidYaml", d.InvalidJson = "InvalidJson", d.MissingGlobalIdKey = "MissingGlobalIdKey", d.ZodParsingFailed = "ZodParsingFailed", d.DuplicateId = "DuplicateId", d))(i || {});
|
|
2
|
-
export {
|
|
3
|
-
i as L
|
|
4
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var d=(i=>(i.MissingKind="MissingKind",i.InvalidKind="InvalidKind",i.InvalidYaml="InvalidYaml",i.InvalidJson="InvalidJson",i.MissingGlobalIdKey="MissingGlobalIdKey",i.ZodParsingFailed="ZodParsingFailed",i.DuplicateId="DuplicateId",i))(d||{});exports.LouterWarningType=d;
|