From 1833185050cf7582d9a2bcb42e39828058376628 Mon Sep 17 00:00:00 2001 From: butlerx Date: Sun, 22 Oct 2017 16:17:46 +0100 Subject: [PATCH] use mjs for module files --- app.js | 3 -- bin/index.js | 3 ++ cli.js => cli.mjs | 0 index.js | 4 +-- package.json | 79 +++++++++++++++++++++---------------------- wetty.js => wetty.mjs | 0 yarn.lock | 6 ++-- 7 files changed, 47 insertions(+), 48 deletions(-) delete mode 100644 app.js create mode 100644 bin/index.js rename cli.js => cli.mjs (100%) rename wetty.js => wetty.mjs (100%) diff --git a/app.js b/app.js deleted file mode 100644 index b2f296c..0000000 --- a/app.js +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env node -require('@std/esm'); -require('./cli'); diff --git a/bin/index.js b/bin/index.js new file mode 100644 index 0000000..a24a2ac --- /dev/null +++ b/bin/index.js @@ -0,0 +1,3 @@ +#! /usr/bin/env node +require = require('@std/esm')(module); // eslint-disable-line no-global-assign +require('../cli.mjs'); diff --git a/cli.js b/cli.mjs similarity index 100% rename from cli.js rename to cli.mjs diff --git a/index.js b/index.js index ca485da..26aecd1 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ -require('@std/esm'); -module.exports = require('./wetty').default; +require = require('@std/esm')(module); // eslint-disable-line no-global-assign +module.exports = require('./wetty.mjs').default; diff --git a/package.json b/package.json index f67a0c6..c883276 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,46 @@ { "name": "wetty.js", "version": "0.5.0", + "description": "Wetty = Web + tty. Terminal access in browser over http/https ", + "homepage": "https://github.com/butlerx/wetty", + "repository": { + "type": "git", + "url": "git://github.com/butlerx/wetty.git" + }, + "author": "Cian Butler (https://github.com/butlerx)", + "license": "MIT", + "bugs": { + "url": "https://github.com/butlerx/wetty/issues" + }, + "main": "index.js", + "files": [ + "bin", + "public", + "app.js", + "cli.js", + "wetty.js" + ], + "scripts": { + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "build": "gulp", + "start": "node bin", + "commit": "git add public", + "fix": "eslint . --fix" + }, + "bin": { + "wetty": "./bin/index.js" + }, + "pre-commit": [ + "fix", + "commit" + ], + "preferGlobal": "true", + "@std/esm": { + "cjs": "true" + }, "dependencies": { - "@std/esm": "^0.2.2", + "@std/esm": "^0.12.1", "express": "^4.15.3", "fs-extra": "^4.0.1", "optimist": "^0.6", @@ -37,44 +75,5 @@ "gulp-concat": "^2.6.1", "gulp-minify": "^1.0.0", "gulp-shell": "^0.6.3" - }, - "pre-commit": [ - "fix", - "commit" - ], - "description": "Wetty = Web + tty. Terminal access in browser over http/https ", - "repository": { - "type": "git", - "url": "git://github.com/butlerx/wetty.git" - }, - "author": "Cian Butler (https://github.com/butlerx)", - "license": "MIT", - "bugs": { - "url": "https://github.com/butlerx/wetty/issues" - }, - "homepage": "https://github.com/butlerx/wetty", - "preferGlobal": "true", - "main": "index.js", - "bin": { - "wetty": "./app.js" - }, - "@std/esm": { - "esm": "js", - "cjs": "true" - }, - "files": [ - "bin", - "public", - "app.js", - "cli.js", - "wetty.js" - ], - "scripts": { - "lint": "eslint .", - "lint:fix": "eslint . --fix", - "build": "gulp", - "start": "node app.js", - "commit": "git add public", - "fix": "eslint . --fix" } } diff --git a/wetty.js b/wetty.mjs similarity index 100% rename from wetty.js rename to wetty.mjs diff --git a/yarn.lock b/yarn.lock index bdd3bc1..cce41fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,9 @@ # yarn lockfile v1 -"@std/esm@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@std/esm/-/esm-0.2.2.tgz#8d3fdacae23015eae01db739a9f76d7cd1ab617d" +"@std/esm@^0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@std/esm/-/esm-0.12.1.tgz#d07b7c5e2701beade1e7db74b95484f5d91c46bf" abbrev@1: version "1.1.0"