Comparing version 0.1.13 to 0.1.15
@@ -8,3 +8,3 @@ #!/usr/bin/env node | ||
const get = require('lodash/get'); | ||
const { standardizePresetName } = require('../src/utils'); | ||
const { resolvePresetName } = require('../src/utils'); | ||
@@ -52,3 +52,3 @@ process.on('unhandledRejection', (err) => { | ||
const presetPath = resolveFrom(context, standardizePresetName(presetName)); | ||
const presetPath = resolveFrom(context, resolvePresetName(presetName)); | ||
const run = haste(presetPath); | ||
@@ -55,0 +55,0 @@ const preset = require(presetPath); |
{ | ||
"name": "haste-cli", | ||
"version": "0.1.13", | ||
"version": "0.1.15", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Ronen Amiel", |
@@ -0,1 +1,3 @@ | ||
const path = require('path'); | ||
const HASTE_PRESET_PREFIX_REGEX = /^(?!@|[^/]+\/|haste-preset-)/; | ||
@@ -7,1 +9,9 @@ | ||
}; | ||
module.exports.resolvePresetName = (name) => { | ||
if (path.isAbsolute(name)) { | ||
return name; | ||
} | ||
return module.exports.standardizePresetName(name); | ||
}; |
@@ -37,2 +37,12 @@ const path = require('path'); | ||
it('should not normalize preset name if it is an absolute path', async () => { | ||
const absolutePresetPath = require.resolve('./fixtures/basic/node_modules/haste-preset-basic'); | ||
const result = await execa(process.execPath, [HASTE_BIN, 'build', '--preset', absolutePresetPath], { | ||
cwd: path.join(__dirname, './fixtures/cli-configured'), | ||
}); | ||
expect(result.stdout).toMatch(/running build.../); | ||
}); | ||
it('should throw if no "preset" was configured (via cli/config)', async () => { | ||
@@ -39,0 +49,0 @@ expect.assertions(2); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50225
10
154