@caleuche/core 0.1.2 → 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/LICENSE +22 -0
- package/dist/index.cjs.js +32 -6
- package/package.json +54 -53
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Brandon Miller
|
|
4
|
+
Copyright (c) 2025 Gerardo Lecaros
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/dist/index.cjs.js
CHANGED
|
@@ -8,9 +8,9 @@ function usings(...items) {
|
|
|
8
8
|
.map((u) => `using ${typeof u === "string" ? u : u.namespace};`)
|
|
9
9
|
.join("\n");
|
|
10
10
|
}
|
|
11
|
-
function valueOrEnvironment$
|
|
11
|
+
function valueOrEnvironment$3(useEnvironmentVariable, variableName, environmentVariable, value) {
|
|
12
12
|
if (useEnvironmentVariable && environmentVariable) {
|
|
13
|
-
return `var ${variableName} = Environment.GetEnvironmentVariable("${environmentVariable}") ?? throw new InvalidOperationException("${environmentVariable} environment variable is not set.")
|
|
13
|
+
return `var ${variableName} = Environment.GetEnvironmentVariable("${environmentVariable}") ?? throw new InvalidOperationException("${environmentVariable} environment variable is not set.");`;
|
|
14
14
|
}
|
|
15
15
|
else if (value) {
|
|
16
16
|
return `const string ${variableName} = "${value}";`;
|
|
@@ -23,7 +23,7 @@ function valueOrEnvironment$2(useEnvironmentVariable, variableName, environmentV
|
|
|
23
23
|
var csharp = /*#__PURE__*/Object.freeze({
|
|
24
24
|
__proto__: null,
|
|
25
25
|
usings: usings,
|
|
26
|
-
valueOrEnvironment: valueOrEnvironment$
|
|
26
|
+
valueOrEnvironment: valueOrEnvironment$3
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
function includes(...items) {
|
|
@@ -47,7 +47,7 @@ function includes(...items) {
|
|
|
47
47
|
imports += "\n)";
|
|
48
48
|
return imports;
|
|
49
49
|
}
|
|
50
|
-
function valueOrEnvironment$
|
|
50
|
+
function valueOrEnvironment$2(useEnvironmentVariable, variableName, environmentVariable, value, indentationLevel = 1) {
|
|
51
51
|
if (!variableName) {
|
|
52
52
|
throw new Error("Variable name must be provided.");
|
|
53
53
|
}
|
|
@@ -70,10 +70,10 @@ function valueOrEnvironment$1(useEnvironmentVariable, variableName, environmentV
|
|
|
70
70
|
var go = /*#__PURE__*/Object.freeze({
|
|
71
71
|
__proto__: null,
|
|
72
72
|
includes: includes,
|
|
73
|
-
valueOrEnvironment: valueOrEnvironment$
|
|
73
|
+
valueOrEnvironment: valueOrEnvironment$2
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
function valueOrEnvironment(useEnvironmentVariable, variableName, environmentVariable, value, indentationLevel = 0) {
|
|
76
|
+
function valueOrEnvironment$1(useEnvironmentVariable, variableName, environmentVariable, value, indentationLevel = 0) {
|
|
77
77
|
if (!variableName) {
|
|
78
78
|
throw new Error("Variable name must be provided.");
|
|
79
79
|
}
|
|
@@ -92,6 +92,31 @@ function valueOrEnvironment(useEnvironmentVariable, variableName, environmentVar
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
var python = /*#__PURE__*/Object.freeze({
|
|
95
|
+
__proto__: null,
|
|
96
|
+
valueOrEnvironment: valueOrEnvironment$1
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
function valueOrEnvironment(useEnvironmentVariable, variableName, environmentVariable, value, indentationLevel = 1) {
|
|
100
|
+
if (!variableName) {
|
|
101
|
+
throw new Error("Variable name must be provided.");
|
|
102
|
+
}
|
|
103
|
+
const indent = " ".repeat(indentationLevel);
|
|
104
|
+
if (useEnvironmentVariable && environmentVariable) {
|
|
105
|
+
return (`String ${variableName} = System.getenv("${environmentVariable}");\n` +
|
|
106
|
+
`${indent}if (${variableName} == null || ${variableName}.isEmpty()) {\n` +
|
|
107
|
+
`${indent} System.out.println("Please set the ${environmentVariable} environment variable.");\n` +
|
|
108
|
+
`${indent} System.exit(1);\n` +
|
|
109
|
+
`${indent}}`);
|
|
110
|
+
}
|
|
111
|
+
else if (value) {
|
|
112
|
+
return `String ${variableName} = "${value}";`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
throw new Error("No value provided for variable or environment variable.");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var java = /*#__PURE__*/Object.freeze({
|
|
95
120
|
__proto__: null,
|
|
96
121
|
valueOrEnvironment: valueOrEnvironment
|
|
97
122
|
});
|
|
@@ -200,6 +225,7 @@ function compileSample(sample, input, options) {
|
|
|
200
225
|
csharp: csharp,
|
|
201
226
|
go: go,
|
|
202
227
|
python: python,
|
|
228
|
+
java: java,
|
|
203
229
|
},
|
|
204
230
|
});
|
|
205
231
|
const targetFileName = getTargetFileName(sample);
|
package/package.json
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@caleuche/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"main": "dist/index.cjs.js",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": {
|
|
7
|
-
"types": "./dist/types/index.d.ts",
|
|
8
|
-
"import": "./dist/index.esm.js",
|
|
9
|
-
"require": "./dist/index.cjs.js"
|
|
10
|
-
},
|
|
11
|
-
"./package.json": "./package.json"
|
|
12
|
-
},
|
|
13
|
-
"types": "dist/types/index.d.ts",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "rollup -c",
|
|
16
|
-
"build:watch": "rollup -c -w",
|
|
17
|
-
"build:clean": "rimraf dist && rollup -c",
|
|
18
|
-
"build:clean:watch": "rimraf dist && rollup -c -w",
|
|
19
|
-
"clean": "rimraf dist",
|
|
20
|
-
"format": "prettier --write .",
|
|
21
|
-
"
|
|
22
|
-
},
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"description": "",
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "https://github.com/brandor64/caleuche"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"lodash": "^4.17.21",
|
|
32
|
-
"tslib": "^2.8.1"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@rollup/plugin-commonjs": "^28.0.3",
|
|
36
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
37
|
-
"@rollup/plugin-typescript": "^12.1.2",
|
|
38
|
-
"@types/lodash": "^4.17.17",
|
|
39
|
-
"prettier": "^3.5.3",
|
|
40
|
-
"rimraf": "^6.0.1",
|
|
41
|
-
"rollup": "^4.42.0",
|
|
42
|
-
"typescript": "^5.8.3"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"./project-templates/
|
|
47
|
-
"./project-templates/
|
|
48
|
-
"./project-templates/
|
|
49
|
-
"./project-templates/
|
|
50
|
-
"./project-templates/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@caleuche/core",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"main": "dist/index.cjs.js",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"import": "./dist/index.esm.js",
|
|
9
|
+
"require": "./dist/index.cjs.js"
|
|
10
|
+
},
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"types": "dist/types/index.d.ts",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "rollup -c",
|
|
16
|
+
"build:watch": "rollup -c -w",
|
|
17
|
+
"build:clean": "rimraf dist && rollup -c",
|
|
18
|
+
"build:clean:watch": "rimraf dist && rollup -c -w",
|
|
19
|
+
"clean": "rimraf dist",
|
|
20
|
+
"format": "prettier --write .",
|
|
21
|
+
"test": "vitest run"
|
|
22
|
+
},
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"description": "",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/brandor64/caleuche"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"lodash": "^4.17.21",
|
|
32
|
+
"tslib": "^2.8.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
36
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
37
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
38
|
+
"@types/lodash": "^4.17.17",
|
|
39
|
+
"prettier": "^3.5.3",
|
|
40
|
+
"rimraf": "^6.0.1",
|
|
41
|
+
"rollup": "^4.42.0",
|
|
42
|
+
"typescript": "^5.8.3",
|
|
43
|
+
"vitest": "^3.2.3"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"./project-templates/Sample.csproj.template",
|
|
47
|
+
"./project-templates/go.mod.template",
|
|
48
|
+
"./project-templates/package.json.template",
|
|
49
|
+
"./project-templates/pom.xml.template",
|
|
50
|
+
"./project-templates/requirements.txt.template",
|
|
51
|
+
"./project-templates/Sample.csproj.template"
|
|
52
|
+
],
|
|
53
|
+
"bin": {}
|
|
54
|
+
}
|