@better-sol/cli 0.1.0-alpha.4 → 0.1.0-alpha.6
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/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3036,11 +3036,18 @@ function primitiveLayout(type) {
|
|
|
3036
3036
|
//#endregion
|
|
3037
3037
|
//#region src/parser/discover.ts
|
|
3038
3038
|
function globToRegex(pattern) {
|
|
3039
|
-
const
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3039
|
+
const parts = pattern.split("/");
|
|
3040
|
+
const regexParts = [];
|
|
3041
|
+
for (let i = 0; i < parts.length; i++) {
|
|
3042
|
+
const part = parts[i];
|
|
3043
|
+
const isLast = i === parts.length - 1;
|
|
3044
|
+
if (part === "**") regexParts.push("(.*\\/)?");
|
|
3045
|
+
else {
|
|
3046
|
+
regexParts.push(part.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]"));
|
|
3047
|
+
if (!isLast) regexParts.push("/");
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
return new RegExp(`^${regexParts.join("")}$`);
|
|
3044
3051
|
}
|
|
3045
3052
|
async function findFiles(pattern) {
|
|
3046
3053
|
const regex = globToRegex(pattern);
|
|
@@ -3155,6 +3162,7 @@ async function deploy(options) {
|
|
|
3155
3162
|
const statusLabel = result.status === "success" ? "✓ Success" : `✗ ${result.status}`;
|
|
3156
3163
|
const compileTime = `${(result.compileTimeMs / 1e3).toFixed(1)}s`;
|
|
3157
3164
|
log.info(`${statusLabel} compiled in ${compileTime}`);
|
|
3165
|
+
if (result.status === "failed" && result.logs) log.info(`Compile logs:\n${result.logs}`);
|
|
3158
3166
|
log.step(`Explorer: https://explorer.solana.com/address/${project.program.address}?cluster=${cluster}`);
|
|
3159
3167
|
if (result.status === "success" && result.bytecode !== null) {
|
|
3160
3168
|
const soDir = join(outDir, project.program.name, "target", "deploy");
|
|
@@ -69252,7 +69260,7 @@ async function gitCommit() {
|
|
|
69252
69260
|
//#endregion
|
|
69253
69261
|
//#region src/index.ts
|
|
69254
69262
|
const cli = new Command();
|
|
69255
|
-
cli.name("better-sol").description("TypeScript-first Solana program tooling — run with npx @better-sol/cli").version("0.1.0-alpha.
|
|
69263
|
+
cli.name("better-sol").description("TypeScript-first Solana program tooling — run with npx @better-sol/cli").version("0.1.0-alpha.6");
|
|
69256
69264
|
cli.command("init").description("Initialize a better-sol project").option("--force", "overwrite existing files", false).option("--skip-install", "skip installing dependencies", false).action((options) => run(() => init(options)));
|
|
69257
69265
|
cli.command("create").description("Create a new better-sol program").argument("[name]", "program name").option("--dir <dir>", "program directory", "programs").option("--force", "overwrite existing files", false).action((name, options) => run(() => create(name, options)));
|
|
69258
69266
|
cli.command("login").description("Save your compiler API key").action(() => run(() => login()));
|