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

@squarespace/server

v1.9.0

Published

Squarespace Local Development Server

Downloads

177

Readme

Squarespace Local Development Server

Purpose

The local development server is a command line tool that sets up a test server on your computer, allowing you to see changes to your template before making them "live."

See the latest documentation at developers.squarespace.com/local-development.

Installation

To download the Squarespace Local Development Server, you need to have NPM installed on your computer. You should also ensure your NPM permissions are configured correctly.

Then:

npm install -g @squarespace/server

Usage

Prior to developing locally, you'll need a website set up with developer mode enabled. (See the Squarespace Quick Start guide.) Then clone your site into a folder using Git:

git clone https://site-name.squarespace.com/template.git

cd template

Then, to start Dev Server, run the following command:

squarespace-server https://site-name.squarespace.com

After starting squarespace-server, you will see the following screen:

Starting Development Server

           _
       /  /      _
      /  /  /  /   \
     /  /  /  /  /  |    Squarespace Inc.
    |  /  /  /  /  /     Local Development Environment
     \ _ /  /  /  /
              /  /
            -

Version 0.1.00
Listening on port 9000

The start-up message displays both the version of squarespace-server, and the port on which the server is running.

Now you can open your browser to your site by typing in the url http://localhost:9000. Any changes you make to your local template files will be visible when you refresh your browser.

Advanced Use

You can view all the options with the command:

squarespace-server --help

Here's a list of some of the more useful options:

squarespace-server URL [options]

Options:
  -h --help                           Show this screen.
  -d --directory=PATH                 Path to cloned template repository [default .].
  -p --port=PORT                      Port that server listens on [default 9000].
  -A --auto-reload                    Reloads page whenever file change is detected.
  -T --trigger-reload                 Reloads page when manually triggered via API.
  --auth                              Login to squarespace when starting server.
  --faster-less                       Separately compiles and caches system less.
  --verbose                           Verbose logging.
  --version                           Show version.

Run Authenticated

If you have a site password, or your site is in trial mode, you'll need to log into your site via the dev server. You can do that with the following command:

squarespace-server https://site-name.squarespace.com --auth

Page Reloading

The dev server can refresh the page when a change is detected. This can be performed either via the --auto-reload or --trigger-reload flags. With --auto-reload, a file watcher will monitor files in your template directory and refresh the page whenever a file changes. With --trigger-reload, the dev server will listen for a GET request to the /local-api/reload/trigger endpoint. Whenever such a request is received, it will refresh the page. This lets you configure a third-party file watching tool to trigger the reload.

File watching is an expensive task, so it's best to use trigger reloading when using a separate file-watcher to automatically transpile your template code. You can create a plugin for webpack or grunt to send the GET request when file changes are detected.

Both auto and trigger reloaders inject javascript into each page that listens for the reload events.

Faster Less

Normally all system and template less is compiled in a single pass into the main site.css file. The --faster-less option instead creates two separate files for the template and system css. This speeds up rendering by only compiling the template less per request, and caching system less. However some templates created by Squarespace contain less that depends on the system less and will break with this option enabled. Bottom-line, if you are working on a template from scratch this option will significantly speed up rendering.

Help and Feedback

If you have questions, or want to provide feedback on the Dev Server, please contact support and be sure to tell them that you're using the Squarespace Local Development Server.

License and Copyright

Copyright 2016 Squarespace, Inc.

Use of the Squarespace Development Server software (“Dev Server”) is governed by the Developer Terms of Use, available at http://developers.squarespace.com/developer-terms-of-use/. Java SE Runtime Environment Software is bundled with the Dev Server. By using the Dev Server, you agree to the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX, available at http://www.oracle.com/technetwork/java/javase/terms/license/index.html.