Socket
Socket
Sign inDemoInstall

@sveltejs/kit

Package Overview
Dependencies
Maintainers
4
Versions
785
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/kit - npm Package Compare versions

Comparing version 2.5.15 to 2.5.16

src/utils/import.js

2

package.json
{
"name": "@sveltejs/kit",
"version": "2.5.15",
"version": "2.5.16",
"description": "The fastest way to build Svelte apps",

@@ -5,0 +5,0 @@ "keywords": [

import { load_config } from './src/core/config/index.js';
import * as sync from './src/core/sync/sync.js';
import glob from 'tiny-glob/sync.js';

@@ -41,2 +40,5 @@ import fs from 'node:fs';

// defer import until after the chdir so that peer dependency resolves correctly
const sync = await import('./src/core/sync/sync.js');
try {

@@ -43,0 +45,0 @@ const config = await load_config();

import fs from 'node:fs';
import path from 'node:path';
import { VERSION } from 'svelte/compiler';
import { mkdirp } from '../../utils/filesystem.js';
import { resolve_peer_dependency } from '../../utils/import.js';
/** @type {string} */
let VERSION;
try {
({ VERSION } = await resolve_peer_dependency('svelte/compiler'));
} catch {
// we can end up here from e.g. unit tests. this is the simplest fix
({ VERSION } = await import('svelte/compiler'));
}
/** @type {Map<string, string>} */

@@ -7,0 +17,0 @@ const previous_contents = new Map();

import fs from 'node:fs';
import path from 'node:path';
import * as imr from 'import-meta-resolve';
import colors from 'kleur';

@@ -37,3 +36,3 @@

} from './module_ids.js';
import { pathToFileURL } from 'node:url';
import { resolve_peer_dependency } from '../../utils/import.js';

@@ -128,19 +127,2 @@ const cwd = process.cwd();

/**
* Resolve a dependency relative to the current working directory,
* rather than relative to this package
* @param {string} dependency
*/
async function resolve_peer_dependency(dependency) {
try {
// @ts-expect-error the types are wrong
const resolved = imr.resolve(dependency, pathToFileURL(process.cwd() + '/dummy.js'));
return import(resolved);
} catch {
throw new Error(
`Could not resolve peer dependency "${dependency}" relative to your project — please install it and try again.`
);
}
}
/**
* Returns the SvelteKit Vite plugins.

@@ -147,0 +129,0 @@ * @returns {Promise<import('vite').Plugin[]>}

// generated during release, do not modify
/** @type {string} */
export const VERSION = '2.5.15';
export const VERSION = '2.5.16';

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc