Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit 36cb2be

Browse files
author
t-kelly
committed
Update documentation and packages
1 parent a97e374 commit 36cb2be

File tree

18 files changed

+632
-41
lines changed

18 files changed

+632
-41
lines changed

CONTRIBUTING.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# How to contribute
2+
3+
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).
4+
5+
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!).
6+
7+
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).
8+
9+
## Getting Started
10+
11+
To start working on the codebase, first fork the repo, then clone it:
12+
13+
```
14+
git clone [email protected]:your-username/slate.git
15+
```
16+
17+
_Note: replace "your-username" with your GitHub handle_
18+
19+
Install all package dependencies and link local packages:
20+
21+
```
22+
yarn bootstrap
23+
```
24+
25+
Write some features. Run the tests with:
26+
27+
```
28+
yarn test
29+
```
30+
31+
## Documentation
32+
33+
If your change affects how people use the project (i.e. adding or removing
34+
functionality, changing the return value of a function, etc),
35+
please ensure the documentation is also updated to
36+
reflect this.
37+
38+
## Changelog
39+
40+
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.
41+
42+
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:
43+
44+
```
45+
# Lerna Changelog Personal Access Token for shopify/slate repo
46+
export GITHUB_AUTH=your_personal_access_token
47+
```
48+
49+
_Note: replace "your_personal_access_token" with your GitHub personal access token_
50+
51+
Run the changelog generator:
52+
53+
```
54+
npm run changelog
55+
```
56+
57+
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`:
58+
59+
```
60+
npm run changelog -- --tag-from=v0.12.0
61+
```
62+
63+
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.
64+
65+
Commit the changes directly to `master` branch, with a commit title of:
66+
67+
```
68+
Changelog vX.X.X
69+
```
70+
71+
_Note: replace "X.X.X" with new repo version number_
72+
73+
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).
74+
75+
## Publishing
76+
77+
1. Merge any changes you want to include in your next release into `master`.
78+
79+
_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_
80+
81+
2. Update the [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) as described above
82+
83+
3. To select a new version number, and publish packages to NPM, run:
84+
85+
```
86+
npm run publish
87+
```
88+
89+
_Note: Make sure you are logged into your Shopify NPM account before publishing_

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Shopify Inc.
3+
Copyright (c) 2018 Shopify Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
1-
# theme-scripts
1+
# Shopify Theme Scripts
2+
3+
> ⚠️ Shopify Theme Scripts is currently an Alpha release, meaning you should expect breaking changes between updates and more bugs than a finalized release. We believe that by getting Theme Scripts in the hands of developer communtiy as soon as possible, we can gather critical feedback to make it an even bigger success.
4+
5+
Theme Scripts is a collection of handy utility libraries which help theme developers with problems unique to Shopify Themes.
6+
7+
The goal of each theme script is to be remain uncoupled from a particular UI. Typically, theme scripts should be used alongside a customized solution for a particular theme. For example, `@shopify/theme-cart` is a great way to interact with the Shopify Cart API and add and remove items, but it does not enforce a particular pattern to display or update the visual state of the cart.
8+
9+
## Getting Started
10+
11+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project. For example, to use [`@shopify/theme-cart`](https://github.com/Shopify/theme-scripts/tree/master/packages/theme-cart) in your project:
12+
13+
```
14+
yarn add @shopify/theme-cart
15+
```
16+
17+
and then import the functions you wish to use through ES6 imports:
18+
19+
```
20+
import {updateNote} from '@shopify/theme-cart`;
21+
```
22+
23+
Explore [each of packages](https://github.com/Shopify/theme-scripts/tree/master/packages) for documentation on how to use each Theme Script.
24+
25+
## CommonJS and ES Module Builds
26+
27+
Each Theme Script is transpiled to two versions:
28+
29+
1. A CommonJS version which can be imported using `require()` syntax.
30+
2. A ES Module version which can be imported using `import` syntax.
31+
32+
Webpack detects the `"modules"` key when using importing via `import` so the correct version should automatically be imported for you.
33+
34+
## Contributing
35+
36+
For help on setting up the repo locally, building, testing, and contributing
37+
please see [CONTRIBUTING.md](https://github.com/Shopify/starter-theme/blob/master/CONTRIBUTING.md).
38+
39+
## Code of Conduct
40+
41+
All developers who wish to contribute through code or issues, take a look at the
42+
[Code of Conduct](https://github.com/Shopify/starter-theme/blob/master/CODE_OF_CONDUCT.md).
43+
44+
## License
45+
46+
MIT, see [LICENSE](https://github.com/Shopify/starter-theme/blob/master/LICENSE) for details.
47+
48+
<img src="https://cdn.shopify.com/shopify-marketing_assets/builds/19.0.0/shopify-full-color-black.svg" width="200" />
49+

package.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
{
2-
"devDependencies": {
3-
"babel-cli": "^6.26.0",
4-
"babel-preset-shopify": "^16.2.0",
5-
"lerna": "^2.5.1"
6-
},
2+
73
"name": "theme-scripts",
84
"version": "1.0.0-alpha.0",
95
"description": "A collection of helpful script libraries that help you make better Shopify themes.",
106
"main": "index.js",
117
"scripts": {
12-
"test": "jest"
13-
},
14-
"repository": {
15-
"type": "git",
16-
"url": "[email protected]:Shopify/theme-scripts.git"
8+
"test": "jest",
9+
"bootstrap": "yarn && node_modules/.bin/lerna bootstrap",
1710
},
11+
"repository": "https://github.com/Shopify/theme-scripts",
1812
"keywords": [
1913
"Shopify"
2014
],
2115
"author": "Shopify Inc.",
22-
"license": "MIT"
16+
"license": "MIT",
17+
"devDependencies": {
18+
"babel-cli": "^6.26.0",
19+
"babel-preset-shopify": "^16.2.0",
20+
"lerna": "^2.5.1"
21+
},
2322
}

packages/theme-a11y/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-a11y
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-a11y
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as a11y from '@shopify/theme-a11y`;
15+
```

packages/theme-a11y/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library of useful functions that help make your theme more accessible.",
55
"main": "a11y.cjs.js",
66
"modules": "a11y.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-a11y",
118
"keywords": [
129
"slate",
1310
"a11y"

packages/theme-cart/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-cart
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-cart
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as cart from '@shopify/theme-cart`;
15+
```

packages/theme-cart/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library that helps theme developers integrate their projects with the Shopify Cart API",
55
"main": "cart.cjs.js",
66
"modules": "cart.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-cart",
118
"keywords": [
129
"slate"
1310
],

packages/theme-currency/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-currency
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-currency
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as currency from '@shopify/theme-currency`;
15+
```

packages/theme-currency/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library that helps with managing currencies in Shopify Themes",
55
"main": "currency.cjs.js",
66
"modules": "currency.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-currency",
118
"keywords": [
129
"slate"
1310
],

packages/theme-images/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-images
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-images
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as images from '@shopify/theme-images`;
15+
```

packages/theme-images/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library that helps with basic image operations within Shopify Themes",
55
"main": "images.cjs.js",
66
"modules": "iamges.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-images",
118
"keywords": [
129
"slate"
1310
],

packages/theme-product/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-product
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-product
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as product from '@shopify/theme-product`;
15+
```

packages/theme-product/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library that helps developers work with the Product object within Shopify Themes",
55
"main": "product.cjs.js",
66
"modules": "product.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-product",
118
"keywords": [
129
"slate"
1310
],

packages/theme-rte/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @shopify/theme-rte
2+
3+
## Getting Started
4+
5+
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
6+
7+
```
8+
yarn add @shopify/theme-rte
9+
```
10+
11+
and then import the functions you wish to use through ES6 imports:
12+
13+
```
14+
import * as rte from '@shopify/theme-rte`;
15+
```

packages/theme-rte/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "A library that helps developers work with the RTE sections in Shopify Themes",
55
"main": "rte.cjs.js",
66
"modules": "rte.es5.js",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/Shopify/theme-scripts.git"
10-
},
7+
"repository": "https://github.com/Shopify/theme-scripts/tree/master/packages/theme-rte",
118
"keywords": [
129
"slate"
1310
],

0 commit comments

Comments
 (0)