All Projects โ†’ the-couch โ†’ Slater

the-couch / Slater

๐Ÿ›  Shopify development toolkit

Labels

Projects that are alternatives of or similar to Slater

just-the-class
A modern, highly customizable, responsive Jekyll template for course websites.
Stars: โœญ 156 (-51.4%)
Mutual labels:  liquid
additives
Additions to Liquid for mindmapping, interactions with documents, syntax highlight extensions, slideshows, ...
Stars: โœญ 15 (-95.33%)
Mutual labels:  liquid
korte
Kotlin cORoutines Template Engine for Multiplatform Kotlin
Stars: โœญ 69 (-78.5%)
Mutual labels:  liquid
dry
Dry is a new template engine and language, and is a superset of Shopify's Liquid, with first-class support for advanced inheritance features, and more. From the creators of Enquirer, Assemble, Remarkable, and Micromatch.
Stars: โœญ 66 (-79.44%)
Mutual labels:  liquid
kunnan.github.io
@zhangkn
Stars: โœญ 13 (-95.95%)
Mutual labels:  liquid
NextCommunity.github.io
Join FREE: Community of open-source programmers and software engineers.
Stars: โœญ 29 (-90.97%)
Mutual labels:  liquid
liquid button
Liquify your buttons, web demo at website
Stars: โœญ 18 (-94.39%)
Mutual labels:  liquid
Liquidsimulator
Cellular Automaton 2D Liquid Simulator for Unity
Stars: โœญ 302 (-5.92%)
Mutual labels:  liquid
react-liquid
Liquid templating language component for React
Stars: โœญ 50 (-84.42%)
Mutual labels:  liquid
vscode-liquid-snippets
Shopify Liquid Template Snippets
Stars: โœญ 22 (-93.15%)
Mutual labels:  liquid
gulp-shopify-theme
Shopify theme synchronisation during development
Stars: โœญ 26 (-91.9%)
Mutual labels:  liquid
bitcoin-stack
Docker setup for Bitcoin, Elements/Liquid, LND, C-Lightning, Eclair, & Electrs in regtest mode
Stars: โœญ 66 (-79.44%)
Mutual labels:  liquid
liquidpy
A port of liquid template engine for python
Stars: โœญ 49 (-84.74%)
Mutual labels:  liquid
bootstrap-shopify-theme
๐Ÿ› A free Shopify Theme built with Bootstrap, BEM, Liquid, Sass, ESNext, Theme Tools, ... and Webpack.
Stars: โœญ 41 (-87.23%)
Mutual labels:  liquid
silkky.cloud
๐Ÿ›ก๏ธ ๐Ÿ›ฐ๏ธ Infrastructure, resources and guides aimed at protecting your privacy against global surveillance.
Stars: โœญ 21 (-93.46%)
Mutual labels:  liquid
shopify-wishlist
๐Ÿ’™ A set of files used to implement a simple customer wishlist on a Shopify store
Stars: โœญ 115 (-64.17%)
Mutual labels:  liquid
layouts
Wraps templates with layouts. Layouts can use other layouts and be nested to any depth. This can be used 100% standalone to wrap any kind of file with banners, headers or footer content. Use for markdown, HTML, handlebars views, lo-dash templates, etc. Layouts can also be vinyl files.
Stars: โœญ 28 (-91.28%)
Mutual labels:  liquid
Jekyll Toc
A GitHub Pages compatible Table of Contents generator without a plugin or JavaScript
Stars: โœญ 306 (-4.67%)
Mutual labels:  liquid
Shopify Theme Lab
Shopify theme development environment using Liquid, Vue and Tailwind CSS ๐Ÿงช
Stars: โœญ 250 (-22.12%)
Mutual labels:  liquid
jekyll-tipue-search
Full-text search in Jekyll with Tipue Search. Github Pages compatible. (This repository is archived. Issues are disabled. Pull requests will be ignored.)
Stars: โœญ 83 (-74.14%)
Mutual labels:  liquid

repo-banner

npm i slater -g

A new toolkit for building and deploying themes on Shopify.


This project is an active work in progress!

The CLI for compiling and uploading themes is stable, but the starter theme needs some love!

Want to help? We'd love to have you. Ideas, feedback, critiques ๐Ÿ‘‰ shoot us an Issue.


Features

  • asset pipeline via Webpack, Babel, PostCSS/SASS
  • built-in deployment tool
  • live reloading
  • simple config
  • easy integration into existing themes
  • starter theme (WIP)

Table of Contents


Quick Start

The easist way to get started with Slater is slater init. init outputs a default folder structure into the directory of your choice.

slater init <root>

Don't forget to install the dependencies.

npm install

You'll need to define one or more themes in the provided slater.config.js file to deploy to, similar to a standard Shopify config.yml file.

module.exports = {
  themes: {
    development: {
      id: '12345...',
      password: 'abcde...',
      store: 'store-name.myshopify.com',
      ignore: [
        'settings_data.json'
      ]
    }
  }
}

Then, from the project root:

slater watch

And that's it! Slater will watch your local theme for changes and sync them to your remote site when they update ๐ŸŽ‰.

Usage

Slater makes some assumptions out of the box, but it can be easily customized to fit most existing projects.

Themes

Slater projects require themes to be defined in the slater.config.js.

By default it looks for a theme called development:

module.exports = {
  themes: {
    development: { ... }
  }
}

You can call it whatever you want though.

module.exports = {
  themes: {
    dev: { ... }
  }
}

Just be sure to specify your theme name on the CLI:

slater build --theme dev

You can also define as many themes as you like. Use these for a production theme, staging, or whatever you like.

module.exports = {
  themes: {
    dev: { ... },
    test: { ... },
    live: { ... }
  }
}

Theme IDs and Passwords

Each of these themes should have its own theme id value. Theme IDs can be found by going to Online Store > Themes > Customize Theme and plucking the ID from the URL i.e. ../admin/themes/<id>/editor.

All themes can use the same password property. To get one, create your own private app and pull it from there. Make sure your private app allows for read/write to the "Theme templates and theme assets".

Directory Structure

All theme files should be located within a single source directory. By default, Slater looks for a /src directory in your project root.

To adjust this, specify an in prop on your config:

module.exports = {
  in: '/source'
}

Files within this directory will be built and copied to /build in your project root, and then synced to your remote theme.

To adjust your local build directory, specify an out prop on your config:

module.exports = {
  out: '/dist'
}

Assets

Slater uses Webpack internally to compile a single JavaScript entry point. By default, it looks for /src/scripts/index.js.

You can specify a different entry point using the assets object on your config:

module.exports = {
  assets: {
    in: '/src/scripts/index.js'
  }
}

Slater uses PostCSS by default. It's configured to allow SASS-like nesting, in addition to all modern CSS goodies.

To compile your styles, simply import your root stylesheet into your JavaScript entrypoint:

import '../styles.css'

// rest of your project scripts

You can also use SASS. Simple specify the sass preset in your assets config:

module.exports = {
    in: '/src/scripts/index.js'
  assets: {
    presets: [
      'sass'
    ]
  }
}

Typescript

Specify typescript preset in your assets config to enable Typescript support:

module.exports = {
    in: '/src/scripts/index.js'
  assets: {
    presets: [
      'typescript'
    ]
  }
}

Then add index.ts file to /src/scripts/ folder and modify your entry js file (/src/scripts/index.js by default) to import new typescript entry file:

import './index.ts' // path to your entry .ts file

// rest of your project scripts

You can copy rest of the projects scripts and styles import to typescript file, leaving only one import line in js file. Last step is to add tsconfig.json file to the root of your project:

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "jsx": "react",
    "module": "commonjs",
    "moduleResolution": "node",
    "strict": false,
    "target": "es2015"
  },
  "exclude": ["node_modules", "slater.config.js", "test.config.js"]
}

Alias & Env

To make your JavaScript a little easier to work with, Slater supports alias definitions and environment variables.

module.exports = {
  assets: {
    in: '/src/scripts/index.js'
    alias: {
      components: './src/scripts/components'
    },
    env: {
      API_KEY: JSON.stringify('abcde'),
    }
  },
  themes: {
    // ...
  }
}

Which you can then use in your JavaScript like this:

import api from 'components/api.js'

const fetcher = api({
  key: API_KEY
})

For convenience, there's also a built-in alias @ that points to the directory containing your JavaScript entry point.

N.B. Keep in mind, these environment variables are public, so don't use them for any secret keys, passwords, or any value that you need to keep private! Also, these values are passed directly to Webpack's Define Plugin, so please refer to those docs for clarity.

Command Line

watch

Watches for file changes and syncs updates to your specified theme.

slater watch

build

Compiles assets and copies all files from the config.in directory to the config.out directory.

slater build

sync

Sync local files or directories to your remote theme. A direct interface to [@slater/sync], which @slater/cli uses internally.

slater sync build/snippets/hero.liquid # file
slater sync build/snippets # directory
slater sync # defaults to config.out

Options

Any of the core commands can be combined with the following options:

  • --config <path> - specify the path to your config file
  • --theme <name> - specify a named theme from your config file

Deployment

To deploy a theme, combine the above commands as needed:

slater build && slater sync --theme production

Live-reloading & HTTPS

slater uses an local SSL certification to correspond with Shopify's HTTPS hosted themes. To take advantage of live-reloading, you need to create a security exception for the slater cert (this is safe). To do this, load https://localhost:4000 in your browser, and follow the instructions for adding an exception. If it works, you should see this in your browser window:

slater running

Guides

Adding Slater to any existing Theme

In the Wild

The following sites were built using some version of Slater. Send us a PR to add to this list!

Contributing

Slater uses lerna to manage the monorepo. That makes developing locally pretty simple, but a little different from what you might be used to. Use the steps below to get up and running locally:

  1. Clone this repository
  2. From the project root, install core dependencies with npm i
  3. From the project root, run npm run bootstrap
  4. Define a packages/theme/test.config.js file with your Slater config data
  5. Use the test specific commands in /theme/package.json to run your local theme
  6. Make neat, granular commits
    1. Be descriptive
    2. Reference open/closed issues where applicable
  7. Open a pull request!

Important: don't increment any of the core package versions. The core Slater team will handle versioning when publishing to npm.

Contributors

Eric Bailey
Eric Bailey

๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘€ ๐Ÿšง
Kevin Green
Kevin Green

๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘€ ๐Ÿšง
Joe Refoy
Joe Refoy

๐Ÿ› ๐Ÿ’ป ๐Ÿšง
Ward Penney
Ward Penney

๐Ÿ› ๐Ÿ“–
Tomasz Bujnowicz
Tomasz Bujnowicz

๐Ÿ› ๐Ÿ’ป
Sean Orfila
Sean Orfila

๐Ÿ’ฌ
antonio
antonio

๐Ÿ› ๐Ÿ“–
dana kim
dana kim

๐Ÿค”
kotte
kotte

๐Ÿ’ป ๐ŸŽจ ๐Ÿค”

License

MIT License ยฉ The Couch

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].