@123ishatest/louter 0.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.
Files changed (47) hide show
  1. package/dist/content/ContentManager.d.ts +28 -0
  2. package/dist/content/ContentManager.d.ts.map +1 -0
  3. package/dist/core/Louter.d.ts +9 -0
  4. package/dist/core/Louter.d.ts.map +1 -0
  5. package/dist/core/LouterConfig.d.ts +4 -0
  6. package/dist/core/LouterConfig.d.ts.map +1 -0
  7. package/dist/core/LouterContext.d.ts +14 -0
  8. package/dist/core/LouterContext.d.ts.map +1 -0
  9. package/dist/core/LouterError.d.ts +7 -0
  10. package/dist/core/LouterError.d.ts.map +1 -0
  11. package/dist/core/LouterObject.d.ts +9 -0
  12. package/dist/core/LouterObject.d.ts.map +1 -0
  13. package/dist/core/LouterStage.d.ts +6 -0
  14. package/dist/core/LouterStage.d.ts.map +1 -0
  15. package/dist/core/LouterWarning.d.ts +7 -0
  16. package/dist/core/LouterWarning.d.ts.map +1 -0
  17. package/dist/core/LouterWarningType.d.ts +10 -0
  18. package/dist/core/LouterWarningType.d.ts.map +1 -0
  19. package/dist/core/types.d.ts +14 -0
  20. package/dist/core/types.d.ts.map +1 -0
  21. package/dist/core/util.d.ts +4 -0
  22. package/dist/core/util.d.ts.map +1 -0
  23. package/dist/export/LouterContentWriter.d.ts +12 -0
  24. package/dist/export/LouterContentWriter.d.ts.map +1 -0
  25. package/dist/export/LouterJsonSchemaWriter.d.ts +12 -0
  26. package/dist/export/LouterJsonSchemaWriter.d.ts.map +1 -0
  27. package/dist/index.cjs.js +170 -0
  28. package/dist/index.d.ts +31 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.es.js +14834 -0
  31. package/dist/loader/LouterFile.d.ts +8 -0
  32. package/dist/loader/LouterFile.d.ts.map +1 -0
  33. package/dist/loader/LouterFileLoader.d.ts +16 -0
  34. package/dist/loader/LouterFileLoader.d.ts.map +1 -0
  35. package/dist/node.cjs.js +1 -0
  36. package/dist/node.d.ts +10 -0
  37. package/dist/node.d.ts.map +1 -0
  38. package/dist/node.es.js +59 -0
  39. package/dist/parser/LouterJsonParser.d.ts +10 -0
  40. package/dist/parser/LouterJsonParser.d.ts.map +1 -0
  41. package/dist/parser/LouterYamlParser.d.ts +10 -0
  42. package/dist/parser/LouterYamlParser.d.ts.map +1 -0
  43. package/dist/util/file.d.ts +4 -0
  44. package/dist/util/file.d.ts.map +1 -0
  45. package/dist/validator/LouterValidator.d.ts +10 -0
  46. package/dist/validator/LouterValidator.d.ts.map +1 -0
  47. package/package.json +46 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A file loaded from somewhere
3
+ */
4
+ export interface LouterFile {
5
+ path: string;
6
+ data: string;
7
+ }
8
+ //# sourceMappingURL=LouterFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LouterFile.d.ts","sourceRoot":"","sources":["../../src/loader/LouterFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,16 @@
1
+ import { KindDefinitions } from '../core/types';
2
+ import { LouterStage } from '../core/LouterStage';
3
+ import { LouterContext } from '../core/LouterContext';
4
+ /**
5
+ * Loads local files using Node FileSystem
6
+ */
7
+ export declare class LouterFileLoader implements LouterStage {
8
+ private readonly _contentRoot;
9
+ constructor(contentRoot: string);
10
+ run<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
11
+ /**
12
+ * Recursively read all files
13
+ */
14
+ private getAllFiles;
15
+ }
16
+ //# sourceMappingURL=LouterFileLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LouterFileLoader.d.ts","sourceRoot":"","sources":["../../src/loader/LouterFileLoader.ts"],"names":[],"mappings":"AAEA,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;AAEhE;;GAEG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAElB,WAAW,EAAE,MAAM;IAIxB,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;IAU1E;;OAEG;IACH,OAAO,CAAC,WAAW;CAiBpB"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:fs"),n=require("node:path");class l{_contentRoot;constructor(e){this._contentRoot=e}run(e){const r=this.getAllFiles(this._contentRoot);e.files=r.map(t=>({path:t,data:o.readFileSync(t,"utf-8")}))}getAllFiles(e){const r=o.readdirSync(e,{withFileTypes:!0}),t=[];for(const i of r){const c=n.join(e,i.name);i.isDirectory()?t.push(...this.getAllFiles(c)):i.isFile()&&t.push(c)}return t}}class u{_directory;constructor(e=".louter"){this._directory=e}run(e){e.warnings.forEach(i=>{console.warn(i.path,i.message)}),o.mkdirSync(this._directory,{recursive:!0});const r=e.content,t=n.join(this._directory,"content.generated.json");o.writeFileSync(t,JSON.stringify(r,null,2))}}class a{_directory;constructor(e=".louter"){this._directory=e}run(e){o.mkdirSync(this._directory,{recursive:!0});for(const r in e.kinds){const t=e.kinds[r].toJSONSchema({io:"input"}),i=n.join(this._directory,`${r}.schema.json`);o.writeFileSync(i,JSON.stringify(t,null,2))}}}exports.LouterContentWriter=u;exports.LouterFileLoader=l;exports.LouterJsonSchemaWriter=a;
package/dist/node.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Loader
3
+ */
4
+ export { LouterFileLoader } from './loader/LouterFileLoader';
5
+ /**
6
+ * Export
7
+ */
8
+ export { LouterContentWriter } from './export/LouterContentWriter';
9
+ export { LouterJsonSchemaWriter } from './export/LouterJsonSchemaWriter';
10
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { readFileSync as u, readdirSync as a, mkdirSync as c, writeFileSync as l } from "node:fs";
2
+ import i from "node:path";
3
+ class f {
4
+ _contentRoot;
5
+ constructor(t) {
6
+ this._contentRoot = t;
7
+ }
8
+ run(t) {
9
+ const r = this.getAllFiles(this._contentRoot);
10
+ t.files = r.map((e) => ({
11
+ path: e,
12
+ data: u(e, "utf-8")
13
+ }));
14
+ }
15
+ /**
16
+ * Recursively read all files
17
+ */
18
+ getAllFiles(t) {
19
+ const r = a(t, { withFileTypes: !0 }), e = [];
20
+ for (const o of r) {
21
+ const n = i.join(t, o.name);
22
+ o.isDirectory() ? e.push(...this.getAllFiles(n)) : o.isFile() && e.push(n);
23
+ }
24
+ return e;
25
+ }
26
+ }
27
+ class y {
28
+ _directory;
29
+ constructor(t = ".louter") {
30
+ this._directory = t;
31
+ }
32
+ run(t) {
33
+ t.warnings.forEach((o) => {
34
+ console.warn(o.path, o.message);
35
+ }), c(this._directory, { recursive: !0 });
36
+ const r = t.content, e = i.join(this._directory, "content.generated.json");
37
+ l(e, JSON.stringify(r, null, 2));
38
+ }
39
+ }
40
+ class m {
41
+ _directory;
42
+ constructor(t = ".louter") {
43
+ this._directory = t;
44
+ }
45
+ run(t) {
46
+ c(this._directory, { recursive: !0 });
47
+ for (const r in t.kinds) {
48
+ const e = t.kinds[r].toJSONSchema({
49
+ io: "input"
50
+ }), o = i.join(this._directory, `${r}.schema.json`);
51
+ l(o, JSON.stringify(e, null, 2));
52
+ }
53
+ }
54
+ }
55
+ export {
56
+ y as LouterContentWriter,
57
+ f as LouterFileLoader,
58
+ m as LouterJsonSchemaWriter
59
+ };
@@ -0,0 +1,10 @@
1
+ import { KindDefinitions } from '../core/types';
2
+ import { LouterContext } from '../core/LouterContext';
3
+ import { LouterStage } from '../core/LouterStage';
4
+ /**
5
+ * Turns loaded files into objects by parsing JSON parsing them
6
+ */
7
+ export declare class LouterJsonParser implements LouterStage {
8
+ run<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
9
+ }
10
+ //# sourceMappingURL=LouterJsonParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LouterJsonParser.d.ts","sourceRoot":"","sources":["../../src/parser/LouterJsonParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;GAEG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAC3C,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;CAqC3E"}
@@ -0,0 +1,10 @@
1
+ import { KindDefinitions } from '../core/types';
2
+ import { LouterContext } from '../core/LouterContext';
3
+ import { LouterStage } from '../core/LouterStage';
4
+ /**
5
+ * Turns loaded files into objects by parsing YAML parsing them
6
+ */
7
+ export declare class LouterYamlParser implements LouterStage {
8
+ run<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
9
+ }
10
+ //# sourceMappingURL=LouterYamlParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LouterYamlParser.d.ts","sourceRoot":"","sources":["../../src/parser/LouterYamlParser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;GAEG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAC3C,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;CAgD3E"}
@@ -0,0 +1,4 @@
1
+ import { LouterFile } from '../loader/LouterFile';
2
+ export declare const getExtension: (file: LouterFile) => string | undefined;
3
+ export declare const getKind: (file: LouterFile) => string | undefined;
4
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/util/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,MAAM,UAAU,KAAG,MAAM,GAAG,SAKxD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,MAAM,UAAU,KAAG,MAAM,GAAG,SAMnD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { KindDefinitions } from '../core/types';
2
+ import { LouterStage } from '../core/LouterStage';
3
+ import { LouterContext } from '../core/LouterContext';
4
+ /**
5
+ * Validate all LouterObjects through their Zod schemas
6
+ */
7
+ export declare class LouterValidator implements LouterStage {
8
+ run<Kinds extends KindDefinitions>(ctx: LouterContext<Kinds>): void;
9
+ }
10
+ //# sourceMappingURL=LouterValidator.d.ts.map
@@ -0,0 +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;AAGhE;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;IACjD,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;CA6CpE"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@123ishatest/louter",
3
+ "private": false,
4
+ "version": "0.1.0",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.cjs.js"
13
+ },
14
+ "./node": {
15
+ "types": "./dist/node.d.ts",
16
+ "import": "./dist/node.es.js",
17
+ "require": "./dist/node.cjs.js"
18
+ }
19
+ },
20
+ "imports": {
21
+ "@louter/*": "./src/*"
22
+ },
23
+ "scripts": {
24
+ "build": "npm run check && vite build",
25
+ "check": "tsc -p ./tsconfig.build.json --noEmit",
26
+ "dev": "vite build --watch",
27
+ "lint": "prettier --check . && eslint .",
28
+ "test": "vitest",
29
+ "coverage": "vitest run --coverage"
30
+ },
31
+ "devDependencies": {
32
+ "@123ishatest/ludiek-eslint-config": "*",
33
+ "@123ishatest/ludiek-typescript-config": "*",
34
+ "@vitest/coverage-v8": "^4.0.6",
35
+ "jsdom": "^27.1.0",
36
+ "memfs": "^4.56.11",
37
+ "vite": "^7.0.5",
38
+ "vite-plugin-dts": "^4.5.4",
39
+ "vite-tsconfig-paths": "^5.1.4",
40
+ "vitest": "^4.0.6"
41
+ },
42
+ "dependencies": {
43
+ "yaml": "^2.8.2",
44
+ "zod": "^4.3.6"
45
+ }
46
+ }