@fastify/autoload
Advanced tools
Comparing version 5.5.0 to 5.6.0
{ | ||
"name": "@fastify/autoload", | ||
"version": "5.5.0", | ||
"version": "5.6.0", | ||
"description": "Require all plugins in a directory", | ||
"main": "index.js", | ||
"types": "fastify-autoload.d.ts", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
@@ -21,4 +21,3 @@ "lint": "standard | snazzy", | ||
"unit": "node scripts/unit.js", | ||
"unit:with-modules": "tap test/commonjs/*.js test/module/*.js test/typescript/*.ts", | ||
"unit:without-modules": "tap test/commonjs/*.js test/typescript/*.ts" | ||
"unit:with-modules": "tap test/commonjs/*.js test/module/*.js test/typescript/*.ts" | ||
}, | ||
@@ -58,3 +57,2 @@ "repository": { | ||
"jest": "^28.1.3", | ||
"semver": "^7.3.7", | ||
"snazzy": "^9.0.0", | ||
@@ -83,5 +81,2 @@ "standard": "^17.0.0", | ||
}, | ||
"tsd": { | ||
"directory": "test/typescript/definitions" | ||
}, | ||
"jest": { | ||
@@ -88,0 +83,0 @@ "preset": "ts-jest", |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'node', | ||
'-r esbuild-register', | ||
'test/typescript/basic.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
const args = [ | ||
'node', | ||
'-r esbuild-register', | ||
'test/typescript/basic.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'tap', | ||
'--node-arg=--loader=ts-node/esm', | ||
'--node-arg=--experimental-specifier-resolution=node', | ||
'--no-coverage', | ||
'test/typescript-esm/*.ts' | ||
] | ||
const args = [ | ||
'tap', | ||
'--node-arg=--loader=ts-node/esm', | ||
'--node-arg=--experimental-specifier-resolution=node', | ||
'--no-coverage', | ||
'test/typescript-esm/*.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true, | ||
env: { | ||
...process.env, | ||
TS_NODE_COMPILER_OPTIONS: JSON.stringify({ | ||
module: 'ESNext', | ||
target: 'ES2020', | ||
allowJs: false, | ||
moduleResolution: 'node', | ||
esModuleInterop: true | ||
}) | ||
} | ||
}) | ||
const child = exec(args.join(' '), { | ||
shell: true, | ||
env: { | ||
...process.env, | ||
TS_NODE_COMPILER_OPTIONS: JSON.stringify({ | ||
module: 'ESNext', | ||
target: 'ES2020', | ||
allowJs: false, | ||
moduleResolution: 'node', | ||
esModuleInterop: true | ||
}) | ||
} | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'tap', | ||
'--node-arg=--require=@swc-node/register', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const args = [ | ||
'tap', | ||
'--node-arg=--require=@swc-node/register', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'tap', | ||
'--node-arg=--require=@swc/register', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const args = [ | ||
'tap', | ||
'--node-arg=--require=@swc/register', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'tap', | ||
'--no-ts', | ||
'--node-arg=--require=tsm', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const args = [ | ||
'tap', | ||
'--no-ts', | ||
'--node-arg=--require=tsm', | ||
'--no-coverage', | ||
'test/typescript/*.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
if (semver.satisfies(process.version, '>= 14')) { | ||
const args = [ | ||
'npx', | ||
'tsx', | ||
'test/typescript/basic.ts' | ||
] | ||
const args = [ | ||
'npx', | ||
'tsx', | ||
'test/typescript/basic.ts' | ||
] | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
const child = exec(args.join(' '), { | ||
shell: true | ||
}) | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) | ||
} | ||
child.stdout.pipe(process.stdout) | ||
child.stderr.pipe(process.stderr) | ||
child.once('close', process.exit) |
'use strict' | ||
const { exec } = require('child_process') | ||
const semver = require('semver') | ||
const child = exec(semver.satisfies('>=14 || >= 12.17.0 < 13.0.0') | ||
? 'npm run unit:with-modules' | ||
: 'npm run unit:without-modules') | ||
const child = exec('npm run unit:with-modules') | ||
@@ -10,0 +7,0 @@ child.stdout.pipe(process.stdout) |
@@ -5,6 +5,3 @@ 'use strict' | ||
const fastify = require('fastify') | ||
const semver = require('semver') | ||
const moduleSupport = semver.satisfies(process.version, '>= 14 || >= 12.17.0 < 13.0.0') | ||
t.test('independent of module support', function (t) { | ||
@@ -48,15 +45,1 @@ t.plan(8) | ||
}) | ||
if (!moduleSupport) { | ||
t.test('without moduleSupport', function (t) { | ||
t.plan(2) | ||
const app = fastify() | ||
app.register(require('./module-error/app')) | ||
app.ready(function (err) { | ||
t.type(err, Error) | ||
t.match(err.message, /cannot import plugin at .*mjs/i) | ||
}) | ||
}) | ||
} |
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
25
116353
3398