npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svelte-adapter-appengine

v1.1.0

Published

Adapter for Svelte that integrates with Google Cloud Appengine

Downloads

1,139

Readme

svelte-adapter-appengine

Easily deploy your SvelteKit applications on Google Cloud App Engine with the svelte-adapter-appengine package.

npm Tests SvelteKit

Getting Started

To set up the adapter in your SvelteKit project:

  1. Install the package as a development dependency:
npm install --save-dev svelte-adapter-appengine
  1. Update your svelte.config.js to use the adapter:
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
+import adapter from "svelte-adapter-appengine";

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: vitePreprocess(),

  kit: {
+   adapter: adapter(),
  },
};

export default config;
  1. Build your application:
npm run build
  1. Deploy your application to App Engine:
gcloud app deploy --project <CLOUD_PROJECT_ID> build/app.yaml

Learn more about the gcloud utility in the official documentation

Configuration Options

Customize the adapter behavior using the following options:

adapter({
  // Build output directory (default: `/build`)
  out: "/build",

  // Enable Google Cloud Tracing Agent for improved logging (default: `false`)
  useCloudTracing: false,

  // Enable or disable Google Cloud Logging (default: `false`)
  // See: https://cloud.google.com/logging/docs/overview
  useCloudLogging: false,

  // Specify external modules for the esbuild step
  external: [],

  // Specify Node modules to be added to the `package.json` file in the build step
  // These modules will be fetched when the application is deployed
  dependencies: [],

  // Set the Node.js version for the App Engine runtime (default: `18`)
  // See available runtimes: https://cloud.google.com/appengine/docs/standard/nodejs/runtime
  nodejsRuntime: 18,
});

You can also customize the generated app.yaml file by creating an app.yaml file in your project root. The adapter will merge your custom configuration with the generated app.yaml, allowing you to define custom machine types, routes, or other app.yaml configurations.

Adapter Output

The Server-Side Rendering (SSR) part of SvelteKit is hosted on App Engine using a Node.js runtime, using polka to mimic @sveltejs/adapter-node .

Static files are served directly from Cloud Storage, bypassing the Node.js web server. The adapter automatically generates routes for all static assets in the app.yaml file.

Example Application

Check out a live example application at https://svelte-adapter-demo.uc.r.appspot.com/. This demo app is the default SvelteKit template deployed with the default adapter settings.