diff --git a/package-lock.json b/package-lock.json index 8aa555b..2623b31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3978,18 +3978,18 @@ "web-component-base": "latest" }, "bin": { - "mcfly": "index.js" + "mcfly": "index.mjs" } }, "packages/config": { "name": "@mcflyjs/config", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "devDependencies": {} }, "packages/core": { "name": "@mcflyjs/core", - "version": "0.2.7", + "version": "0.2.8", "license": "MIT", "dependencies": { "esprima": "^4.0.1", @@ -3998,14 +3998,14 @@ } }, "packages/create-mcfly": { - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "consola": "^3.2.3", "giget": "^1.1.3" }, "bin": { - "create-mcfly": "index.js" + "create-mcfly": "index.mjs" } }, "site": { diff --git a/package.json b/package.json index 40b4867..21c5f0b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "build:preview": "npm run build:preview -w @mcflyjs/landing-page", "template:basic": "npm run dev -w @templates/basic", "create": "node ./packages/create-mcfly", + "cli": "node ./packages/cli", "patch:all": "npm version patch -w @mcflyjs/core && npm version patch -w @mcflyjs/config && npm version patch -w create-mcfly" }, "workspaces": [ diff --git a/packages/cli/index.js b/packages/cli/index.mjs similarity index 81% rename from packages/cli/index.js rename to packages/cli/index.mjs index 7872af8..fb60301 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.mjs @@ -1,12 +1,10 @@ #!/usr/bin/env node -const { defineCommand, runMain } = require("citty"); -const pkg = require("./package.json"); +import { defineCommand, runMain } from "citty"; const main = defineCommand({ meta: { name: "mcfly", description: "McFly CLI", - version: pkg.version, }, subCommands: { new: () => import("./commands/new.mjs").then((r) => r.default), @@ -14,6 +12,7 @@ const main = defineCommand({ build: () => import("./commands/build.mjs").then((r) => r.default), prepare: () => import("./commands/prepare.mjs").then((r) => r.default), generate: () => import("./commands/generate.mjs").then((r) => r.default), + g: () => import("./commands/generate.mjs").then((r) => r.default), }, }); diff --git a/packages/cli/package.json b/packages/cli/package.json index 2e8ec5e..8351050 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,10 +1,11 @@ { "name": "@mcflyjs/cli", - "version": "0.0.7", + "version": "0.0.8", "description": "McFly CLI tools", - "main": "index.js", + "type": "module", + "main": "index.mjs", "bin": { - "mcfly": "./index.js" + "mcfly": "./index.mjs" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/packages/config/index.js b/packages/config/index.mjs similarity index 100% rename from packages/config/index.js rename to packages/config/index.mjs diff --git a/packages/config/package.json b/packages/config/package.json index ede0081..da91694 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,11 +1,12 @@ { "name": "@mcflyjs/config", - "version": "0.0.7", + "version": "0.0.9", "description": "Nitro configuration for McFly apps", - "main": "index.js", + "type": "module", + "main": "index.mjs", "devDependencies": {}, "files": [ - "index.js", + "index.mjs", "LICENSE" ], "scripts": { diff --git a/packages/core/package.json b/packages/core/package.json index 1a6bc54..cd5213e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,8 @@ { "name": "@mcflyjs/core", - "version": "0.2.7", + "version": "0.2.8", "description": "McFly core package", + "type": "module", "main": "event-handler.mjs", "files": [ "event-handler.mjs", diff --git a/packages/create-mcfly/index.js b/packages/create-mcfly/index.mjs similarity index 93% rename from packages/create-mcfly/index.js rename to packages/create-mcfly/index.mjs index 64e7ffa..ef276de 100755 --- a/packages/create-mcfly/index.js +++ b/packages/create-mcfly/index.mjs @@ -1,9 +1,9 @@ #!/usr/bin/env node -const { consola } = require("consola"); -const { colorize } = require("consola/utils"); -const { downloadTemplate } = require("giget"); -const { execSync: exec } = require("node:child_process"); +import { consola } from "consola"; +import { colorize } from "consola/utils"; +import { downloadTemplate } from "giget"; +import { execSync as exec } from "node:child_process"; const [, , directoryArg] = process.argv; @@ -22,7 +22,7 @@ const [, , directoryArg] = process.argv; async function create() { console.clear(); const defaultDirectory = "./mcfly-app"; - consola.box(`👋 Hello! Welcome to ${colorize("bold", "McFly")}!`); + consola.box(`Hello! Welcome to ${colorize("bold", "McFly")}!`); let directory = directoryArg; if (!directory) { diff --git a/packages/create-mcfly/package.json b/packages/create-mcfly/package.json index 2cb9ca6..f63bf1c 100644 --- a/packages/create-mcfly/package.json +++ b/packages/create-mcfly/package.json @@ -1,16 +1,17 @@ { "name": "create-mcfly", - "version": "0.3.1", - "bin": { - "create-mcfly": "./index.js" - }, + "version": "0.3.2", "description": "Create a new McFly app", - "main": "index.js", + "type": "module", + "bin": { + "create-mcfly": "./index.mjs" + }, + "main": "index.mjs", "exports": { - ".": "./index.js" + ".": "./index.mjs" }, "files": [ - "index.js", + "index.mjs", "LICENSE" ], "scripts": {