Giter Club home page Giter Club logo

cep-svelte-starter's Introduction

Svelte Starter

This is a simple starter for Svelte in Adobe CEP using Webpack. Huge thanks to Koen Schmeets for helping out with Webpack.

Features

  • Bundles Extendscript, Javascript and Svelte code
  • Automatically generates manifest.xml and .debug
  • Supports multiple extensions in the extension bundle
  • Allows separate Extendscript files for each Adobe CC app
  • Includes Adobe's Spectrum CSS
  • Symlinks the panel to the extensions folder
  • Sets the CSXS debug flags
  • Watches files for changes
  • Does HMR (Hot Module Replacement)
  • Extracts CSS from Svelte components to a single CSS file

Getting Started

Clone the starter with Degit.

This clones the repo without the whole Git history.

npx degit Klustre/cep-svelte-starter my-svelte-panel

Install dependencies

cd my-svelte-panel
npm install

Start the dev environment

npm start

Open your favorite Adobe CC app

Find the extension under Window > Extensions and start developing ๐Ÿ‘

Troubleshooting

  1. When running npm start, Webpack's dev server loads the files in memory instead of building to /dist. When you run npm run build it builds all files to /dist

  2. On Windows you'll have to change:

    • export IS_DEV=1 to set IS_DEV=1
    • sleep 5 to timeout 5
  3. Using any Svelte modules throws an error where the component is undefined. This is likely due to a double inclusion of svelte/internal.

    Possible workarounds:

    • Import the module from svelte/internal
      import { createEventDispatcher } from 'svelte/internal'
    • Remove the modules from Svelte after npm install
      "postinstall": "rimraf node_modules/svelte/*.mjs"

    See sveltejs/svelte#2896 and DeMoorJasper/parcel-plugin-svelte#46 (comment)

Webpack and CEP-Bundler

The bundler automatically:

  • Starts a local server
  • Generates the manifest.xml and .debug files
  • Symlinks the /dist folder to the current user's extensions folder
  • Copies Node dependencies to /dist/node_modules
  • Copies everything in /public to /dist

Learn more at: Webpack and cep-bundler-webpack

Configuring CEP-Bundler

panel.config.js & extendscript.config.js

See cep-bundler-core

Svelte VSCode Extension

When you open the project in VSCode it will prompt you to install the Svelte extension. This is the official Svelte language server which provides syntax highlighting and rich intellisense for Svelte components. To see the recommended extensions go to Extensions > Views and More Actions (โ€ฆ) > Show Recommended Extensions.

cep-svelte-starter's People

Contributors

klustre avatar vespakoen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cep-svelte-starter's Issues

The symbolic link doesn't get created

I don't know if this is still working for you but I can't seem to get it to work.

I'm on Windows 10 and I've followed the instructions on the readme page, using degit, updating the package.json to set and timeout.

When I run npm start, everything seems to compile successfully, but then I open Photoshop or illustrator and I can't see Svelte Starter in the extension menu under windows. Am I missing a step or is it the project that's out dated or made to work only on Mac?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.