create-oas
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,4 +5,5 @@ #!/usr/bin/env node | ||
import readline from 'node:readline/promises'; | ||
import { fileURLToPath } from 'url'; | ||
import esMain from 'es-main'; | ||
import { createOas, writeFile } from '../index.js'; | ||
@@ -38,3 +39,3 @@ | ||
if (process.argv[1] === fileURLToPath(import.meta.url)) { | ||
if (esMain(import.meta)) { | ||
ask({}) | ||
@@ -41,0 +42,0 @@ .then(createOas) |
{ | ||
"name": "create-oas", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Create a new OAS file in your repository", | ||
@@ -32,4 +32,5 @@ "bin": "./bin/create-oas.js", | ||
"dependencies": { | ||
"es-main": "^1.3.0", | ||
"js-yaml": "^4.1.0" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { readFileSync } from 'fs'; | ||
import assert from 'node:assert/strict'; | ||
@@ -9,2 +10,4 @@ import { mkdtemp } from 'node:fs/promises'; | ||
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8')); | ||
function getNextQuestion(output) { | ||
@@ -53,3 +56,3 @@ return new Promise(resolve => { | ||
input.write('\n'); | ||
assert.strictEqual(await getNextQuestion(output), 'Version number? (1.0.0)'); | ||
assert.strictEqual(await getNextQuestion(output), `Version number? (${pkg.version})`); | ||
input.write('\n'); | ||
@@ -65,3 +68,3 @@ assert.strictEqual(await getNextQuestion(output), 'License? (MIT)'); | ||
title: 'create-oas', | ||
version: '1.0.0', | ||
version: pkg.version, | ||
license: 'MIT', | ||
@@ -68,0 +71,0 @@ url: 'https://example.com', |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
9413
241
2
1
+ Addedes-main@^1.3.0
+ Addedes-main@1.3.0(transitive)