You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 20, 2023. It is now read-only.
_Note: See the [lerna documentation](https://github.com/lerna/lerna/tree/2.x#add) for more information_
46
+
31
47
## How to test locally
32
48
33
49
The following details how to setup your local environment when you wish to create a new branch of a theme script package. It uses work on a new release of `@shopify/themes-a11y` as an example.
34
50
35
51
### Create a link to your local package to another project
52
+
36
53
Navigate to the package and type [`yarn link`](https://yarnpkg.com/en/docs/cli/link).
37
54
38
-
```bash
55
+
```bash
39
56
theme-scripts $ cd packages/themes-a11y
40
57
theme-a11y $ yarn link
41
58
@@ -45,27 +62,26 @@ theme-a11y $ yarn link
45
62
46
63
Go to a local project you want to test out the script in.
47
64
48
-
```bash
65
+
```bash
49
66
cd ../some-path/my-theme
50
67
my-theme $ yarn link "@shopify/theme-a11y"
51
68
52
69
# success Using linked package for "@shopify/theme-a11y".
53
70
```
54
71
55
-
56
72
### Removing a link to a package
57
73
58
-
To unlink your package so other local projects stop using it, use [`yarn unlink`](https://yarnpkg.com/en/docs/cli/unlink). This is also called “unregistering” the package.
74
+
To unlink your package so other local projects stop using it, use [`yarn unlink`](https://yarnpkg.com/en/docs/cli/unlink). This is also called “unregistering” the package.
59
75
60
-
```bash
76
+
```bash
61
77
theme-a11y $ yarn unlink
62
78
63
79
# success Unregistered "@shopify/theme-a11y".
64
80
```
65
81
66
82
When you don’t want your project to be using your local package, go to your local project and type `yarn unlink <package>`
67
83
68
-
```bash
84
+
```bash
69
85
cd ../projects/my-theme
70
86
my-theme $ yarn unlink "@shopify/theme-a11y"
71
87
@@ -80,55 +96,65 @@ functionality, changing the return value of a function, etc),
80
96
please ensure the documentation is also updated to
81
97
reflect this.
82
98
83
-
## Changelog
84
-
85
-
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.
86
-
87
-
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:
88
-
89
-
```
90
-
# Lerna Changelog Personal Access Token for shopify/theme-scripts repo
91
-
export GITHUB_AUTH=your_personal_access_token
92
-
```
93
-
94
-
_Note: replace "your_personal_access_token" with your GitHub personal access token_
95
-
96
-
Run the changelog generator:
97
-
98
-
```
99
-
npm run changelog
100
-
```
101
-
102
-
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`:
103
-
104
-
```
105
-
npm run changelog -- --tag-from=v0.12.0
106
-
```
107
-
108
-
Copy the generated markdown from your terminal into [CHANGELOG.md](https://github.com/Shopify/theme-scripts/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.
109
-
110
-
Commit the changes directly to `master` branch, with a commit title of:
111
-
112
-
```
113
-
Changelog vX.X.X
114
-
```
115
-
116
-
_Note: replace "X.X.X" with new repo version number_
117
-
118
-
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/theme-scripts/releases/tag/v0.10.0).
119
-
120
99
## Publishing
121
100
122
-
1. Merge any changes you want to include in your next release into `master`.
123
-
124
-
_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_
101
+
⚠️ Note: You must have a Shopify Okta account ir order to login to Shipit and publish.
125
102
126
-
2. Update the [CHANGELOG.md](https://github.com/Shopify/theme-scripts/blob/master/CHANGELOG.md) as described above
127
-
128
-
3. To select a new version number, and publish packages to NPM, run:
129
-
130
-
```
131
-
npm run publish
132
-
```
103
+
1. Merge any changes you want to include in your next release into `master`.
133
104
134
-
_Note: Make sure you are logged into your Shopify NPM account before publishing_
105
+
_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 commit history_
106
+
107
+
2. Checkout `master` and pull the latest from the origin
3. You can verify that there are indeed packages to be published (optional)
114
+
115
+
```
116
+
theme-scripts $ yarn lerna updated
117
+
...
118
+
lerna info version 2.11.0
119
+
lerna info Checking for updated packages...
120
+
lerna info Comparing with v2.0.4.
121
+
lerna info Checking for prereleased packages...
122
+
lerna info result
123
+
- @shopify/theme-a11y // This package was updated and can be published
124
+
✨Done in 0.63s.
125
+
```
126
+
127
+
4. Run the release step to choose the version bump desired
128
+
129
+
```
130
+
theme-scripts $ yarn release
131
+
...
132
+
lerna info version 2.11.0
133
+
lerna info current version 2.0.4
134
+
lerna info Checking for updated packages...
135
+
lerna info Comparing with v2.0.4.
136
+
lerna info Checking for prereleased packages...
137
+
? Select a new version (currently 2.0.4) (Use arrow keys)
138
+
❯ Patch (2.0.5)
139
+
Minor (2.1.0)
140
+
Major (3.0.0)
141
+
Prepatch (2.0.5-0)
142
+
Preminor (2.1.0-0)
143
+
Premajor (3.0.0-0)
144
+
Prerelease
145
+
Custom
146
+
```
147
+
148
+
This command will:
149
+
150
+
1. Run the equivalent of lerna updated to determine which packages need to be published.
151
+
2. If necessary, increment the version key in lerna.json.
152
+
3. Update the package.json of all updated packages to their new versions.
153
+
4. Update all dependencies of the updated packages with the new versions, specified with a caret (^).
154
+
5. Create a new git commit and tag for the new version.
155
+
6. Git push to origin master with the newly created tag.
156
+
157
+
_Note: See the [lerna documentation](https://github.com/lerna/lerna/tree/2.x#publish) for more information_
158
+
159
+
5. Login to [Shipit](https://shipit.shopify.io/shopify/theme-scripts/production)
160
+
6. In the Undeployed Commits list, identify the commit with the name of the version that was created in step #4, wait for CI to be 🍏, click the 'Deploy' button to publish to npm's public registry.
0 commit comments