https://github.com/jgodson/shopify-script-creator
React app to create Shopify Scripts
https://github.com/jgodson/shopify-script-creator
hacktoberfest shopify-scripts
Last synced: about 1 year ago
JSON representation
React app to create Shopify Scripts
- Host: GitHub
- URL: https://github.com/jgodson/shopify-script-creator
- Owner: jgodson
- License: gpl-3.0
- Created: 2017-11-11T05:15:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-20T09:00:31.000Z (over 1 year ago)
- Last Synced: 2025-04-12T16:59:33.083Z (over 1 year ago)
- Topics: hacktoberfest, shopify-scripts
- Language: JavaScript
- Homepage: https://jgodson.github.io/shopify-script-creator/
- Size: 4.51 MB
- Stars: 162
- Watchers: 16
- Forks: 40
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Shopify Script Creator
This project was intended to be a UI to generate Ruby code to paste into the Shopify Script Editor application, no extra coding needed.
## Dependencies
- [node](https://nodejs.org/en/)
- [yarn](https://github.com/yarnpkg/yarn/)
## CI
- CI is set up on [CircleCI](https://circleci.com)
- CI will run Rspec tests to test ruby code within the ruby_scripts directory
- CI will check to ensure that no changes were made to the `ruby_scripts` that have not been transferred to the respective `.js` files.
# Getting started
## Installation
Clone this project and install all the project dependencies.
```
yarn install
```
## Development
### JavaScript/React
Run the local `webpack` development server.
```
yarn start
```
Open http://localhost:8080 in your browser and you should see the application running.
### Ruby Scripts
- All scripts are cotained in the `ruby_scripts` directory and orgained by type of script (or common if they are applicable to all types of scripts)
- Tests for scripts are contained within the `spec` directory, then (similar to the script itself) another directory based on the type of script
- If you make changes to any scripts within the `ruby_scripts` directory, you will need to ensure these changes are added to the `src/scripts` `.js` file as well. The command for this is:
```
yarn build:scripts
```
## Tests
#### Ruby
- Ruby is tested using [Rspec](https://rspec.info)
- [Factorybot](https://github.com/thoughtbot/factory_bot) is used for building the required objects for tests
- The `models` directory contains classes to simulate the environment that scripts are executed in.
- Tests can be run with
```
yarn test:ruby
```
#### JavaScript
- There are currently no tests written for this 🙁
## Deploying
- Update the version in `src/versions.js` and `package.json` prior to deploying
- Ensure any significant changes to the `components/ChangeLogContent.js` file (you can [convert markdown to html](https://www.browserling.com/tools/markdown-to-html)).
- Deployment scripts are preconfigured in `package.json` to run with one easy command:
```
yarn deploy
```
This generates a `docs` directory containing `index.html` and `bundle.js`. The index loads all Polaris styles via the Polaris CDN and the application scripts via `bundle.js`
- Finally, add a release on GitHub for the new version with the same changes that were listed in the `ChangeLogContent.js` file.