diff --git a/bin/create-project b/bin/create-project index 0a1d7ce..f6b75a8 100755 --- a/bin/create-project +++ b/bin/create-project @@ -1,4 +1,4 @@ #!/usr/bin/env node -require = require('esm')(module /*, options*/); -require('../src/cli.js').cli(process.argv); +import { cli } from '../src/cli.js'; +cli(process.argv); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ba9fa6f..c9c156b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "arg": "^4.1.0", "chalk": "^2.4.2", "clear": "^0.1.0", - "esm": "^3.2.25", "execa": "^1.0.0", "figlet": "^1.5.2", "inquirer": "^6.2.2", @@ -21,7 +20,7 @@ "pkg-install": "^0.2.0" }, "bin": { - "pusakatest": "bin/create-project" + "create-project": "bin/create-project.mjs" } }, "node_modules/@samverschueren/stream-to-observable": { @@ -283,15 +282,6 @@ "node": ">=0.8.0" } }, - "node_modules/esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/execa": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", diff --git a/package.json b/package.json index c1e1f4c..2642331 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "2.4.1", "description": "pusakatest is an automation testing tool based on pactum using bdd (cucumber) style", "main": "index.js", - "bin": "bin/create-project", + "type": "module", + "bin": { + "create-project": "bin/create-project.mjs" + }, "publishConfig": { "access": "public" }, @@ -21,7 +24,6 @@ "arg": "^4.1.0", "chalk": "^2.4.2", "clear": "^0.1.0", - "esm": "^3.2.25", "execa": "^1.0.0", "figlet": "^1.5.2", "inquirer": "^6.2.2", diff --git a/src/cli.js b/src/cli.js index a580e91..3729e4f 100644 --- a/src/cli.js +++ b/src/cli.js @@ -1,6 +1,6 @@ import arg from 'arg'; import inquirer from 'inquirer'; -import { createProject } from './main'; +import { createProject } from './main.js'; function parseArgumentsIntoOptions(rawArgs) { const args = arg(