Socket
Socket
Sign inDemoInstall

@sveltejs/adapter-netlify

Package Overview
Dependencies
Maintainers
4
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-netlify - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

45

index.js

@@ -1,2 +0,9 @@

import { appendFileSync, existsSync, readFileSync, writeFileSync } from 'fs';
import {
appendFileSync,
existsSync,
readFileSync,
writeFileSync,
unlinkSync,
createReadStream
} from 'fs';
import { dirname, join, resolve, posix } from 'path';

@@ -6,2 +13,3 @@ import { fileURLToPath } from 'url';

import toml from '@iarna/toml';
import { createInterface } from 'readline';

@@ -55,6 +63,39 @@ /**

const redirects_file_path = join(publish, '_redirects');
// If redirects file exists - empty any netlify generated files in functions-internal
// Without removing other files that may have been auto generated by integrations
if (existsSync(redirects_file_path)) {
// Read each line of the file
const fileStream = createReadStream(redirects_file_path);
const rl = createInterface({
input: fileStream,
crlfDelay: Infinity
});
// Create an array of lines
const lines = [];
for await (const line of rl) {
lines.push(line);
}
const functions_internal = join('.netlify', 'functions-internal');
// Loop through redirects, and delete corresponding functions-internal files
lines.forEach((line) => {
if (line) {
// example line /.netlify/functions/{function_name} 200
const path = line.split(' ')[1];
const function_name = path.split('/').pop();
const mjsFile = join(functions_internal, `${function_name}.mjs`);
const jsonFile = join(functions_internal, `${function_name}.json`);
if (existsSync(mjsFile)) unlinkSync(mjsFile);
if (existsSync(jsonFile)) unlinkSync(jsonFile);
}
});
}
// empty out existing build directories
builder.rimraf(publish);
builder.rimraf('.netlify/edge-functions');
builder.rimraf('.netlify/functions-internal');
builder.rimraf('.netlify/server');

@@ -61,0 +102,0 @@ builder.rimraf('.netlify/package.json');

4

package.json
{
"name": "@sveltejs/adapter-netlify",
"version": "2.0.1",
"version": "2.0.2",
"repository": {

@@ -41,3 +41,3 @@ "type": "git",

"uvu": "^0.5.6",
"@sveltejs/kit": "^1.5.0"
"@sveltejs/kit": "^1.5.1"
},

@@ -44,0 +44,0 @@ "peerDependencies": {

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