Compare commits

...

8 Commits

Author SHA1 Message Date
d7b08034da 5.4.49 2016-10-05 12:59:46 +02:00
349c6cce77 fix 2016-10-05 12:59:30 +02:00
4770b1e349 5.4.48 2016-10-05 12:37:48 +02:00
7043a844f0 fix cli 2016-10-05 12:37:45 +02:00
5f4a8d3ee5 5.4.47 2016-10-05 12:27:34 +02:00
0b6fc610e8 made cli.js path discovery smarter 2016-10-05 12:27:30 +02:00
3d78bf268d 5.4.46 2016-10-03 12:45:56 +02:00
36887512ee 5.4.45 2016-10-03 12:38:56 +02:00
6 changed files with 19 additions and 11 deletions

View File

@ -1,2 +1,2 @@
#!/usr/bin/env node #!/usr/bin/env node
var index = require("./index.js"); var index = require("../{{pathToIndex}}");

2
assets/cliNpmts.js Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
var index = require("../dist/index.js");

2
dist/cli.js vendored
View File

@ -1,2 +1,2 @@
#!/usr/bin/env node #!/usr/bin/env node
var index = require("./index.js"); var index = require("../{{pathToIndex}}");

View File

@ -3,12 +3,16 @@ const plugins = require("./npmts.plugins");
const paths = require("./npmts.paths"); const paths = require("./npmts.paths");
const q = require("q"); const q = require("q");
const npmts_promisechain_1 = require("./npmts.promisechain"); const npmts_promisechain_1 = require("./npmts.promisechain");
const npmts_check_1 = require("./npmts.check");
exports.run = function (configArg) { exports.run = function (configArg) {
let done = q.defer(); let done = q.defer();
let config = configArg; let config = configArg;
npmts_promisechain_1.npmtsOra.text('now looking at ' + 'required assets'.yellow); npmts_promisechain_1.npmtsOra.text('now looking at ' + 'required assets'.yellow);
if (config.cli === true) { if (config.cli === true) {
plugins.smartfile.fs.copySync(plugins.path.join(paths.npmtsAssetsDir, 'cli.js'), plugins.path.join(paths.distDir, 'cli.js')); let mainJsPath = npmts_check_1.projectInfo.packageJson.main;
let cliJsString = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir, 'cli.js'));
cliJsString = cliJsString.replace('{{pathToIndex}}', mainJsPath);
plugins.smartfile.memory.toFsSync(cliJsString, plugins.path.join(paths.distDir, 'cli.js'));
plugins.beautylog.ok('installed CLI assets!'); plugins.beautylog.ok('installed CLI assets!');
done.resolve(config); done.resolve(config);
} }

View File

@ -1,16 +1,16 @@
{ {
"name": "npmts", "name": "npmts",
"version": "5.4.44", "version": "5.4.49",
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.", "description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
"npmts": "dist/cli.js" "npmts": "assets/cliNpmts.js"
}, },
"scripts": { "scripts": {
"test": "(npm run compile && npm run prepareTest && npm run setupCheck && npm run check && npm run checkVersion && npm run checkNoTest && npm run checkNoDocs)", "test": "(npm run compile && npm run prepareTest && npm run setupCheck && npm run check && npm run checkVersion && npm run checkNoTest && npm run checkNoDocs)",
"testShort": "(npm run compile && npm run check)", "testShort": "(npm run compile && npm run check)",
"prepareTest": "(rm -rf test/)", "prepareTest": "(rm -rf test/)",
"compile": "(rm -r dist/ && tsc && cp assets/cli.js dist/ )", "compile": "(rm -r dist/ && tsc)",
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)", "setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
"typedoc": "(typedoc --out ./pages/api --target ES6 ./ts/)", "typedoc": "(typedoc --out ./pages/api --target ES6 ./ts/)",
"npmpage": "(npmpage)", "npmpage": "(npmpage)",

View File

@ -2,17 +2,19 @@ import plugins = require('./npmts.plugins')
import paths = require('./npmts.paths') import paths = require('./npmts.paths')
import * as q from 'q' import * as q from 'q'
import {npmtsOra} from './npmts.promisechain'
import { npmtsOra } from './npmts.promisechain'
import { projectInfo } from './npmts.check'
export var run = function(configArg){ export var run = function(configArg){
let done = q.defer() let done = q.defer()
let config = configArg let config = configArg
npmtsOra.text('now looking at ' + 'required assets'.yellow) npmtsOra.text('now looking at ' + 'required assets'.yellow)
if (config.cli === true) { if (config.cli === true) {
plugins.smartfile.fs.copySync( let mainJsPath = projectInfo.packageJson.main
plugins.path.join(paths.npmtsAssetsDir,'cli.js'), let cliJsString: string = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir,'cli.js'))
plugins.path.join(paths.distDir,'cli.js') cliJsString = cliJsString.replace('{{pathToIndex}}',mainJsPath)
) plugins.smartfile.memory.toFsSync(cliJsString, plugins.path.join(paths.distDir,'cli.js'))
plugins.beautylog.ok('installed CLI assets!') plugins.beautylog.ok('installed CLI assets!')
done.resolve(config) done.resolve(config)
} else { } else {