@sealcode/jdd 0.8.0 → 0.8.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.
@@ -1 +0,0 @@
1
- {"parent":null,"pid":462274,"argv":["/home/kuba/.nvm/versions/node/v21.7.3/bin/node","/home/kuba/projects/sealcode/jdd/node_modules/.bin/mocha","--recursive","--timeout=10000","--require","source-map-support/register","--reporter","xunit","--reporter-option","output=.xunit","lib-instrumented/**/*.test.js"],"execArgv":[],"cwd":"/home/kuba/projects/sealcode/jdd","time":1743863846962,"ppid":462263,"coverageFilename":"/home/kuba/projects/sealcode/jdd/.nyc_output/6ab070a1-a0bc-4366-9217-9549668af832.json","externalId":"","uuid":"6ab070a1-a0bc-4366-9217-9549668af832","files":["/home/kuba/projects/sealcode/jdd/lib/api.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-argument.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/container-argument.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/list.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/file.js","/home/kuba/projects/sealcode/jdd/lib/utils/module-dirname.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/image.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/string-based-argument.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/short-text.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/structured.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/number.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/enum.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/markdown.js","/home/kuba/projects/sealcode/jdd/lib/component.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/url.js","/home/kuba/projects/sealcode/jdd/lib/utils/insert_nbsp.js","/home/kuba/projects/sealcode/jdd/lib/hyphenation.js","/home/kuba/projects/sealcode/jdd/lib/registry.js","/home/kuba/projects/sealcode/jdd/lib/jdd-context.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-arguments.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/enum.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/file.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/list.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/structured.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/table.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/table.test.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/single-reference.js","/home/kuba/projects/sealcode/jdd/lib/clumps.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/nested-component.js","/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-arguments.js","/home/kuba/projects/sealcode/jdd/lib/document.js","/home/kuba/projects/sealcode/jdd/lib/jdd.js","/home/kuba/projects/sealcode/jdd/lib/index.js","/home/kuba/projects/sealcode/jdd/lib/component.test.js","/home/kuba/projects/sealcode/jdd/lib/components/markdown.js","/home/kuba/projects/sealcode/jdd/lib/test-utils/prettier.js","/home/kuba/projects/sealcode/jdd/lib/test-utils/simplest-context.js","/home/kuba/projects/sealcode/jdd/lib/components/markdown.test.js","/home/kuba/projects/sealcode/jdd/lib/document.test.js","/home/kuba/projects/sealcode/jdd/lib/jdd.test.js","/home/kuba/projects/sealcode/jdd/lib/markdown.test.js","/home/kuba/projects/sealcode/jdd/lib/render.test.js","/home/kuba/projects/sealcode/jdd/lib/utils/insert_nbsp.test.js"]}
@@ -1 +0,0 @@
1
- {"processes":{"6ab070a1-a0bc-4366-9217-9549668af832":{"parent":null,"children":[]}},"files":{"/home/kuba/projects/sealcode/jdd/lib/api.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-argument.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/container-argument.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/list.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/file.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/utils/module-dirname.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/image.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/string-based-argument.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/short-text.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/structured.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/number.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/enum.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/markdown.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/url.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/utils/insert_nbsp.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/hyphenation.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/registry.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/jdd-context.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-arguments.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/enum.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/file.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/list.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/structured.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/table.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/table.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/single-reference.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/clumps.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/nested-component.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component-arguments/component-arguments.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/document.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/jdd.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/index.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/component.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/components/markdown.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/test-utils/prettier.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/test-utils/simplest-context.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/components/markdown.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/document.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/jdd.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/markdown.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/render.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"],"/home/kuba/projects/sealcode/jdd/lib/utils/insert_nbsp.test.js":["6ab070a1-a0bc-4366-9217-9549668af832"]},"externalIds":{}}
package/.xunit DELETED
@@ -1,44 +0,0 @@
1
- <testsuite name="Mocha Tests" tests="42" failures="0" errors="0" skipped="0" timestamp="Sat, 05 Apr 2025 14:37:27 GMT" time="0.159">
2
- <testcase classname="component arguments" name="handles nesting objects and arrays" time="0.001"/>
3
- <testcase classname="component arguments" name="handles enums" time="0"/>
4
- <testcase classname="component arguments" name="Gives a nice example" time="0"/>
5
- <testcase classname="component arguments" name="allows for chaining methods when setting example values" time="0"/>
6
- <testcase classname="component arguments Word counting" name="Image argument" time="0.001"/>
7
- <testcase classname="component arguments Word counting" name="Enum argument" time="0"/>
8
- <testcase classname="component arguments Word counting" name="ShortText argument" time="0"/>
9
- <testcase classname="component arguments Word counting" name="ShortText argument" time="0"/>
10
- <testcase classname="component arguments Word counting" name="MarkdownArgument argument" time="0"/>
11
- <testcase classname="component arguments Word counting" name="List argument" time="0"/>
12
- <testcase classname="component arguments Word counting" name="Structured argument" time="0"/>
13
- <testcase classname="component arguments List argument" name="Generates example values from provided examples, if they are provided" time="0.001"/>
14
- <testcase classname="component arguments test URL component argument class" name="allows for chaining methods when setting example values" time="0"/>
15
- <testcase classname="component arguments test URL component argument class" name="returns example url of type based on specyfic urlType argument" time="0"/>
16
- <testcase classname="component arguments test URL component argument class" name="returns correct component argument type" time="0"/>
17
- <testcase classname="component arguments test Number component argument" name="Generates example values from provided values, if they are provided" time="0"/>
18
- <testcase classname="component arguments test Number component argument" name="Generates example value in compliance with given min, max and range constrains" time="0"/>
19
- <testcase classname="component arguments test Number component argument" name="Returns expected type, empty value and count words number" time="0"/>
20
- <testcase classname="enum argument" name="uses only the example values if provided when running getExampleValues" time="0"/>
21
- <testcase classname="File field" name="Properly describes the parsed value" time="0"/>
22
- <testcase classname="list" name="allows for creating a list of images" time="0"/>
23
- <testcase classname="list" name="properly parses list arguments" time="0"/>
24
- <testcase classname="list" name="handles undefined value" time="0.001"/>
25
- <testcase classname="structured argument" name="properly extracts parsed type" time="0"/>
26
- <testcase classname="structured argument" name="properly extracts parsed type within a list" time="0"/>
27
- <testcase classname="structured argument" name="uses the provided object as an example value if set" time="0"/>
28
- <testcase classname="table argument" name="properly parses type value" time="0"/>
29
- <testcase classname="table argument" name="properly respects custom set example value" time="0"/>
30
- <testcase classname="component class" name="Doesn&#x27;t fail if provided with unknown arguments" time="0"/>
31
- <testcase classname="component class getSubArgument" name="traverses argument path that includes a table" time="0.001"/>
32
- <testcase classname="markdown component" name="renders as a part of a JDD" time="0.04"/>
33
- <testcase classname="markdown component" name="properly returns the headings" time="0.002"/>
34
- <testcase classname="markdown component" name="allows for nbsp in headings" time="0.006"/>
35
- <testcase classname="markdown component" name="doesn&#x27;t add nbsp to code blocks" time="0.002"/>
36
- <testcase classname="document" name="converts from parsed to storage" time="0"/>
37
- <testcase classname="jdd" name="properly extracts headings from multiple components" time="0"/>
38
- <testcase classname="jdd" name="properly extracts css clumps" time="0.001"/>
39
- <testcase classname="markdown" name="does not insert soft hyphens into links" time="0"/>
40
- <testcase classname="render method renderFromStorage" name="renders from a raw document" time="0.101"/>
41
- <testcase classname="create non braking space util" name="should replace space for one letter word with non braking space" time="0"/>
42
- <testcase classname="create non braking space util" name="should keep original copy if there isn&#x27;t any one letter word" time="0"/>
43
- <testcase classname="create non braking space util" name="shold find one letter word on first position" time="0"/>
44
- </testsuite>
@@ -1,15 +0,0 @@
1
- import { ComponentArgument } from "./component-argument.js";
2
- import { ContainerArgument } from "./container-argument.js";
3
- import { Registry } from "../registry.js";
4
- import { JDDContext } from "../jdd-context.js";
5
- export declare class Component extends ContainerArgument<Record<string, unknown>, Record<string, unknown>> {
6
- registry: Registry;
7
- constructor(registry: Registry);
8
- getTypeName(): string;
9
- getStructure(component_name: string): Record<string, ComponentArgument<unknown>>;
10
- getSubArgument([key, ...rest]: string[], value: Record<string, unknown>): readonly [ComponentArgument<any> | null, string[], unknown];
11
- countWords(value: Record<string, unknown>): number;
12
- getEmptyValue(context: JDDContext): Promise<Record<string, unknown>>;
13
- getExampleValue(context: JDDContext): Promise<Record<string, unknown>>;
14
- processAllSubarguments(_context: JDDContext, input: unknown, processing_function: (argument: ComponentArgument<unknown>, value: unknown) => Promise<unknown>): Promise<Record<string, unknown> | Record<string, unknown>[]>;
15
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,68 +0,0 @@
1
- export type ExtractComponentArgumentValue<C> = C extends ComponentArgument<infer T> ? T : never;
2
- export type ExtractStructuredComponentArgumentsValues<C> = {
3
- [property in keyof C]: ExtractComponentArgumentValue<C[property]>;
4
- };
5
- export type T = ExtractComponentArgumentValue<Structured<any>>;
6
- export declare abstract class ComponentArgument<ARG> {
7
- example_values: ARG[];
8
- abstract getTypeName(): string;
9
- abstract getEmptyValue(): ARG;
10
- getExampleValue(): ARG;
11
- setExampleValues(values: ARG[]): this;
12
- }
13
- export declare class ShortText extends ComponentArgument<string> {
14
- example_values: string[];
15
- getTypeName(): string;
16
- getEmptyValue(): string;
17
- }
18
- export declare class MarkdownArgument extends ComponentArgument<string> {
19
- getTypeName(): string;
20
- getEmptyValue(): string;
21
- example_values: string[];
22
- }
23
- export declare class List<T extends ComponentArgument<unknown>> extends ComponentArgument<Array<ExtractComponentArgumentValue<T>>> {
24
- item_type: T;
25
- constructor(item_type: T);
26
- getTypeName(): string;
27
- getEmptyValue(): never[];
28
- getExampleValue(): ExtractComponentArgumentValue<T>[];
29
- }
30
- export declare class Structured<T extends Record<string, ComponentArgument<unknown>>> extends ComponentArgument<{
31
- [property in keyof T]: ExtractComponentArgumentValue<T[property]>;
32
- }> {
33
- structure: T;
34
- constructor(structure: T);
35
- getTypeName(): string;
36
- getEmptyValue(): { [property in keyof T]: ExtractComponentArgumentValue<T[property]>; };
37
- getExampleValue(): { [property in keyof T]: ExtractComponentArgumentValue<T[property]>; };
38
- }
39
- export declare class Enum<T extends string> extends ComponentArgument<T> {
40
- readonly values: Readonly<T[]>;
41
- constructor(values: Readonly<T[]>);
42
- getTypeName(): string;
43
- getEmptyValue(): T;
44
- getExampleValue(): T;
45
- }
46
- export declare class Image extends ComponentArgument<string> {
47
- path_to_image_on_fs: string;
48
- constructor(path_to_image_on_fs: string);
49
- getTypeName(): string;
50
- getEmptyValue(): string;
51
- getExampleValue(): string;
52
- }
53
- export declare class URL extends ComponentArgument<string> {
54
- readonly urlType: Readonly<"relative" | "absolute">;
55
- constructor(urlType: Readonly<"relative" | "absolute">);
56
- getTypeName(): string;
57
- getEmptyValue(): string;
58
- getExampleValue(): "/example" | "https://example.com";
59
- }
60
- export declare const ComponentArguments: {
61
- Image: typeof Image;
62
- Structured: typeof Structured;
63
- List: typeof List;
64
- Markdown: typeof MarkdownArgument;
65
- ShortText: typeof ShortText;
66
- Enum: typeof Enum;
67
- URL: typeof URL;
68
- };
@@ -1 +0,0 @@
1
- export {};