Spaces Design
Setup
Note: If you're inside a corporate firewall that disallows git:// URLs, see the notes below to resolve the issue, otherwise tools like bower will fail.
- Sync
//photoshop/workarea/playground/...to your development machine. - Download and install
bower. - Clone this repo:
git clone https://github.com/adobe-photoshop/spaces-design.git. - In the root of your
spaces-designrepo, runbower install.
Next, do the following if you want to run the linter or tests from the command line. If you're a dev, this is nonoptional:
- Download and install Node.
- Install grunt-cli using NPM:
npm install -g grunt-cli. - In the root of your
spaces-designrepo, runnpm install.
Development
Once setup is complete:
- Build the Photoshop application
- (Currently) Build the platform-appropriate project in
//photoshop/workarea/playground/plugins/spaces - From a command line,
cdto the Perforce//photoshop/workarea/playgrounddirectory - Run
./plugins/spaces/tools/osx_build_and_go.sh. You should only have to call this when CEF changes (or e.g., after a sync from main). - Launch
spaces's Photoshop. - In Photoshop's preferences: Experimental Features. Enable Designshop.
- Relaunch Photoshop.
- After reboot there should be an iconic
->Dsbutton at the bottom of the Photoshop tool bar panel. Click it. - Congratulations, you're in Spaces.
File->Newshould get you a default document, and you're on your way.- Photoshop should launch directly into Designshop hereafter.
- In a browser window, visit http://localhost:9234/ to see inspector tools for the Spaces browser instance's contents.
Directories
Dependencies:
- Modules managed by
bowerwill be inbower_components. - Modules managed by
npmwill be innode_modules.
Sources:
- Put JavaScript files in
src/js/.- UI code is in
src/js/jsx.Main.jsxis the top-level UI file.
- UI code is in
- Put CSS (Less) files in
src/style/. - Put images in
src/img/.
Testing:
- Add tests to modules in
test/specs/.- Update the specs classes in
test/specs.jsaccordingly.
- Update the specs classes in
Compilation
Note: If you're developing, you probably don't want to perform a compilation step. A compiled version disables a lot of logging and profiling and such.
To produce an optimized build, in the root of your spaces-design repo run grunt build. The resulting files are generated in the build/ subdirectory, including concatenated and minified JavaScript files, and a CSS file compiled from the LESS source files.
Documentation
Coding Conventions
All code must follow the coding conventions, and must pass JSHint and JSCS.
JSHint and JSCS can be run on all JavaScript source in the project by running grunt test.
Notes
git/bower behind firewalls
To make bower work in places where git:// URLs don't work (e.g. inside a corporate firewall), run this git command:
git config --global url."https://".insteadOf git://To undo that after you've quit your job at a large corporate institution, run:
git config --global --unset url."https://".insteadOfGithub authentication without SSH
A side effect of using git over HTTPS instead of SSH (as with git:// URLS) is that, by default, you will be asked to enter your Github password before every command that requires authentication. Luckily, git can be configured to cache your credentials in memory, as described here.