Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Combine all Slate repos into a single repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Kelly committed Aug 11, 2017
1 parent d10452e commit 706dce4
Show file tree
Hide file tree
Showing 147 changed files with 12,330 additions and 8,121 deletions.
7 changes: 5 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
src/scripts/vendor/
src/scripts/**/*.js.liquid
packages/slate-theme/src/scripts/vendor/

packages/slate-theme/src/scripts/**/*.js.liquid
package/slate-cli/lib
package/slate-tools/
node_modules/
docs/
ci/
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"plugin:shopify/esnext",
"plugin:shopify/node"
],
"rules": {
"no-console": 0,
"node/shebang": 0
}
}
3 changes: 0 additions & 3 deletions .github_changelog_generator

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ config.yml
secrets.json
.jekyll-metadata
.ruby-version
lerna-debug.log
/packages/slate-cli/lib/
/packages/slate-tools/lib/
.changelog/
98 changes: 73 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
# How to contribute
We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or
just correct a typo, please feel free to do so, as long as you follow
our [Code of Conduct](https://github.com/Shopify/slate/blob/master/CODE_OF_CONDUCT.md).
We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or just correct a typo, please feel free to do so, as long as you follow our [Code of Conduct](https://github.com/Shopify/slate/blob/master/CODE_OF_CONDUCT.md).

The Slate theme scaffolding is [intentionally barebones](https://shopify.github.io/slate/theme/#intentionally-blank)
to provide an unopinionated starting point. If you're thinking of adding a new
feature, consider opening an issue first to discuss it to ensure it aligns to
the direction of the project (and potentially save yourself some time!).
If you're thinking of adding a big new feature, consider opening an issue first to discuss it to ensure it aligns to the direction of the project (and potentially save yourself some time!).

This repo is a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) consisting of multiple packages and is managed using [Lerna](https://github.com/lerna/lerna).

The `slate-theme` scaffolding is [intentionally barebones](https://shopify.github.io/slate/theme/#intentionally-blank) to provide an unopinionated starting point.

## Getting Started

To start working on the codebase, first fork the repo, then clone it:
```
git clone git@github.com:your-username/slate.git
```
*Note: replace "your-username" with your Github handle*
*Note: replace "your-username" with your GitHub handle*

Install the project's dependencies:
Install all package dependencies and link local packages:
```
npm install
npm run bootstrap
```

Create a config.yml file with private app settings from your shop. See [config-sample.yml](https://github.com/Shopify/slate/blob/master/config-sample.yml) as an example.
Write some features. Run the tests with:
```
npm test
```

## View changes to `slate-theme` package in a live store

Create a config.yml file with private app settings from your shop. See [config-sample.yml](https://github.com/Shopify/slate/blob/master/packages/slate-theme/config-sample.yml) as an example.

Go to the `slate-theme` package:
```
cd packages/slate-theme
```

Deploy Slate to your shop and start testing your feature.
```
Expand All @@ -33,20 +45,14 @@ The following documents the folder structure for this project and what the purpo
```
+-- docs/ ** API docs that live at https://shopify.github.io/slate
+-- scripts/ ** Scripts used for development such as deployment and CI scripts
+-- src/ ** Contains all theme templates and assets
| +-- assets/
| +-- config/
| +-- icons/
| +-- layout/
| +-- locales/
| +-- scripts/
| +-- sections/
| +-- snippets/
| +-- styles/
| +-- templates/
+-- packages/ ** Contains the different components of the Slate project
| +-- slate-cli/ ** A command line interface used to execute Slate commands
| +-- slate-theme/ ** A boilerplate theme to get started with theme development
| +-- slate-tools/ ** A collection of build tools to help with theme development
```

## Documentation

If your change affects how people use the project (i.e. adding or removing
functionality, changing the return value of a function, etc),
please ensure the documentation is also updated to
Expand All @@ -70,8 +76,50 @@ The documentation will then be visible at:

## Changelog

The [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) file is generated by the gem [github_changelog_generator](https://github.com/skywinder/github-changelog-generator). Changelog will itemize changes between tags on GitHub.
The changelog is updated by the repo's maintainers since a [personal access token](https://github.com/settings/tokens) with repository access is needed to handle GitHub's API call limits.

If this is your first time generating changelog entries, add your personal access token with `public_repo` privileges to the `GITHUB_AUTH` environment variable by adding the following to your `.bashrc` file:
```
# Lerna Changelog Personal Access Token for shopify/slate repo
export GITHUB_AUTH=your_personal_access_token
```
*Note: replace "your_personal_access_token" with your GitHub personal access token*

Run the changelog generator:
```
npm run changelog
```

If nothing appears, you may not have any PRs tagged with appropriate labels in this release or you may have already published those changes. If you just released `v0.12.1` and the previous version was `v0.12.0`, run the following command to get the changes since `v0.12.0`:
```
npm run changelog -- --tag-from=v0.12.0
```

Copy the generated markdown from your terminal into [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) and add any additional comments you wish to include. If the title of the autogenerated changelog is `Unreleased`, make sure you change it the new version name.

Commit the changes directly to `master` branch, with a commit title of:
```
Changelog vX.X.X
```
*Note: replace "X.X.X" with new repo version number*

Finally, paste the updates you made to the changelog in the release tag notes, see example: [v0.10.0 tag notes](https://github.com/Shopify/slate/releases/tag/v0.10.0).



## Publishing

1. Merge any changes you want to include in your next release into `master`.

*Note: If you are merging multiple PRs into `master` with a single PR (e.g. you are merging a working branch called v0.11.0 with multiple fixes made from multiple PRs into `master`), then **do not squash and merge this PR** because you will loose valuable details in the auto generated changelog*

2. Update the [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) as described above

3. To select a new version number, publish packages to NPM, generate and deploy new `slate-theme` zips, run:
```
npm run publish
```

*Note: Make sure you are logged into your Shopify NPM account before publishing*

The changelog is updated by the repo's maintainers since a [personal access token](https://github.com/settings/tokens) with repository access is needed to handle GitHub's API call limits.

Note to maintainers: To update the changelog, install the gem and run `github_changelog_generator` in the root directory. Paste updates to the changelog in the tag notes, see example: [v0.10.0 tag notes](https://github.com/Shopify/slate/releases/tag/v0.10.0).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
35 changes: 17 additions & 18 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
machine:
ruby:
version: 2.3.1
node:
version: 6.2.2

dependencies:
pre:
- 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
- npm set progress=false
- npm install -g @shopify/slate
bundler:
without:
- benchmark
- deploy
- production
- debug
cache_directories:
- .bundle/
- packages/slate-tools/node_modules
- packages/slate-theme/node_modules
- packages/slate-cli/node_modules
override:
- npm run bootstrap

deployment:
release:
tag: /v[0-9]+(\.[0-9]+)*/
owner: Shopify
commands:
- npm run bootstrap
- cd packages/slate-theme && ./node_modules/.bin/slate zip
- node scripts/build
- node scripts/deploy
- curl -X PURGE https://sdks.shopifycdn.com/slate/latest/slate-theme.zip
- curl -X PURGE https://sdks.shopifycdn.com/slate/latest/slate-src.zip

test:
pre:
- slate build
post:
- slate test
2 changes: 1 addition & 1 deletion docs/js-examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $iframeVideo.each(function() {

## Format currency

Slate ships JavaScript to mimic [Shopify money formats](https://help.shopify.com/manual/payment-settings/currency-formatting#currency-formatting-options). This makes handling product prices and cart items in JS simple. ([View currency.js source](https://github.com/Shopify/slate/blob/master/src/scripts/slate/currency.js)).
Slate ships JavaScript to mimic [Shopify money formats](https://help.shopify.com/manual/payment-settings/currency-formatting#currency-formatting-options). This makes handling product prices and cart items in JS simple. ([View currency.js source](https://github.com/Shopify/slate/blob/master/packages/slate-theme/src/scripts/slate/currency.js)).

Slate maps the shop's money format — defined in Liquid — to a JavaScript variable in `layouts/theme.liquid` so it can be used regardless of file type.

Expand Down
8 changes: 4 additions & 4 deletions docs/theme-scaffold/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ Starting a fresh project should not include reinventing the wheel. Slate offers
- There are no grid classes in the templates so you can easily switch to your preferred grid
- SVG icon style helpers. [Example]({{ '/css-examples/#svg-icons' | prepend: site.baseurl }})
- Responsive tables. [Example]({{ '/css-examples/#responsive-tables' | prepend: site.baseurl }})
- `.btn` class with smart defaults. [Source](https://github.com/Shopify/slate/blob/master/src/styles/global/links-buttons.scss)
- Form elements with default, disabled, error, and focus states ready to be styled. [Source](https://github.com/Shopify/slate/blob/master/src/styles/global/forms.scss)
- `.btn` class with smart defaults. [Source](https://github.com/Shopify/slate/blob/master/packages/slate-theme/src/styles/global/links-buttons.scss)
- Form elements with default, disabled, error, and focus states ready to be styled. [Source](https://github.com/Shopify/slate/blob/master/packages/slate-theme/src/styles/global/forms.scss)
- Blank state SVG styles [Example]({{ '/css-examples/#blank-states' | prepend: site.baseurl }})

### Sass mixins
Expand All @@ -122,7 +122,7 @@ A few helpful Sass mixins are included in Slate to make responsive, cross-browse

## JavaScript helpers

Slate provides a number of helper scripts and vendor scripts. The base folder names can be changed to suit your workflow. If changing or adding folders, make sure to update the `require` statement in `theme.js` to `// =require new-folder/script.js`.
Slate provides a number of helper scripts and vendor scripts. The base folder names can be changed to suit your workflow. If changing or adding folders, make sure to update the `require` statement in `theme.js` to `// =require new-folder/script.js`.

```
scripts/
Expand All @@ -140,7 +140,7 @@ More information about the <code>require</code> directive can be found in the <a

Slate provides helper scripts to promote accessibility and make working with theme images, currencies, and product variants easier. See [JS examples]({{ '/js-examples/' | prepend: site.baseurl }}) for more details on how to use these scripts.

- Accessibility helpers. [Example]({{ '/js-examples/#trap-focus' | prepend: site.baseurl }}). [Source](https://github.com/Shopify/slate/blob/master/src/scripts/slate/a11y.js).
- Accessibility helpers. [Example]({{ '/js-examples/#trap-focus' | prepend: site.baseurl }}). [Source](https://github.com/Shopify/slate/blob/master/packages/slate-theme/src/scripts/slate/a11y.js).
- Force tables and videos to be responsive. [Example]({{ '/js-examples/#responsive-tables-and-videos' | prepend: site.baseurl }})
- Easy handling of theme editor events. [Example]({{ '/js-examples/#section-events' | prepend: site.baseurl }})
- Format currency in JS the same as Liquid allows. [Example]({{ '/js-examples/#format-currency' | prepend: site.baseurl }})
Expand Down
17 changes: 17 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"lerna": "2.0.0",
"version": "0.11.0",
"packages": [
"packages/*"
],
"changelog": {
"repo": "shopify/slate",
"labels": {
"enhancement": ":rocket: Enhancement",
"bug": ":bug: Bug Fix",
"documentation": ":memo: Documentation",
"internal": ":house: Internal"
},
"cacheDir": ".changelog"
}
}
Loading

0 comments on commit 706dce4

Please sign in to comment.