@sveltejs/adapter-node
Advanced tools
Comparing version 0.0.14 to 0.0.15
# @sveltejs/adapter-node | ||
## 0.0.15 | ||
### Patch Changes | ||
- b475ed4: Overhaul adapter API - fixes #166 | ||
- Updated dependencies [b475ed4] | ||
- @sveltejs/app-utils@0.0.18 | ||
## 0.0.14 | ||
@@ -4,0 +12,0 @@ |
45
index.js
@@ -0,42 +1,17 @@ | ||
'use strict'; | ||
const fs = require('fs'); | ||
const { prerender } = require('@sveltejs/app-utils/renderer'); | ||
const { copy } = require('@sveltejs/app-utils/files'); | ||
module.exports = async function adapter({ | ||
dir, | ||
manifest, | ||
log | ||
}) { | ||
module.exports = async function adapter(builder) { | ||
const out = 'build'; // TODO implement adapter options | ||
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`); | ||
builder.copy_server_files(out); | ||
builder.copy_client_files(`${out}/assets/_app`); | ||
log.minor('Prerendering static pages...'); | ||
fs.copyFileSync(`${__dirname}/files/server.js`, `${out}/index.js`); | ||
await prerender({ | ||
dir, | ||
out: `${out}/prerendered`, | ||
assets: `${out}/assets`, | ||
manifest, | ||
log | ||
builder.log.info('Prerendering static pages...'); | ||
await builder.prerender({ | ||
dest: `${out}/prerendered` | ||
}); | ||
// generate manifest | ||
const written_manifest = `module.exports = { | ||
layout: ${JSON.stringify(manifest.layout)}, | ||
error: ${JSON.stringify(manifest.error)}, | ||
components: ${JSON.stringify(manifest.components)}, | ||
pages: [ | ||
${manifest.pages.map(page => `{ pattern: ${page.pattern}, parts: ${JSON.stringify(page.parts)} }`).join(',\n\t\t\t')} | ||
], | ||
endpoints: [ | ||
${manifest.endpoints.map(route => `{ name: '${route.name}', pattern: ${route.pattern}, file: '${route.file}', params: ${JSON.stringify(route.params)} }`).join(',\n\t\t\t')} | ||
] | ||
};`.replace(/^\t/gm, ''); | ||
fs.writeFileSync(`${out}/manifest.js`, written_manifest); | ||
}; | ||
}; |
{ | ||
"name": "@sveltejs/adapter-node", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"main": "index.js", | ||
@@ -11,8 +11,9 @@ "files": [ | ||
"build": "rollup -c", | ||
"lint": "eslint --ignore-pattern node_modules/ '**/*.{ts,js,svelte}'", | ||
"prepare": "npm run build", | ||
"lint": "eslint --ignore-pattern node_modules/ \"**/*.{ts,js,svelte}\" && npm run check-format", | ||
"format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore", | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"@sveltejs/app-utils": "0.0.17" | ||
"@sveltejs/app-utils": "0.0.18" | ||
}, | ||
@@ -19,0 +20,0 @@ "devDependencies": { |
@@ -5,2 +5,2 @@ # adapter-node | ||
This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change. | ||
This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
6
2
1
3994
5
12
+ Added@sveltejs/app-utils@0.0.18(transitive)
- Removed@sveltejs/app-utils@0.0.17(transitive)
Updated@sveltejs/app-utils@0.0.18