@base44-preview/cli 0.0.31-pr.245.26fa5cb → 0.0.31-pr.246.c851bc7
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/index.js +38 -21
- package/dist/cli/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -9296,10 +9296,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9296
9296
|
};
|
|
9297
9297
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
9298
9298
|
var filename = opts.filename;
|
|
9299
|
-
var
|
|
9299
|
+
var basename4 = path11.basename(filename, path11.extname(filename));
|
|
9300
9300
|
try {
|
|
9301
9301
|
Object.defineProperty(returnedFn, "name", {
|
|
9302
|
-
value:
|
|
9302
|
+
value: basename4,
|
|
9303
9303
|
writable: false,
|
|
9304
9304
|
enumerable: false,
|
|
9305
9305
|
configurable: true
|
|
@@ -111567,12 +111567,12 @@ function getLanguageByFileName(languages2, file2) {
|
|
|
111567
111567
|
if (!file2) {
|
|
111568
111568
|
return;
|
|
111569
111569
|
}
|
|
111570
|
-
const
|
|
111570
|
+
const basename5 = getFileBasename(file2).toLowerCase();
|
|
111571
111571
|
return languages2.find(({
|
|
111572
111572
|
filenames
|
|
111573
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
111573
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename5)) ?? languages2.find(({
|
|
111574
111574
|
extensions
|
|
111575
|
-
}) => extensions?.some((extension) =>
|
|
111575
|
+
}) => extensions?.some((extension) => basename5.endsWith(extension)));
|
|
111576
111576
|
}
|
|
111577
111577
|
function getLanguageByLanguageName(languages2, languageName) {
|
|
111578
111578
|
if (!languageName) {
|
|
@@ -116794,8 +116794,8 @@ var init_prettier = __esm(() => {
|
|
|
116794
116794
|
}
|
|
116795
116795
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
116796
116796
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
116797
|
-
const
|
|
116798
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
116797
|
+
const basename5 = path152.basename(pattern);
|
|
116798
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename5);
|
|
116799
116799
|
}
|
|
116800
116800
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
116801
116801
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -155679,7 +155679,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155679
155679
|
var path18 = __require("node:path");
|
|
155680
155680
|
var fs28 = __require("node:fs");
|
|
155681
155681
|
var dirname11 = path18.dirname;
|
|
155682
|
-
var
|
|
155682
|
+
var basename5 = path18.basename;
|
|
155683
155683
|
var extname2 = path18.extname;
|
|
155684
155684
|
var join15 = path18.join;
|
|
155685
155685
|
var resolve5 = path18.resolve;
|
|
@@ -155718,7 +155718,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155718
155718
|
var root2 = roots[i5];
|
|
155719
155719
|
var loc = resolve5(root2, name2);
|
|
155720
155720
|
var dir = dirname11(loc);
|
|
155721
|
-
var file2 =
|
|
155721
|
+
var file2 = basename5(loc);
|
|
155722
155722
|
path19 = this.resolve(dir, file2);
|
|
155723
155723
|
}
|
|
155724
155724
|
return path19;
|
|
@@ -155748,7 +155748,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155748
155748
|
if (stat2 && stat2.isFile()) {
|
|
155749
155749
|
return path19;
|
|
155750
155750
|
}
|
|
155751
|
-
path19 = join15(dir,
|
|
155751
|
+
path19 = join15(dir, basename5(file2, ext), "index" + ext);
|
|
155752
155752
|
stat2 = tryStat(path19);
|
|
155753
155753
|
if (stat2 && stat2.isFile()) {
|
|
155754
155754
|
return path19;
|
|
@@ -159069,7 +159069,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159069
159069
|
*/
|
|
159070
159070
|
module.exports = contentDisposition;
|
|
159071
159071
|
module.exports.parse = parse10;
|
|
159072
|
-
var
|
|
159072
|
+
var basename5 = __require("path").basename;
|
|
159073
159073
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
159074
159074
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
159075
159075
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -159104,9 +159104,9 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159104
159104
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
159105
159105
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
159106
159106
|
}
|
|
159107
|
-
var name2 =
|
|
159107
|
+
var name2 = basename5(filename);
|
|
159108
159108
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
159109
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) :
|
|
159109
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename5(fallback);
|
|
159110
159110
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
159111
159111
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
159112
159112
|
params["filename*"] = name2;
|
|
@@ -185615,7 +185615,7 @@ async function deployFunctions(functions) {
|
|
|
185615
185615
|
return result.data;
|
|
185616
185616
|
}
|
|
185617
185617
|
// src/core/resources/function/config.ts
|
|
185618
|
-
import { dirname as dirname4, join as join5 } from "node:path";
|
|
185618
|
+
import { basename as basename2, dirname as dirname4, join as join5 } from "node:path";
|
|
185619
185619
|
async function readFunctionConfig(configPath) {
|
|
185620
185620
|
const parsed = await readJsonFile(configPath);
|
|
185621
185621
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -185646,7 +185646,24 @@ async function readAllFunctions(functionsDir) {
|
|
|
185646
185646
|
cwd: functionsDir,
|
|
185647
185647
|
absolute: true
|
|
185648
185648
|
});
|
|
185649
|
-
const
|
|
185649
|
+
const indexFiles = await globby(`*/index.{js,ts}`, {
|
|
185650
|
+
cwd: functionsDir,
|
|
185651
|
+
absolute: true
|
|
185652
|
+
});
|
|
185653
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
185654
|
+
const indexFilesDirs = indexFiles.filter((indexFile) => !configFilesDirs.has(dirname4(indexFile)));
|
|
185655
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
185656
|
+
const functionsWithoutConfig = await Promise.all(indexFilesDirs.map(async (functionFile) => {
|
|
185657
|
+
const functionDir = dirname4(functionFile);
|
|
185658
|
+
const filePaths = await globby("*.{js,ts,json}", {
|
|
185659
|
+
cwd: functionDir,
|
|
185660
|
+
absolute: true
|
|
185661
|
+
});
|
|
185662
|
+
const name2 = basename2(functionDir);
|
|
185663
|
+
const entry = basename2(functionFile);
|
|
185664
|
+
return { name: name2, entry, entryPath: functionFile, filePaths };
|
|
185665
|
+
}));
|
|
185666
|
+
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
185650
185667
|
const names = new Set;
|
|
185651
185668
|
for (const fn of functions) {
|
|
185652
185669
|
if (names.has(fn.name)) {
|
|
@@ -185657,11 +185674,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
185657
185674
|
return functions;
|
|
185658
185675
|
}
|
|
185659
185676
|
// src/core/resources/function/deploy.ts
|
|
185660
|
-
import { basename as
|
|
185677
|
+
import { basename as basename3 } from "node:path";
|
|
185661
185678
|
async function loadFunctionCode(fn) {
|
|
185662
185679
|
const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
185663
185680
|
const content = await readTextFile(filePath);
|
|
185664
|
-
return { path:
|
|
185681
|
+
return { path: basename3(filePath), content };
|
|
185665
185682
|
}));
|
|
185666
185683
|
return { ...fn, files: loadedFiles };
|
|
185667
185684
|
}
|
|
@@ -194629,7 +194646,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
194629
194646
|
}
|
|
194630
194647
|
|
|
194631
194648
|
// src/cli/commands/project/create.ts
|
|
194632
|
-
import { basename as
|
|
194649
|
+
import { basename as basename4, join as join11, resolve as resolve2 } from "node:path";
|
|
194633
194650
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
194634
194651
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
194635
194652
|
async function getTemplateById(templateId) {
|
|
@@ -194664,8 +194681,8 @@ async function createInteractive(options) {
|
|
|
194664
194681
|
name: () => {
|
|
194665
194682
|
return options.name ? Promise.resolve(options.name) : he({
|
|
194666
194683
|
message: "What is the name of your project?",
|
|
194667
|
-
placeholder:
|
|
194668
|
-
initialValue:
|
|
194684
|
+
placeholder: basename4(process.cwd()),
|
|
194685
|
+
initialValue: basename4(process.cwd()),
|
|
194669
194686
|
validate: (value) => {
|
|
194670
194687
|
if (!value || value.trim().length === 0) {
|
|
194671
194688
|
return "Every project deserves a name";
|
|
@@ -199760,4 +199777,4 @@ export {
|
|
|
199760
199777
|
CLIExitError
|
|
199761
199778
|
};
|
|
199762
199779
|
|
|
199763
|
-
//# debugId=
|
|
199780
|
+
//# debugId=26F49567E6DDC3D964756E2164756E21
|