@form8ion/core
Advanced tools
Comparing version 2.0.0 to 3.0.0
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var fs = require('fs'); | ||
@@ -12,7 +10,2 @@ var path = require('path'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var spdxLicenseList__default = /*#__PURE__*/_interopDefaultLegacy(spdxLicenseList); | ||
var deepmerge__default = /*#__PURE__*/_interopDefaultLegacy(deepmerge); | ||
async function exists (path) { | ||
@@ -29,7 +22,5 @@ try { | ||
const stats = await exists(path); | ||
if (stats) { | ||
return stats.isFile(); | ||
} | ||
return stats; | ||
@@ -40,7 +31,5 @@ } | ||
const stats = await exists(path); | ||
if (stats) { | ||
return stats.isDirectory(); | ||
} | ||
return stats; | ||
@@ -81,3 +70,3 @@ } | ||
when: licenseChoicesShouldBePresented, | ||
choices: Array.from(spdxLicenseList__default["default"]), | ||
choices: Array.from(spdxLicenseList), | ||
default: 'MIT' | ||
@@ -96,3 +85,2 @@ }, { | ||
} | ||
function questionsForBaseDetails(decisions, projectRoot, copyrightHolder) { | ||
@@ -117,3 +105,2 @@ return [{ | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
@@ -125,6 +112,4 @@ var symbols = Object.getOwnPropertySymbols(object); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
@@ -139,7 +124,6 @@ for (var i = 1; i < arguments.length; i++) { | ||
} | ||
return target; | ||
} | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
@@ -155,5 +139,18 @@ Object.defineProperty(obj, key, { | ||
} | ||
return obj; | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
@@ -169,7 +166,6 @@ async function enhancerApplier ({ | ||
const previousResults = await acc; | ||
return deepmerge__default["default"](previousResults, await enhancer.lift(_objectSpread2({ | ||
return deepmerge(previousResults, await enhancer.lift(_objectSpread2({ | ||
results: previousResults | ||
}, options))); | ||
} | ||
return acc; | ||
@@ -191,17 +187,12 @@ }, results); | ||
} | ||
async function loadExistingConfig(path, name, format) { | ||
const filePath = buildFilePathFrom(path, name, format); | ||
if (fileTypes.JSON === format) { | ||
return JSON.parse(await fs.promises.readFile(filePath, 'utf-8')); | ||
} | ||
if (fileTypes.YAML === format) { | ||
return jsYaml.load(await fs.promises.readFile(filePath, 'utf-8')); | ||
} | ||
throw new Error('The requested format for the config file is unsupported'); | ||
} | ||
function write({ | ||
@@ -214,11 +205,8 @@ format, | ||
const filePath = buildFilePathFrom(path, name, format); | ||
if (fileTypes.JSON === format) { | ||
return fs.promises.writeFile(filePath, JSON.stringify(config, null, 2)); | ||
} | ||
if (fileTypes.YAML === format) { | ||
return fs.promises.writeFile(filePath, jsYaml.dump(config)); | ||
} | ||
throw new Error('The requested format for the config file is unsupported'); | ||
@@ -235,3 +223,3 @@ } | ||
format, | ||
config: deepmerge__default["default"].all([existingConfig, config]), | ||
config: deepmerge.all([existingConfig, config]), | ||
path, | ||
@@ -238,0 +226,0 @@ name |
@@ -5,16 +5,11 @@ { | ||
"license": "MIT", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"engines": { | ||
"node": "^14.18 || >=16" | ||
"node": "^16.14 || >=18" | ||
}, | ||
"files": [ | ||
"example.js", | ||
"lib/" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "Matt Travi <npm@travi.org> (https://matt.travi.org/)", | ||
"repository": "form8ion/core", | ||
"bugs": "https://github.com/form8ion/core/issues", | ||
"homepage": "https://npm.im/@form8ion/core", | ||
"runkitExampleFilename": "./example.js", | ||
"main": "lib/index.js", | ||
"module": "lib/index.mjs", | ||
"exports": { | ||
@@ -24,7 +19,5 @@ "require": "./lib/index.js", | ||
}, | ||
"main": "lib/index.js", | ||
"module": "lib/index.mjs", | ||
"sideEffects": false, | ||
"repository": "form8ion/core", | ||
"bugs": "https://github.com/form8ion/core/issues", | ||
"homepage": "https://npm.im/@form8ion/core", | ||
"author": "Matt Travi <npm@travi.org> (https://matt.travi.org/)", | ||
"scripts": { | ||
@@ -38,3 +31,3 @@ "test": "npm-run-all --print-label build --parallel lint:* --parallel test:*", | ||
"lint:sensitive": "ban", | ||
"pretest:integration": "preview", | ||
"pretest:integration": "run-s build", | ||
"lint:gherkin": "gherkin-lint", | ||
@@ -56,42 +49,51 @@ "test:integration": "run-s 'test:integration:base -- --profile noWip'", | ||
"prepare": "husky install", | ||
"lint:engines": "ls-engines" | ||
"lint:engines": "ls-engines", | ||
"lint:publish": "publint --strict" | ||
}, | ||
"files": [ | ||
"example.js", | ||
"lib/" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"dependencies": { | ||
"@travi/cli-messages": "^1.0.5", | ||
"deepmerge": "^4.2.2", | ||
"js-yaml": "^4.1.0", | ||
"spdx-license-list": "6.6.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/register": "7.18.9", | ||
"@cucumber/cucumber": "8.5.0", | ||
"@form8ion/babel-preset": "1.6.93", | ||
"@form8ion/commitlint-config": "1.0.36", | ||
"@form8ion/eslint-config": "5.0.7", | ||
"@babel/register": "7.22.5", | ||
"@cucumber/cucumber": "9.2.0", | ||
"@form8ion/babel-preset": "1.6.105", | ||
"@form8ion/commitlint-config": "1.0.52", | ||
"@form8ion/eslint-config": "5.0.35", | ||
"@form8ion/eslint-config-cucumber": "1.4.1", | ||
"@form8ion/eslint-config-mocha": "2.0.3", | ||
"@form8ion/remark-lint-preset": "4.0.1", | ||
"@rollup/plugin-babel": "5.3.1", | ||
"@travi/any": "2.1.5", | ||
"ban-sensitive-files": "1.9.18", | ||
"c8": "7.12.0", | ||
"chai": "4.3.6", | ||
"@form8ion/remark-lint-preset": "5.0.9", | ||
"@rollup/plugin-babel": "6.0.3", | ||
"@travi/any": "2.1.8", | ||
"ban-sensitive-files": "1.9.19", | ||
"c8": "8.0.0", | ||
"chai": "4.3.7", | ||
"cross-env": "7.0.3", | ||
"cz-conventional-changelog": "3.3.0", | ||
"gherkin-lint": "4.2.2", | ||
"husky": "8.0.1", | ||
"lockfile-lint": "4.7.6", | ||
"ls-engines": "0.7.0", | ||
"mocha": "10.0.0", | ||
"mock-fs": "5.1.2", | ||
"husky": "8.0.3", | ||
"lockfile-lint": "4.10.6", | ||
"ls-engines": "0.9.0", | ||
"mocha": "10.2.0", | ||
"mock-fs": "5.2.0", | ||
"npm-run-all": "4.1.5", | ||
"package-preview": "4.0.0", | ||
"publint": "0.1.16", | ||
"remark-cli": "11.0.0", | ||
"remark-toc": "8.0.1", | ||
"remark-usage": "10.0.1", | ||
"rimraf": "3.0.2", | ||
"rollup": "2.77.0", | ||
"rimraf": "5.0.1", | ||
"rollup": "3.26.2", | ||
"rollup-plugin-auto-external": "2.0.0", | ||
"sinon": "14.0.0" | ||
}, | ||
"dependencies": { | ||
"@travi/cli-messages": "^1.0.5", | ||
"deepmerge": "^4.2.2", | ||
"js-yaml": "^4.1.0", | ||
"spdx-license-list": "6.6.0" | ||
"sinon": "15.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
49161
423