@caatinga/core 3.0.0 → 3.0.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.
- package/README.md +11 -11
- package/dist/artifact.schema-D4r8dyYK.d.cts +185 -0
- package/dist/artifact.schema-D4r8dyYK.d.ts +185 -0
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/index.cjs +202 -154
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +202 -154
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -211,9 +211,7 @@ function formatCause(cause) {
|
|
|
211
211
|
// src/version.ts
|
|
212
212
|
var import_node_module = require("module");
|
|
213
213
|
var import_meta = {};
|
|
214
|
-
var require2 = (0, import_node_module.createRequire)(
|
|
215
|
-
typeof __filename === "string" ? __filename : import_meta.url
|
|
216
|
-
);
|
|
214
|
+
var require2 = (0, import_node_module.createRequire)(typeof __filename === "string" ? __filename : import_meta.url);
|
|
217
215
|
var CAATINGA_CORE_VERSION = require2("../package.json").version;
|
|
218
216
|
|
|
219
217
|
// src/config/config.schema.ts
|
|
@@ -861,12 +859,7 @@ function matchesWellKnownNetwork(name, config) {
|
|
|
861
859
|
return known.rpcUrl === config.rpcUrl && known.networkPassphrase === config.networkPassphrase;
|
|
862
860
|
}
|
|
863
861
|
function buildRpcNetworkArgs(config) {
|
|
864
|
-
return [
|
|
865
|
-
"--rpc-url",
|
|
866
|
-
config.rpcUrl,
|
|
867
|
-
"--network-passphrase",
|
|
868
|
-
config.networkPassphrase
|
|
869
|
-
];
|
|
862
|
+
return ["--rpc-url", config.rpcUrl, "--network-passphrase", config.networkPassphrase];
|
|
870
863
|
}
|
|
871
864
|
function buildStellarNetworkArgsFromConfig(config) {
|
|
872
865
|
for (const [name, known] of Object.entries(WELL_KNOWN_NETWORKS)) {
|
|
@@ -920,19 +913,23 @@ async function fetchCreateContractSalt(horizonUrl, transactionHash, fetchImpl =
|
|
|
920
913
|
}
|
|
921
914
|
async function resolveContractIdFromDeploySalt(options) {
|
|
922
915
|
const saltHex = decimalSaltToHex(options.salt);
|
|
923
|
-
const result = await runCommand(
|
|
924
|
-
"
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
916
|
+
const result = await runCommand(
|
|
917
|
+
"stellar",
|
|
918
|
+
[
|
|
919
|
+
"contract",
|
|
920
|
+
"id",
|
|
921
|
+
"wasm",
|
|
922
|
+
"--salt",
|
|
923
|
+
saltHex,
|
|
924
|
+
"--source-account",
|
|
925
|
+
options.source,
|
|
926
|
+
...buildStellarNetworkArgsFromConfig(options.network)
|
|
927
|
+
],
|
|
928
|
+
{
|
|
929
|
+
cwd: options.cwd,
|
|
930
|
+
skipStellarVersionCheck: true
|
|
931
|
+
}
|
|
932
|
+
);
|
|
936
933
|
return parseContractId(result.all || `${result.stdout}
|
|
937
934
|
${result.stderr}`);
|
|
938
935
|
}
|
|
@@ -1080,8 +1077,12 @@ function buildAlternateWasmCandidates(configuredWasmPath, options) {
|
|
|
1080
1077
|
addCandidate(import_node_path8.default.join(cargoTargetDir, LEGACY_RUST_WASM_TARGET, "release", fileName));
|
|
1081
1078
|
}
|
|
1082
1079
|
if (options?.sourcePath) {
|
|
1083
|
-
addCandidate(
|
|
1084
|
-
|
|
1080
|
+
addCandidate(
|
|
1081
|
+
import_node_path8.default.join(options.sourcePath, "target", CURRENT_RUST_WASM_TARGET, "release", fileName)
|
|
1082
|
+
);
|
|
1083
|
+
addCandidate(
|
|
1084
|
+
import_node_path8.default.join(options.sourcePath, "target", LEGACY_RUST_WASM_TARGET, "release", fileName)
|
|
1085
|
+
);
|
|
1085
1086
|
}
|
|
1086
1087
|
return candidates;
|
|
1087
1088
|
}
|
|
@@ -1496,17 +1497,21 @@ function toSkippedContract(name, contractId, network) {
|
|
|
1496
1497
|
// src/contracts/verify-dependency-contract.ts
|
|
1497
1498
|
async function verifyDependencyContract(options) {
|
|
1498
1499
|
try {
|
|
1499
|
-
await runCommand(
|
|
1500
|
-
"
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1500
|
+
await runCommand(
|
|
1501
|
+
"stellar",
|
|
1502
|
+
[
|
|
1503
|
+
"contract",
|
|
1504
|
+
"info",
|
|
1505
|
+
"interface",
|
|
1506
|
+
"--contract-id",
|
|
1507
|
+
options.contractId,
|
|
1508
|
+
...buildStellarNetworkArgs(options.network)
|
|
1509
|
+
],
|
|
1510
|
+
{
|
|
1511
|
+
cwd: options.cwd,
|
|
1512
|
+
failureCode: CaatingaErrorCode.DEPENDENCY_CONTRACT_NOT_FOUND
|
|
1513
|
+
}
|
|
1514
|
+
);
|
|
1510
1515
|
} catch (error) {
|
|
1511
1516
|
if (error instanceof CaatingaError && error.code === CaatingaErrorCode.DEPENDENCY_CONTRACT_NOT_FOUND) {
|
|
1512
1517
|
throw new CaatingaError(
|
|
@@ -1568,9 +1573,7 @@ async function deployContractGraph(options) {
|
|
|
1568
1573
|
network: network.name
|
|
1569
1574
|
});
|
|
1570
1575
|
if (existing?.contractId && !options.force) {
|
|
1571
|
-
skippedContracts.push(
|
|
1572
|
-
toSkippedContract(contractName, existing.contractId, network.name)
|
|
1573
|
-
);
|
|
1576
|
+
skippedContracts.push(toSkippedContract(contractName, existing.contractId, network.name));
|
|
1574
1577
|
continue;
|
|
1575
1578
|
}
|
|
1576
1579
|
const result = await deployContract({
|
|
@@ -1591,9 +1594,7 @@ async function deployContractGraph(options) {
|
|
|
1591
1594
|
});
|
|
1592
1595
|
}
|
|
1593
1596
|
if (result.skipped) {
|
|
1594
|
-
skippedContracts.push(
|
|
1595
|
-
toSkippedContract(contractName, result.contractId, network.name)
|
|
1596
|
-
);
|
|
1597
|
+
skippedContracts.push(toSkippedContract(contractName, result.contractId, network.name));
|
|
1597
1598
|
} else {
|
|
1598
1599
|
deployedContracts.push({ name: contractName, contractId: result.contractId });
|
|
1599
1600
|
}
|
|
@@ -1654,22 +1655,26 @@ async function generateBindings(options) {
|
|
|
1654
1655
|
}
|
|
1655
1656
|
const outputDir = import_node_path10.default.resolve(cwd, options.config.frontend.bindingsOutput, options.contractName);
|
|
1656
1657
|
await (0, import_promises7.mkdir)(outputDir, { recursive: true });
|
|
1657
|
-
const result = await runCommand(
|
|
1658
|
-
"
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1658
|
+
const result = await runCommand(
|
|
1659
|
+
"npx",
|
|
1660
|
+
[
|
|
1661
|
+
"--yes",
|
|
1662
|
+
"@stellar/stellar-sdk",
|
|
1663
|
+
"generate",
|
|
1664
|
+
"--contract-id",
|
|
1665
|
+
contractArtifact.contractId,
|
|
1666
|
+
"--output-dir",
|
|
1667
|
+
outputDir,
|
|
1668
|
+
"--contract-name",
|
|
1669
|
+
options.contractName,
|
|
1670
|
+
"--overwrite",
|
|
1671
|
+
...buildGenerateNetworkArgs(network)
|
|
1672
|
+
],
|
|
1673
|
+
{
|
|
1674
|
+
cwd,
|
|
1675
|
+
failureCode: CaatingaErrorCode.BINDINGS_FAILED
|
|
1676
|
+
}
|
|
1677
|
+
);
|
|
1673
1678
|
const legacyStubRemoved = await removeLegacyBindingStub(
|
|
1674
1679
|
cwd,
|
|
1675
1680
|
options.config.frontend.bindingsOutput,
|
|
@@ -1781,21 +1786,25 @@ async function invokeContract(options) {
|
|
|
1781
1786
|
await checkBinary("stellar", "Install Stellar CLI before running caatinga invoke.");
|
|
1782
1787
|
let result;
|
|
1783
1788
|
try {
|
|
1784
|
-
result = await runCommand(
|
|
1785
|
-
"
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1789
|
+
result = await runCommand(
|
|
1790
|
+
"stellar",
|
|
1791
|
+
[
|
|
1792
|
+
"contract",
|
|
1793
|
+
"invoke",
|
|
1794
|
+
"--id",
|
|
1795
|
+
contractArtifact.contractId,
|
|
1796
|
+
"--source-account",
|
|
1797
|
+
source,
|
|
1798
|
+
...buildStellarNetworkArgs(network),
|
|
1799
|
+
"--",
|
|
1800
|
+
target.method,
|
|
1801
|
+
...options.args ?? []
|
|
1802
|
+
],
|
|
1803
|
+
{
|
|
1804
|
+
cwd,
|
|
1805
|
+
failureCode: CaatingaErrorCode.INVOKE_FAILED
|
|
1806
|
+
}
|
|
1807
|
+
);
|
|
1799
1808
|
} catch (error) {
|
|
1800
1809
|
if (error instanceof CaatingaError && error.code === CaatingaErrorCode.INVOKE_FAILED && isReadCallFailure(error)) {
|
|
1801
1810
|
throw new CaatingaError(
|
|
@@ -1940,12 +1949,7 @@ function formatTemplateCompatibilityHint(issue) {
|
|
|
1940
1949
|
}
|
|
1941
1950
|
|
|
1942
1951
|
// src/templates/create-project-from-template.ts
|
|
1943
|
-
var TEMPLATE_COPY_EXCLUDED_DIRS = /* @__PURE__ */ new Set([
|
|
1944
|
-
"target",
|
|
1945
|
-
"test_snapshots",
|
|
1946
|
-
"node_modules",
|
|
1947
|
-
".git"
|
|
1948
|
-
]);
|
|
1952
|
+
var TEMPLATE_COPY_EXCLUDED_DIRS = /* @__PURE__ */ new Set(["target", "test_snapshots", "node_modules", ".git"]);
|
|
1949
1953
|
async function createProjectFromTemplate(options) {
|
|
1950
1954
|
const targetDir = import_node_path11.default.resolve(options.targetDir);
|
|
1951
1955
|
const templateDir = import_node_path11.default.resolve(options.templateDir);
|
|
@@ -1979,7 +1983,10 @@ async function ensureArtifacts(targetDir, projectName) {
|
|
|
1979
1983
|
await writeArtifacts({ ...artifacts, project: projectName }, targetDir);
|
|
1980
1984
|
} catch (error) {
|
|
1981
1985
|
if (error instanceof CaatingaError && error.code === CaatingaErrorCode.ARTIFACT_NOT_FOUND) {
|
|
1982
|
-
await writeArtifacts(
|
|
1986
|
+
await writeArtifacts(
|
|
1987
|
+
createInitialArtifacts(projectName, { networks: ["testnet"] }),
|
|
1988
|
+
targetDir
|
|
1989
|
+
);
|
|
1983
1990
|
return;
|
|
1984
1991
|
}
|
|
1985
1992
|
throw error;
|
|
@@ -2022,19 +2029,21 @@ async function readTemplateManifest(templateDir) {
|
|
|
2022
2029
|
}
|
|
2023
2030
|
async function replaceTemplateVariables(dir, projectName) {
|
|
2024
2031
|
const entries = await (0, import_promises8.readdir)(dir);
|
|
2025
|
-
await Promise.all(
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2032
|
+
await Promise.all(
|
|
2033
|
+
entries.map(async (entry) => {
|
|
2034
|
+
const entryPath = import_node_path11.default.join(dir, entry);
|
|
2035
|
+
const entryStat = await (0, import_promises8.stat)(entryPath);
|
|
2036
|
+
if (entryStat.isDirectory()) {
|
|
2037
|
+
await replaceTemplateVariables(entryPath, projectName);
|
|
2038
|
+
return;
|
|
2039
|
+
}
|
|
2040
|
+
if (!isTextTemplateFile(entryPath)) {
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
const content = await (0, import_promises8.readFile)(entryPath, "utf8");
|
|
2044
|
+
await (0, import_promises8.writeFile)(entryPath, content.replaceAll("__PROJECT_NAME__", projectName), "utf8");
|
|
2045
|
+
})
|
|
2046
|
+
);
|
|
2038
2047
|
}
|
|
2039
2048
|
function shouldCopyTemplateEntry(templateDir, source, userFilter) {
|
|
2040
2049
|
const relativePath = import_node_path11.default.relative(templateDir, source);
|
|
@@ -2048,16 +2057,9 @@ function shouldCopyTemplateEntry(templateDir, source, userFilter) {
|
|
|
2048
2057
|
return !relativePath.split(import_node_path11.default.sep).some((segment) => TEMPLATE_COPY_EXCLUDED_DIRS.has(segment));
|
|
2049
2058
|
}
|
|
2050
2059
|
function isTextTemplateFile(filePath) {
|
|
2051
|
-
return [
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
".rs",
|
|
2055
|
-
".toml",
|
|
2056
|
-
".ts",
|
|
2057
|
-
".tsx",
|
|
2058
|
-
".css",
|
|
2059
|
-
".html"
|
|
2060
|
-
].includes(import_node_path11.default.extname(filePath));
|
|
2060
|
+
return [".json", ".md", ".rs", ".toml", ".ts", ".tsx", ".css", ".html"].includes(
|
|
2061
|
+
import_node_path11.default.extname(filePath)
|
|
2062
|
+
);
|
|
2061
2063
|
}
|
|
2062
2064
|
|
|
2063
2065
|
// src/scaffold/create-zk-project.ts
|
|
@@ -2107,23 +2109,27 @@ export default defineConfig({
|
|
|
2107
2109
|
`;
|
|
2108
2110
|
}
|
|
2109
2111
|
function packageJsonSource(projectName) {
|
|
2110
|
-
return `${JSON.stringify(
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2112
|
+
return `${JSON.stringify(
|
|
2113
|
+
{
|
|
2114
|
+
name: projectName,
|
|
2115
|
+
version: "0.1.0",
|
|
2116
|
+
private: true,
|
|
2117
|
+
type: "module",
|
|
2118
|
+
scripts: {
|
|
2119
|
+
"zk:build": "caatinga zk build main",
|
|
2120
|
+
"zk:prove": "caatinga zk prove main",
|
|
2121
|
+
build: "caatinga build verifier",
|
|
2122
|
+
deploy: "caatinga deploy verifier --network testnet --source ${CAATINGA_SOURCE:-alice}",
|
|
2123
|
+
doctor: "caatinga doctor --network testnet"
|
|
2124
|
+
},
|
|
2125
|
+
devDependencies: {
|
|
2126
|
+
"@caatinga/cli": `^${CAATINGA_CORE_VERSION}`,
|
|
2127
|
+
"@caatinga/core": `^${CAATINGA_CORE_VERSION}`
|
|
2128
|
+
}
|
|
2121
2129
|
},
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
}
|
|
2126
|
-
}, null, 2)}
|
|
2130
|
+
null,
|
|
2131
|
+
2
|
|
2132
|
+
)}
|
|
2127
2133
|
`;
|
|
2128
2134
|
}
|
|
2129
2135
|
function readmeSource(projectName) {
|
|
@@ -2151,10 +2157,22 @@ async function createZkProject(options) {
|
|
|
2151
2157
|
await (0, import_promises9.mkdir)(targetDir, { recursive: true });
|
|
2152
2158
|
if (projectFiles) {
|
|
2153
2159
|
await Promise.all([
|
|
2154
|
-
(0, import_promises9.writeFile)(import_node_path12.default.join(targetDir, "caatinga.config.ts"), configSource(options.projectName), {
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2160
|
+
(0, import_promises9.writeFile)(import_node_path12.default.join(targetDir, "caatinga.config.ts"), configSource(options.projectName), {
|
|
2161
|
+
encoding: "utf8",
|
|
2162
|
+
flag: force ? "w" : "wx"
|
|
2163
|
+
}),
|
|
2164
|
+
(0, import_promises9.writeFile)(import_node_path12.default.join(targetDir, "package.json"), packageJsonSource(options.projectName), {
|
|
2165
|
+
encoding: "utf8",
|
|
2166
|
+
flag: force ? "w" : "wx"
|
|
2167
|
+
}),
|
|
2168
|
+
(0, import_promises9.writeFile)(import_node_path12.default.join(targetDir, ".gitignore"), "node_modules\n.artifacts\ntarget\n", {
|
|
2169
|
+
encoding: "utf8",
|
|
2170
|
+
flag: force ? "w" : "wx"
|
|
2171
|
+
}),
|
|
2172
|
+
(0, import_promises9.writeFile)(import_node_path12.default.join(targetDir, "README.md"), readmeSource(options.projectName), {
|
|
2173
|
+
encoding: "utf8",
|
|
2174
|
+
flag: force ? "w" : "wx"
|
|
2175
|
+
})
|
|
2158
2176
|
]);
|
|
2159
2177
|
}
|
|
2160
2178
|
await (0, import_promises9.mkdir)(import_node_path12.default.join(targetDir, "contracts"), { recursive: true });
|
|
@@ -2163,13 +2181,20 @@ async function createZkProject(options) {
|
|
|
2163
2181
|
force,
|
|
2164
2182
|
errorOnExist: !force
|
|
2165
2183
|
});
|
|
2166
|
-
await (0, import_promises9.cp)(
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2184
|
+
await (0, import_promises9.cp)(
|
|
2185
|
+
import_node_path12.default.join(scaffoldRoot(), "zk-verifier"),
|
|
2186
|
+
import_node_path12.default.join(targetDir, "contracts", "verifier"),
|
|
2187
|
+
{
|
|
2188
|
+
recursive: true,
|
|
2189
|
+
force,
|
|
2190
|
+
errorOnExist: !force
|
|
2191
|
+
}
|
|
2192
|
+
);
|
|
2171
2193
|
if (projectFiles) {
|
|
2172
|
-
await writeArtifacts(
|
|
2194
|
+
await writeArtifacts(
|
|
2195
|
+
createInitialArtifacts(options.projectName, { networks: ["testnet"] }),
|
|
2196
|
+
targetDir
|
|
2197
|
+
);
|
|
2173
2198
|
}
|
|
2174
2199
|
return { targetDir };
|
|
2175
2200
|
}
|
|
@@ -2211,23 +2236,27 @@ export default defineConfig({
|
|
|
2211
2236
|
`;
|
|
2212
2237
|
}
|
|
2213
2238
|
function packageJsonSource2(projectName) {
|
|
2214
|
-
return `${JSON.stringify(
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2239
|
+
return `${JSON.stringify(
|
|
2240
|
+
{
|
|
2241
|
+
name: projectName,
|
|
2242
|
+
version: "0.1.0",
|
|
2243
|
+
private: true,
|
|
2244
|
+
type: "module",
|
|
2245
|
+
scripts: {
|
|
2246
|
+
build: "caatinga build app",
|
|
2247
|
+
deploy: "caatinga deploy app --network testnet --source ${CAATINGA_SOURCE:-alice}",
|
|
2248
|
+
doctor: "caatinga doctor --network testnet",
|
|
2249
|
+
"read:hello": "caatinga read app.hello --network testnet --source ${CAATINGA_SOURCE:-alice}",
|
|
2250
|
+
"read:version": "caatinga read app.version --network testnet --source ${CAATINGA_SOURCE:-alice}"
|
|
2251
|
+
},
|
|
2252
|
+
devDependencies: {
|
|
2253
|
+
"@caatinga/cli": `^${CAATINGA_CORE_VERSION}`,
|
|
2254
|
+
"@caatinga/core": `^${CAATINGA_CORE_VERSION}`
|
|
2255
|
+
}
|
|
2225
2256
|
},
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
}
|
|
2230
|
-
}, null, 2)}
|
|
2257
|
+
null,
|
|
2258
|
+
2
|
|
2259
|
+
)}
|
|
2231
2260
|
`;
|
|
2232
2261
|
}
|
|
2233
2262
|
function readmeSource2(projectName) {
|
|
@@ -2263,18 +2292,37 @@ async function createMinimalProject(options) {
|
|
|
2263
2292
|
const force = options.force ?? false;
|
|
2264
2293
|
await (0, import_promises10.mkdir)(targetDir, { recursive: true });
|
|
2265
2294
|
await Promise.all([
|
|
2266
|
-
(0, import_promises10.writeFile)(import_node_path13.default.join(targetDir, "caatinga.config.ts"), configSource2(options.projectName), {
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2295
|
+
(0, import_promises10.writeFile)(import_node_path13.default.join(targetDir, "caatinga.config.ts"), configSource2(options.projectName), {
|
|
2296
|
+
encoding: "utf8",
|
|
2297
|
+
flag: force ? "w" : "wx"
|
|
2298
|
+
}),
|
|
2299
|
+
(0, import_promises10.writeFile)(import_node_path13.default.join(targetDir, "package.json"), packageJsonSource2(options.projectName), {
|
|
2300
|
+
encoding: "utf8",
|
|
2301
|
+
flag: force ? "w" : "wx"
|
|
2302
|
+
}),
|
|
2303
|
+
(0, import_promises10.writeFile)(import_node_path13.default.join(targetDir, ".gitignore"), "node_modules\n.artifacts\ntarget\n", {
|
|
2304
|
+
encoding: "utf8",
|
|
2305
|
+
flag: force ? "w" : "wx"
|
|
2306
|
+
}),
|
|
2307
|
+
(0, import_promises10.writeFile)(import_node_path13.default.join(targetDir, "README.md"), readmeSource2(options.projectName), {
|
|
2308
|
+
encoding: "utf8",
|
|
2309
|
+
flag: force ? "w" : "wx"
|
|
2310
|
+
})
|
|
2270
2311
|
]);
|
|
2271
2312
|
await (0, import_promises10.mkdir)(import_node_path13.default.join(targetDir, "contracts"), { recursive: true });
|
|
2272
|
-
await (0, import_promises10.cp)(
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2313
|
+
await (0, import_promises10.cp)(
|
|
2314
|
+
import_node_path13.default.join(scaffoldRoot2(), "soroban-contract-stub"),
|
|
2315
|
+
import_node_path13.default.join(targetDir, "contracts", "app"),
|
|
2316
|
+
{
|
|
2317
|
+
recursive: true,
|
|
2318
|
+
force,
|
|
2319
|
+
errorOnExist: !force
|
|
2320
|
+
}
|
|
2321
|
+
);
|
|
2322
|
+
await writeArtifacts(
|
|
2323
|
+
createInitialArtifacts(options.projectName, { networks: ["testnet"] }),
|
|
2324
|
+
targetDir
|
|
2325
|
+
);
|
|
2278
2326
|
return { targetDir };
|
|
2279
2327
|
}
|
|
2280
2328
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-
|
|
2
|
-
export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-
|
|
1
|
+
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-D4r8dyYK.cjs';
|
|
2
|
+
export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-D4r8dyYK.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const CAATINGA_CORE_VERSION: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-
|
|
2
|
-
export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-
|
|
1
|
+
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-D4r8dyYK.js';
|
|
2
|
+
export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-D4r8dyYK.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const CAATINGA_CORE_VERSION: string;
|