Skip to content

Commit

Permalink
Merge pull request #1610 from Genez-io/release_v3_0_8
Browse files Browse the repository at this point in the history
Release v3.0.8
  • Loading branch information
andreia-oca authored Dec 18, 2024
2 parents 0dc9e69 + 7e97b25 commit a3d5895
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 20 deletions.
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "genezio",
"version": "3.0.7",
"version": "3.0.8",
"description": "Command line utility to interact with Genezio infrastructure.",
"exports": "./index.js",
"type": "module",
Expand Down Expand Up @@ -51,7 +51,7 @@
"@babel/preset-react": "^7.24.6",
"@babel/preset-typescript": "^7.26.0",
"@babel/traverse": "^7.26.4",
"@genezio/test-interface-component": "^2.3.3",
"@genezio/test-interface-component": "^2.4.3",
"@sentry/node": "^7.119.1",
"@sentry/profiling-node": "~7.120.0",
"@types/adm-zip": "^0.5.6",
Expand Down
9 changes: 7 additions & 2 deletions src/cloudAdapter/genezio/genezioAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ import { UserError } from "../../errors.js";
import { stdout } from "process";
import { createHash } from "../../utils/strings.js";

const BUNDLE_SIZE_LIMIT = 1.024e9;
// The maximum size of a bundle is 1.524e9 bytes approx 1.5GB.
const BUNDLE_SIZE_LIMIT = 1.524e9;

async function handleBigElementSizeError(
element: GenezioCloudInput,
projectConfiguration: ProjectConfiguration,
BUNDLE_SIZE_LIMIT: number = 1.024e9,
BUNDLE_SIZE_LIMIT: number = 1.524e9,
): Promise<void> {
const size = await getFileSize(element.archivePath);
if (size > BUNDLE_SIZE_LIMIT) {
Expand All @@ -57,6 +59,9 @@ async function handleBigElementSizeError(
element.type === GenezioCloudInputType.CLASS
)
) {
debugLogger.debug(
`The bundle for ${element.type} ${element.name} is ${(size / 1048576).toFixed(2)}MB out of ${(BUNDLE_SIZE_LIMIT / 1048576).toFixed(2)}MB.`,
);
return;
}

Expand Down
7 changes: 4 additions & 3 deletions src/commands/analyze/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ export async function analyzeCommand(options: GenezioAnalyzeOptions) {
FLASK_PATTERN,
PYTHON_DEFAULT_ENTRY_FILE,
);
const entryFileContent = await retrieveFileContent(entryFile);
const fullpath = path.join(componentPath, entryFile);
const entryFileContent = await retrieveFileContent(fullpath);
const pythonHandler = getPythonHandler(entryFileContent);

await addBackendComponentToConfig(configPath, {
Expand Down Expand Up @@ -506,8 +507,8 @@ export async function analyzeCommand(options: GenezioAnalyzeOptions) {
FASTAPI_PATTERN,
PYTHON_DEFAULT_ENTRY_FILE,
);

const entryFileContent = await retrieveFileContent(entryFile);
const fullpath = path.join(componentPath, entryFile);
const entryFileContent = await retrieveFileContent(fullpath);
const pythonHandler = getPythonHandler(entryFileContent);

await addBackendComponentToConfig(configPath, {
Expand Down
13 changes: 9 additions & 4 deletions src/commands/analyze/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,15 @@ export async function isReactComponent(contents: Record<string, string>): Promis
}

const packageJsonContent = JSON.parse(contents["package.json"]) as PackageJSON;
return packageJsonContent
? "react" in (packageJsonContent.dependencies || {}) ||
"react" in (packageJsonContent.devDependencies || {})
: false;
const dependencies = packageJsonContent.dependencies || {};
const devDependencies = packageJsonContent.devDependencies || {};

// Return false if it's a react-native project
if ("react-native" in dependencies || "react-native" in devDependencies) {
return false;
}

return "react" in dependencies || "react" in devDependencies;
}

// Checks if the project is a Vite component
Expand Down
5 changes: 5 additions & 0 deletions src/commands/deploy/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ async function decideDeployType(options: GenezioDeployOptions): Promise<DeployTy
const configIOController = new YamlConfigurationIOController(options.config);
const config = await configIOController.read();

// Temporary fix: We should deploy Genezio Functions/Frontends first until
// we support fullstack projects such as Genezio Functions and next, nuxt, nitro, nestjs projects
if (config.backend || config.frontend) {
return DeployType.Classic;
}
if (config.container) {
return DeployType.Docker;
}
Expand Down
12 changes: 7 additions & 5 deletions src/commands/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,13 @@ function reportSuccess(projectConfiguration: ProjectConfiguration, port: number)
}

const workspaceUrl = getWorkspaceUrl(port);
log.info(
colors.cyan(
`Test your code at ${workspaceUrl ? workspaceUrl : `http://localhost:${port}`}/explore`,
),
);
if (projectConfiguration.classes.length > 0) {
log.info(
colors.cyan(
`Test your classes at ${workspaceUrl ? workspaceUrl : `http://localhost:${port}`}/explore`,
),
);
}
}

// This method is used to check if the user has a different node version installed than the one used by the server.
Expand Down

0 comments on commit a3d5895

Please sign in to comment.