dirac-lang 0.1.24 → 0.1.26
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/cli.js +13 -1
- package/lib/index.di +9 -0
- package/{examples/lib → lib}/math.di +3 -3
- package/package.json +13 -1
- package/.env.example +0 -8
- package/COMMUNITY.md +0 -465
- package/CONDITIONAL-TAGS.md +0 -172
- package/EXCEPTION-HANDLING.md +0 -156
- package/LIBRARIES.md +0 -172
- package/LLM-VALIDATION.md +0 -128
- package/NAMESPACES.md +0 -366
- package/PROMOTION.md +0 -257
- package/QUICKSTART-LIBRARY.md +0 -93
- package/TEST-COVERAGE.md +0 -113
- package/TESTING.md +0 -162
- package/config.test.yml +0 -5
- package/dirac-http/examples/demo.di +0 -9
- package/dirac-http/lib/index.di +0 -12
- package/examples/add-demo.di +0 -74
- package/examples/add.bk +0 -11
- package/examples/advanced-math-demo.di +0 -53
- package/examples/calculator.di +0 -32
- package/examples/compact-test.di +0 -6
- package/examples/comprehensive.bk +0 -29
- package/examples/defvar-variable-demo.di +0 -18
- package/examples/direct-call.di +0 -17
- package/examples/disk-analysis.di +0 -16
- package/examples/exception-demo.di +0 -82
- package/examples/executable-hello.di +0 -7
- package/examples/execute-demo.di +0 -38
- package/examples/file-manager.di +0 -77
- package/examples/file-stats.di +0 -18
- package/examples/hello.bk +0 -1
- package/examples/hello.di +0 -5
- package/examples/if-comparison.di +0 -91
- package/examples/if-cstyle-test.di +0 -149
- package/examples/if-vs-testif.di +0 -56
- package/examples/import-demo.di +0 -31
- package/examples/inline-test.bk +0 -7
- package/examples/llm-agent.di +0 -32
- package/examples/llm-basic.di +0 -12
- package/examples/llm-command-more.di +0 -6
- package/examples/llm-command-no-exec.di +0 -13
- package/examples/llm-command.di +0 -6
- package/examples/llm-complex.di +0 -141
- package/examples/llm-feedback-debug.di +0 -30
- package/examples/llm-feedback-demo.di +0 -19
- package/examples/llm-feedback-math.di +0 -22
- package/examples/llm-feedback-simple.di +0 -16
- package/examples/llm-feedback-sub.di +0 -22
- package/examples/llm-no-feedback.di +0 -10
- package/examples/llm-recursive.di +0 -31
- package/examples/llm-reflection-test.di +0 -19
- package/examples/llm-simple-test.di +0 -12
- package/examples/llm-subs.di +0 -132
- package/examples/llm-use-subs.di +0 -6
- package/examples/llm-validate-test.di +0 -18
- package/examples/loop.di +0 -12
- package/examples/math-test.di +0 -22
- package/examples/minimal-test.di +0 -13
- package/examples/mongodb-context-test.di +0 -27
- package/examples/mongodb-count-events.di +0 -8
- package/examples/mongodb-import-demo.di +0 -25
- package/examples/mongodb-simple-test.di +0 -18
- package/examples/nl-agent.di +0 -47
- package/examples/parameters-demo.di +0 -68
- package/examples/params-meta-test.di +0 -17
- package/examples/params-test.di +0 -10
- package/examples/recipe-chain.di +0 -38
- package/examples/recursive-llm.di +0 -44
- package/examples/sample-library/README.md +0 -152
- package/examples/sample-library/examples/demo.di +0 -34
- package/examples/sample-library/lib/index.di +0 -65
- package/examples/sample-library/package.json +0 -31
- package/examples/scope-test-nested.di +0 -60
- package/examples/scope-test.di +0 -55
- package/examples/seamless.di +0 -45
- package/examples/shell-test.bk +0 -10
- package/examples/simple-import.di +0 -13
- package/examples/simple-recursive.di +0 -26
- package/examples/story-builder.di +0 -45
- package/examples/subroutine.di +0 -23
- package/examples/system-llm.di +0 -21
- package/examples/system-simple.di +0 -3
- package/examples/system-test.di +0 -8
- package/examples/tag-check-test.di +0 -139
- package/examples/task-assistant.di +0 -27
- package/examples/test-if-demo.di +0 -110
- package/examples/test-parameters.di +0 -50
- package/examples/try-catch-test.di +0 -118
- package/examples/two-styles.di +0 -28
- package/examples/var-debug.di +0 -6
- package/examples/var-inline.di +0 -4
- package/examples/var-test2.di +0 -6
- package/examples/variable-replace.di +0 -25
- package/examples/variable-simple.di +0 -16
- package/examples/variable-test.di +0 -22
- package/examples/whitespace-test.di +0 -24
- package/filePath +0 -1
- package/greeting.txt +0 -1
- package/src/cli.ts +0 -140
- package/src/index.ts +0 -33
- package/src/llm/ollama.ts +0 -58
- package/src/runtime/braket-parser.ts +0 -234
- package/src/runtime/interpreter.ts +0 -203
- package/src/runtime/parser.ts +0 -155
- package/src/runtime/session.ts +0 -325
- package/src/tags/assign.ts +0 -37
- package/src/tags/attr.ts +0 -64
- package/src/tags/available-subroutines.ts +0 -70
- package/src/tags/call.ts +0 -259
- package/src/tags/catch.ts +0 -24
- package/src/tags/defvar.ts +0 -115
- package/src/tags/environment.ts +0 -21
- package/src/tags/eval.ts +0 -71
- package/src/tags/exception.ts +0 -20
- package/src/tags/execute.ts +0 -52
- package/src/tags/expr.ts +0 -128
- package/src/tags/foreach.ts +0 -170
- package/src/tags/if.ts +0 -191
- package/src/tags/import.ts +0 -135
- package/src/tags/index.ts +0 -41
- package/src/tags/input.ts +0 -182
- package/src/tags/llm.ts +0 -415
- package/src/tags/loop.ts +0 -43
- package/src/tags/mongodb.ts +0 -70
- package/src/tags/output.ts +0 -53
- package/src/tags/parameters.ts +0 -81
- package/src/tags/require_module.ts +0 -19
- package/src/tags/subroutine.ts +0 -75
- package/src/tags/system.ts +0 -93
- package/src/tags/tag-check.ts +0 -176
- package/src/tags/test-if.ts +0 -112
- package/src/tags/throw.ts +0 -26
- package/src/tags/try.ts +0 -19
- package/src/tags/variable.ts +0 -25
- package/src/test-runner.ts +0 -300
- package/src/types/index.ts +0 -128
- package/src/utils/llm-adapter.ts +0 -113
- package/src/utils/tag-validator.ts +0 -231
- package/test-available-extends.di +0 -28
- package/test-available-simple.di +0 -12
- package/test-available-subroutines.di +0 -16
- package/test-call.di +0 -9
- package/test-extend-basic.di +0 -17
- package/test-extend-chain.di +0 -26
- package/test-extend-debug.di +0 -17
- package/test-extend-debug2.di +0 -15
- package/test-extend-person.di +0 -17
- package/test-extend-simple.di +0 -11
- package/test-extend-zhi.di +0 -23
- package/test-extend.di +0 -19
- package/test-extend2.di +0 -26
- package/test-extend3-fixed.di +0 -23
- package/test-extend3-trouble.di +0 -23
- package/test-extend3.di +0 -21
- package/test-factorial.di +0 -19
- package/test-input-debug.di +0 -19
- package/test-nested-debug.di +0 -7
- package/test-nested-debug2.di +0 -8
- package/test-no-extend.di +0 -16
- package/test-simple-call.di +0 -7
- package/test-simple.di +0 -6
- package/tests/README.md +0 -69
- package/tests/assign-basic.test.di +0 -7
- package/tests/assign-from-eval.test.di +0 -7
- package/tests/available-subroutines-foreach.test.di +0 -32
- package/tests/basic-output.test.di +0 -5
- package/tests/call-basic.test.di +0 -11
- package/tests/call-with-output.test.di +0 -10
- package/tests/comments-before-content.test.di +0 -6
- package/tests/defvar-multiple.test.di +0 -8
- package/tests/environment-basic.test.di +0 -22
- package/tests/environment-nonexistent.test.di +0 -5
- package/tests/environment-with-defvar.test.di +0 -15
- package/tests/eval-basic.test.di +0 -6
- package/tests/eval-with-variables.test.di +0 -8
- package/tests/exception-basic.test.di +0 -10
- package/tests/expr-basic.test.di +0 -11
- package/tests/extend-basic.test.di +0 -19
- package/tests/extend-inheritance-chain.test.di +0 -26
- package/tests/extend-multiple-nested.test.di +0 -24
- package/tests/extend-self.test.di +0 -19
- package/tests/extend-with-parameters.test.di +0 -14
- package/tests/generate-dirac.test.di +0 -22
- package/tests/if-conditional.test.di +0 -17
- package/tests/if-else.test.di +0 -11
- package/tests/if-with-variables.test.di +0 -8
- package/tests/import-basic.test.di +0 -6
- package/tests/input-file-all.test.di +0 -5
- package/tests/input-file-line.test.di +0 -15
- package/tests/input-file-loop.test.di +0 -12
- package/tests/input-stdin-all.test.di +0 -8
- package/tests/input-stdin-all.txt +0 -1
- package/tests/llm-validate.test.di +0 -17
- package/tests/loop-basic.test.di +0 -9
- package/tests/loop-nested.test.di +0 -10
- package/tests/loop-with-eval.test.di +0 -8
- package/tests/no-root-element.test.di +0 -6
- package/tests/output-file.test.di +0 -19
- package/tests/output-multiple.test.di +0 -9
- package/tests/parameters-basic.test.di +0 -6
- package/tests/require-module-basic.test.di +0 -7
- package/tests/subroutine-basic.test.di +0 -9
- package/tests/subroutine-multiple-params.test.di +0 -10
- package/tests/subroutine-nested-calls.test.di +0 -32
- package/tests/subroutine-sequential-calls.test.di +0 -36
- package/tests/system-background.test.di +0 -39
- package/tests/system-basic.test.di +0 -5
- package/tests/tag-check.test.di +0 -27
- package/tests/test-if-basic.test.di +0 -8
- package/tests/test-input.txt +0 -3
- package/tests/try-catch-basic.test.di +0 -10
- package/tests/try-catch-eval-error.test.di +0 -10
- package/tests/variable-basic.test.di +0 -6
- package/tests/variable-interpolation.test.di +0 -7
- package/tools/create-library.sh +0 -175
- package/tsconfig.json +0 -19
- /package/{examples/lib → lib}/advanced-math.di +0 -0
- /package/{examples/lib → lib}/fileops.di +0 -0
- /package/{examples/lib → lib}/mongodb.di +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!-- TEST: subroutine_nested_calls_preserve_scope -->
|
|
2
|
-
<!-- EXPECT: main: a=x b=y c=z
|
|
3
|
-
outer: p=x q=y
|
|
4
|
-
inner: r=x s=y
|
|
5
|
-
outer after inner: p=x q=y
|
|
6
|
-
main after outer: a=x b=y c=z -->
|
|
7
|
-
<dirac>
|
|
8
|
-
<!-- Inner subroutine -->
|
|
9
|
-
<subroutine name="inner" param-r="string" param-s="string">
|
|
10
|
-
<output>inner: r=<variable name="r" /> s=<variable name="s" /></output>
|
|
11
|
-
</subroutine>
|
|
12
|
-
|
|
13
|
-
<!-- Outer subroutine that calls inner -->
|
|
14
|
-
<subroutine name="outer" param-p="string" param-q="string">
|
|
15
|
-
<output>outer: p=<variable name="p" /> q=<variable name="q" /></output>
|
|
16
|
-
<inner r="$p" s="$q" />
|
|
17
|
-
<output>outer after inner: p=<variable name="p" /> q=<variable name="q" /></output>
|
|
18
|
-
</subroutine>
|
|
19
|
-
|
|
20
|
-
<!-- Define main scope variables -->
|
|
21
|
-
<defvar name="a">x</defvar>
|
|
22
|
-
<defvar name="b">y</defvar>
|
|
23
|
-
<defvar name="c">z</defvar>
|
|
24
|
-
|
|
25
|
-
<output>main: a=<variable name="a" /> b=<variable name="b" /> c=<variable name="c" /></output>
|
|
26
|
-
|
|
27
|
-
<!-- Call outer which calls inner -->
|
|
28
|
-
<outer p="$a" q="$b" />
|
|
29
|
-
|
|
30
|
-
<!-- Verify main scope variables preserved -->
|
|
31
|
-
<output>main after outer: a=<variable name="a" /> b=<variable name="b" /> c=<variable name="c" /></output>
|
|
32
|
-
</dirac>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<!-- TEST: subroutine_sequential_calls_preserve_scope -->
|
|
2
|
-
<!-- EXPECT: x=a y=b z=c
|
|
3
|
-
first: x=a y=b
|
|
4
|
-
x=a y=b z=c
|
|
5
|
-
second: x=a y=b z=c
|
|
6
|
-
x=a y=b z=c -->
|
|
7
|
-
<dirac>
|
|
8
|
-
<!-- Define subroutines -->
|
|
9
|
-
<subroutine name="first-sub" param-x="string" param-y="string">
|
|
10
|
-
<output>first: x=<variable name="x" /> y=<variable name="y" /></output>
|
|
11
|
-
</subroutine>
|
|
12
|
-
|
|
13
|
-
<subroutine name="second-sub" param-x="string" param-y="string" param-z="string">
|
|
14
|
-
<output>second: x=<variable name="x" /> y=<variable name="y" /> z=<variable name="z" /></output>
|
|
15
|
-
</subroutine>
|
|
16
|
-
|
|
17
|
-
<!-- Define main scope variables -->
|
|
18
|
-
<defvar name="x">a</defvar>
|
|
19
|
-
<defvar name="y">b</defvar>
|
|
20
|
-
<defvar name="z">c</defvar>
|
|
21
|
-
|
|
22
|
-
<!-- Verify initial state -->
|
|
23
|
-
<output>x=<variable name="x" /> y=<variable name="y" /> z=<variable name="z" /></output>
|
|
24
|
-
|
|
25
|
-
<!-- First call -->
|
|
26
|
-
<first-sub x="$x" y="$y" />
|
|
27
|
-
|
|
28
|
-
<!-- Verify variables still exist after first call -->
|
|
29
|
-
<output>x=<variable name="x" /> y=<variable name="y" /> z=<variable name="z" /></output>
|
|
30
|
-
|
|
31
|
-
<!-- Second call - this would fail with the bug -->
|
|
32
|
-
<second-sub x="$x" y="$y" z="$z" />
|
|
33
|
-
|
|
34
|
-
<!-- Verify variables still exist after second call -->
|
|
35
|
-
<output>x=<variable name="x" /> y=<variable name="y" /> z=<variable name="z" /></output>
|
|
36
|
-
</dirac>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<dirac>
|
|
2
|
-
<output>Testing background processes with loop...</output>
|
|
3
|
-
|
|
4
|
-
<!-- Setup: Clean up old test files -->
|
|
5
|
-
<system>rm -f /tmp/dirac-bg-counter.txt</system>
|
|
6
|
-
|
|
7
|
-
<!-- Start a background process that writes incrementing numbers -->
|
|
8
|
-
<system background="true">(for i in 1 2 3 4 5; do echo "Count: $i"; sleep 1; done > /tmp/dirac-bg-counter.txt) &</system>
|
|
9
|
-
<output>✓ Background counter started</output>
|
|
10
|
-
|
|
11
|
-
<!-- This executes immediately without waiting -->
|
|
12
|
-
<output>✓ DIRAC continuing without blocking</output>
|
|
13
|
-
|
|
14
|
-
<!-- Wait a moment for background process to start writing -->
|
|
15
|
-
<system>sleep 2</system>
|
|
16
|
-
|
|
17
|
-
<!-- Read the results in a loop (3 times, showing progressive output) -->
|
|
18
|
-
<loop count="3">
|
|
19
|
-
<system>wc -l /tmp/dirac-bg-counter.txt 2>/dev/null || echo "0"</system>
|
|
20
|
-
<output>Check: Background file now has lines</output>
|
|
21
|
-
<system>sleep 1</system>
|
|
22
|
-
</loop>
|
|
23
|
-
|
|
24
|
-
<!-- Give background process time to finish all 5 counts -->
|
|
25
|
-
<system>sleep 2</system>
|
|
26
|
-
|
|
27
|
-
<!-- Verify final result contains all 5 counts -->
|
|
28
|
-
<system>wc -l /tmp/dirac-bg-counter.txt</system>
|
|
29
|
-
<output>✓ Background process completed</output>
|
|
30
|
-
|
|
31
|
-
<!-- Verify content -->
|
|
32
|
-
<system>grep -c "Count:" /tmp/dirac-bg-counter.txt</system>
|
|
33
|
-
<output>✓ Found all count entries</output>
|
|
34
|
-
|
|
35
|
-
<!-- Cleanup -->
|
|
36
|
-
<system>rm -f /tmp/dirac-bg-counter.txt</system>
|
|
37
|
-
|
|
38
|
-
<output>✓ Background process with loop test passed</output>
|
|
39
|
-
</dirac>
|
package/tests/tag-check.test.di
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<!-- TEST: tag_check_autocorrect -->
|
|
2
|
-
<!-- EXPECT: The tag <background-set> was auto-corrected to <background> (similarity: 0.84)
|
|
3
|
-
Color changed to: red -->
|
|
4
|
-
|
|
5
|
-
<dirac>
|
|
6
|
-
<subroutine name="background"
|
|
7
|
-
description="Change the background color"
|
|
8
|
-
param-color="string:required:Background color:red|blue|green">
|
|
9
|
-
<parameters select="@color"/>
|
|
10
|
-
<output>Color changed to: <variable name="color" /></output>
|
|
11
|
-
</subroutine>
|
|
12
|
-
|
|
13
|
-
<subroutine name="foreground"
|
|
14
|
-
description="Change the foreground text color"
|
|
15
|
-
param-color="string:required:Text color:black|white|gray">
|
|
16
|
-
<parameters select="@color"/>
|
|
17
|
-
<output>Text color changed to: <variable name="color" /></output>
|
|
18
|
-
</subroutine>
|
|
19
|
-
|
|
20
|
-
<!-- Test: tag-check should auto-correct similar tag names and execute -->
|
|
21
|
-
<defvar name="result">
|
|
22
|
-
<tag-check execute="true" autocorrect="true">
|
|
23
|
-
<background-set color="red" />
|
|
24
|
-
</tag-check>
|
|
25
|
-
</defvar>
|
|
26
|
-
<output><variable name="result" /></output>
|
|
27
|
-
</dirac>
|
package/tests/test-input.txt
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<!-- TEST: variable_interpolation -->
|
|
2
|
-
<!-- EXPECT: Hello, John! You are 25 years old. -->
|
|
3
|
-
<dirac>
|
|
4
|
-
<defvar name="name" value="John" />
|
|
5
|
-
<defvar name="age" value="25" />
|
|
6
|
-
<output>Hello, <variable name="name" />! You are <variable name="age" /> years old.</output>
|
|
7
|
-
</dirac>
|
package/tools/create-library.sh
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Create a new Dirac library with proper structure
|
|
3
|
-
|
|
4
|
-
if [ -z "$1" ]; then
|
|
5
|
-
echo "Usage: ./create-library.sh <library-name>"
|
|
6
|
-
echo "Example: ./create-library.sh crypto"
|
|
7
|
-
exit 1
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
LIBNAME="$1"
|
|
11
|
-
DIRNAME="dirac-$LIBNAME"
|
|
12
|
-
LIBNAME_UPPER=$(echo "$LIBNAME" | tr '[:lower:]' '[:upper:]')
|
|
13
|
-
|
|
14
|
-
echo "Creating Dirac library: $DIRNAME"
|
|
15
|
-
echo "Prefix convention: ${LIBNAME_UPPER}_"
|
|
16
|
-
echo ""
|
|
17
|
-
|
|
18
|
-
# Create directory structure
|
|
19
|
-
mkdir -p "$DIRNAME"/{lib,examples,tests}
|
|
20
|
-
|
|
21
|
-
# Create package.json
|
|
22
|
-
cat > "$DIRNAME/package.json" << EOF
|
|
23
|
-
{
|
|
24
|
-
"name": "dirac-$LIBNAME",
|
|
25
|
-
"version": "0.1.0",
|
|
26
|
-
"description": "$LIBNAME library for Dirac",
|
|
27
|
-
"main": "lib/index.di",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"test": "dirac tests/test.di",
|
|
30
|
-
"example": "dirac examples/demo.di"
|
|
31
|
-
},
|
|
32
|
-
"keywords": [
|
|
33
|
-
"dirac",
|
|
34
|
-
"$LIBNAME"
|
|
35
|
-
],
|
|
36
|
-
"author": "",
|
|
37
|
-
"license": "MIT",
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "https://github.com/yourusername/dirac-$LIBNAME"
|
|
41
|
-
},
|
|
42
|
-
"dirac": {
|
|
43
|
-
"version": ">=0.1.0"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
EOF
|
|
47
|
-
|
|
48
|
-
# Create lib/index.di
|
|
49
|
-
cat > "$DIRNAME/lib/index.di" << 'DIRAC_EOF'
|
|
50
|
-
<dirac>
|
|
51
|
-
|
|
52
|
-
<!-- All tags use the library prefix to avoid naming conflicts -->
|
|
53
|
-
<subroutine name="LIBPREFIX_EXAMPLE">
|
|
54
|
-
<eval>
|
|
55
|
-
const caller = getParams();
|
|
56
|
-
const input = caller.attributes.input || 'no input';
|
|
57
|
-
console.log('Processed: ' + input);
|
|
58
|
-
</eval>
|
|
59
|
-
</subroutine>
|
|
60
|
-
|
|
61
|
-
</dirac>
|
|
62
|
-
DIRAC_EOF
|
|
63
|
-
|
|
64
|
-
# Replace the placeholder with actual library name
|
|
65
|
-
sed -i '' "s/LIBPREFIX_/${LIBNAME_UPPER}_/g" "$DIRNAME/lib/index.di"
|
|
66
|
-
|
|
67
|
-
# Create examples/demo.di
|
|
68
|
-
cat > "$DIRNAME/examples/demo.di" << EOF
|
|
69
|
-
#!/usr/bin/env dirac
|
|
70
|
-
<dirac>
|
|
71
|
-
<import src="../lib/index.di"/>
|
|
72
|
-
|
|
73
|
-
<output>Demo: </output>
|
|
74
|
-
<${LIBNAME_UPPER}_EXAMPLE input="test"/>
|
|
75
|
-
</dirac>
|
|
76
|
-
EOF
|
|
77
|
-
|
|
78
|
-
chmod +x "$DIRNAME/examples/demo.di"
|
|
79
|
-
|
|
80
|
-
# Create tests/test.di
|
|
81
|
-
cat > "$DIRNAME/tests/test.di" << 'EOF'
|
|
82
|
-
#!/usr/bin/env dirac
|
|
83
|
-
<dirac>
|
|
84
|
-
<import src="../lib/index.di"/>
|
|
85
|
-
|
|
86
|
-
<output>Running tests... </output>
|
|
87
|
-
<EXAMPLE input="test"/>
|
|
88
|
-
<output>Tests passed! </output>
|
|
89
|
-
</dirac>
|
|
90
|
-
EOF
|
|
91
|
-
|
|
92
|
-
chmod +x "$DIRNAME/tests/test.di"
|
|
93
|
-
|
|
94
|
-
# Create README.md
|
|
95
|
-
cat > "$DIRNAME/README.md" << EOF
|
|
96
|
-
# dirac-$LIBNAME
|
|
97
|
-
|
|
98
|
-
$LIBNAME library for Dirac.
|
|
99
|
-
|
|
100
|
-
## Installation
|
|
101
|
-
|
|
102
|
-
\`\`\`bash
|
|
103
|
-
npm install dirac-$LIBNAME
|
|
104
|
-
\`\`\`
|
|
105
|
-
|
|
106
|
-
## Usage
|
|
107
|
-
|
|
108
|
-
\`\`\`xml
|
|
109
|
-
<dirac>
|
|
110
|
-
<import src="./node_modules/dirac-$LIBNAME/lib/index.di"/>
|
|
111
|
-
|
|
112
|
-
<EXAMPLE input="hello"/>
|
|
113
|
-
</dirac>
|
|
114
|
-
\`\`\`
|
|
115
|
-
|
|
116
|
-
## API
|
|
117
|
-
|
|
118
|
-
### EXAMPLE
|
|
119
|
-
|
|
120
|
-
**Attributes:**
|
|
121
|
-
- \`input\` (string) - Input text
|
|
122
|
-
|
|
123
|
-
## Development
|
|
124
|
-
|
|
125
|
-
\`\`\`bash
|
|
126
|
-
# Run examples
|
|
127
|
-
npm run example
|
|
128
|
-
|
|
129
|
-
# Run tests
|
|
130
|
-
npm test
|
|
131
|
-
\`\`\`
|
|
132
|
-
|
|
133
|
-
## License
|
|
134
|
-
|
|
135
|
-
MIT
|
|
136
|
-
EOF
|
|
137
|
-
|
|
138
|
-
# Create .gitignore
|
|
139
|
-
cat > "$DIRNAME/.gitignore" << 'EOF'
|
|
140
|
-
node_modules/
|
|
141
|
-
.DS_Store
|
|
142
|
-
*.log
|
|
143
|
-
EOF
|
|
144
|
-
|
|
145
|
-
# Create LICENSE
|
|
146
|
-
cat > "$DIRNAME/LICENSE" << 'EOF'
|
|
147
|
-
MIT License
|
|
148
|
-
|
|
149
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
150
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
151
|
-
in the Software without restriction, including without limitation the rights
|
|
152
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
153
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
154
|
-
furnished to do so, subject to the following conditions:
|
|
155
|
-
|
|
156
|
-
The above copyright notice and this permission notice shall be included in all
|
|
157
|
-
copies or substantial portions of the Software.
|
|
158
|
-
|
|
159
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
160
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
161
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
162
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
163
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
164
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
165
|
-
SOFTWARE.
|
|
166
|
-
EOF
|
|
167
|
-
|
|
168
|
-
echo "✅ Library created: $DIRNAME/"
|
|
169
|
-
echo ""
|
|
170
|
-
echo "Next steps:"
|
|
171
|
-
echo " cd $DIRNAME"
|
|
172
|
-
echo " npm run example # Test your library"
|
|
173
|
-
echo " npm test # Run tests"
|
|
174
|
-
echo " git init # Initialize git"
|
|
175
|
-
echo " npm publish # Publish to npm"
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"resolveJsonModule": true,
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"rootDir": "src",
|
|
10
|
-
"strict": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"declaration": true,
|
|
15
|
-
"sourceMap": true
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*"],
|
|
18
|
-
"exclude": ["node_modules", "dist"]
|
|
19
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|