Skip to content

Commit

Permalink
feat: update package dependencies and enhance CLI command handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rsaz committed Nov 18, 2024
1 parent a95accc commit 8fe9df5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"release-it": "16.3.0",
"shx": "0.3.4",
"ts-jest": "^29.2.5",
"ts-node-dev": "2.0.0",
"tsx": "^4.19.2",
"typescript": "5.2.2"
},
"release-it": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { scriptsCommand } from "./scripts";
* The current version of the ExpressoTS Bundle.
* core, adapters, and cli.
*/
export const BUNDLE_VERSION = "2.16.2";
export const BUNDLE_VERSION = "3.0.0-beta.1";

stdout.write(`\n${[chalk.bold.green("🐎 Expressots")]}\n\n`);

Expand Down
19 changes: 4 additions & 15 deletions src/commands/project.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,13 @@ function getOutDir(): string {
* @returns The configuration
*/
const opinionatedConfig: Array<string> = [
"--transpile-only",
"--clear",
"-r",
"dotenv/config",
"--watch",
"-r",
"tsconfig-paths/register",
"./src/main.ts",
];

const nonOpinionatedConfig: Array<string> = [
"--transpile-only",
"--clear",
"-r",
"dotenv/config",
"./src/main.ts",
];
const nonOpinionatedConfig: Array<string> = ["--watch", "./src/main.ts"];

/**
* Dev command module
Expand Down Expand Up @@ -191,7 +182,7 @@ export const runCommand = async ({
switch (command) {
case "dev":
execCmd(
"tsnd",
"tsx",
opinionated ? opinionatedConfig : nonOpinionatedConfig,
);
break;
Expand Down Expand Up @@ -219,14 +210,12 @@ export const runCommand = async ({
let config: Array<string> = [];
if (opinionated) {
config = [
"-r",
"dotenv/config",
"-r",
`./${outDir}/register-path.js`,
`./${outDir}/src/main.js`,
];
} else {
config = ["-r", "dotenv/config", `./${outDir}/main.js`];
config = [`./${outDir}/main.js`];
}
clearScreen();
execCmd("node", config);
Expand Down
14 changes: 6 additions & 8 deletions src/new/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ async function packageManagerInstall({
let installCommand: string = "install --prefer-offline";
if (packageManager === "yarn") {
installCommand = "install --ignore-engines";
} else if (
packageManager === "bun" ||
packageManager === "pnpm" ||
packageManager === "yarn"
) {
} else if (packageManager === "pnpm") {
installCommand = "install --silent";
} else if (packageManager === "bun" || packageManager === "yarn") {
installCommand = "install";
}

Expand Down Expand Up @@ -243,9 +241,11 @@ const projectForm = async (

const [_, template] = answer.template.match(/(.*) ::/) as Array<string>;

const repo: string = `expressots/templates/${templates[template]}#${BUNDLE_VERSION}`;

try {
const emitter = degit(
`expressots/templates/${templates[template]}#${BUNDLE_VERSION}`,
`expressots/templates/${templates[template]}`,
);

await emitter.clone(answer.name);
Expand Down Expand Up @@ -275,8 +275,6 @@ const projectForm = async (
name: projectName,
});

renameEnvFile(answer.name);

progressBar.update(100);

progressBar.stop();
Expand Down

0 comments on commit 8fe9df5

Please sign in to comment.