Skip to content

Commit 4cfcbe7

Browse files
authored
Merge pull request #32 from MLH-Fellowship/ui-svelte-starter
Create Svelte Starter Plugin
2 parents 3543290 + fd80f5c commit 4cfcbe7

22 files changed

+3772
-0
lines changed

ui-svelte-starter/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist/

ui-svelte-starter/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Svelte Starter Plugin
2+
3+
This plugin is a good place to get started when building a Photoshop plugin using Svelte. It comes defined with all the dependencies that you'll need to get started. As this is a Svelte project, you'll need to do some initial configuration before this will be usable in Photoshop.
4+
5+
## Install dependencies
6+
7+
First ensure that your terminal is in the root of this project. Then:
8+
9+
For `yarn` users, install all dependencies using:
10+
11+
```
12+
yarn install
13+
```
14+
15+
For `npm` users, install all dependencies using:
16+
17+
```
18+
npm install
19+
```
20+
21+
## Build Process
22+
23+
There are two ways to build the plugin for use in Photoshop:
24+
25+
- `yarn watch` or `npm run watch` will build a development version of the plugin, and recompile everytime you make a change to the source files. The result is placed in `dist`.
26+
- `yarn build` or `npm run build` will build a production version of the plugin and place it in `dist`. It will not update every time you make a change to the source files.
27+
28+
> You **must** run either `watch` or `build` prior to trying to use within Photoshop!
29+
30+
## Launching in Photoshop
31+
32+
You can use the UXP Developer Tools to load the plugin into Photoshop.
33+
34+
If the plugin hasn't already been added to your workspace in the UXP Developer Tools, you can add it by clicking "Add Plugin..." and selecting `dist/manifest.json`. **DO NOT** select the `manifest.json` file inside the `plugin` folder.
35+
36+
Once added, you can load it into Photoshop by clicking the ••• button on the corresponding row, and clicking "Load". Switch to Photoshop and you should see the starter panels.
37+
38+
## What this plugin does
39+
40+
This plugin doesn't do much, but does illustrate how to create a panel in Photoshop with `entrypoints.setup` that shows the number of seconds passed since the plugin launched using a basic Svelte component.

ui-svelte-starter/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "com.adobe.uxp.starter.svelte",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"watch": "webpack -w --mode development",
6+
"build": "webpack --mode development"
7+
},
8+
"license": "none",
9+
"private": true,
10+
"devDependencies": {
11+
"copy-webpack-plugin": "^9.0.0",
12+
"css-loader": "^5.0.1",
13+
"style-loader": "^3.0.0",
14+
"svelte": "^3.31.2",
15+
"svelte-loader": "^3.0.0",
16+
"webpack": "^5.16.0",
17+
"webpack-cli": "^4.4.0",
18+
"webpack-dev-server": "^3.11.2"
19+
}
20+
}
452 Bytes
Loading
501 Bytes
Loading
452 Bytes
Loading
501 Bytes
Loading
450 Bytes
Loading
558 Bytes
Loading
450 Bytes
Loading

0 commit comments

Comments
 (0)