Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/adapter-node

Package Overview
Dependencies
Maintainers
3
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-node - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

CHANGELOG.md

56

index.js
const fs = require('fs');
const path = require('path');
const glob = require('tiny-glob/sync');
const { copy, prerender } = require('@sveltejs/app-utils');
const mkdirp = dir => {
try {
fs.mkdirSync(dir, { recursive: true });
} catch {}
}
module.exports = async function adapter({
dir,
manifest,
log
}) {
const out = 'build'; // TODO implement adapter options
module.exports = function builder({
input,
output,
manifest
}, opts = {}) {
mkdirp(`${output}/assets/_app`);
copy(`${dir}/client`, `${out}/assets/_app`, file => file[0] !== '.');
copy(`${dir}/server`, out);
copy(`${__dirname}/server.js`, `${out}/index.js`);
copy(`${dir}/client.json`, `${out}/client.json`);
copy('src/app.html', `${out}/app.html`);
// copy client code
const client_code = path.resolve(input, 'client');
glob('**/*', { cwd: client_code, filesOnly: true }).forEach(file => {
if (file[0] !== '.') {
fs.copyFileSync(`${client_code}/${file}`, `${output}/assets/_app/${file}`);
}
});
log.minor('Prerendering static pages...');
// copy server code
const server_code = path.resolve(input, 'server');
glob('**/*', { cwd: server_code, filesOnly: true }).forEach(file => {
if (file[0] !== '.') {
mkdirp(path.dirname(`${output}/${file}`));
fs.copyFileSync(`${server_code}/${file}`, `${output}/${file}`);
}
await prerender({
dir,
out,
manifest,
log
});
// copy the server entry point
fs.copyFileSync(path.resolve(__dirname, 'server.js'), `${output}/index.js`);
// generate manifest

@@ -51,9 +39,3 @@ const written_manifest = `module.exports = {

fs.writeFileSync(`${output}/manifest.js`, written_manifest);
// copy client manifest
fs.copyFileSync(`${input}/client.json`, `${output}/client.json`);
// copy template
fs.copyFileSync(`src/app.html`, `${output}/app.html`);
fs.writeFileSync(`${out}/manifest.js`, written_manifest);
};
{
"name": "@sveltejs/adapter-node",
"version": "0.0.3",
"devDependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-sucrase": "^3.1.0",
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.2.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"cookie": "^0.4.1",
"devalue": "^2.0.1",
"eslint": "^7.11.0",
"eslint-plugin-import": "^2.22.1",
"node-fetch": "^2.6.1",
"rollup": "^2.29.0",
"sirv": "^1.0.6",
"svelte": "^3.29.0",
"typescript": "^4.0.3"
},
"main": "index.js",
"files": [
"server.js"
],
"scripts": {
"dev": "rollup -cw",
"build": "rollup -c",
"prepublish": "npm run build"
}
"name": "@sveltejs/adapter-node",
"version": "0.0.4",
"devDependencies": {
"rollup": "^2.32.0",
"sirv": "^1.0.7"
},
"main": "index.js",
"files": [
"server.js"
],
"scripts": {
"dev": "rollup -cw",
"build": "rollup -c",
"prepare": "npm run build",
"prepublishOnly": "npm run build"
},
"dependencies": {
"@sveltejs/app-utils": "0.0.7"
}
}

Sorry, the diff of this file is too big to display

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