Skip to content

Commit b6b5313

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 799fa17 + 9455b88 commit b6b5313

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4968
-2231
lines changed

.babelrc

+35-33
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,45 @@
22
"env": {
33
"production": {
44
"plugins": [
5-
"transform-es2015-template-literals",
6-
"transform-es2015-literals",
7-
"transform-es2015-function-name",
8-
"transform-es2015-arrow-functions",
9-
"transform-es2015-block-scoped-functions",
10-
["transform-es2015-classes", {loose: true}],
11-
"transform-es2015-object-super",
12-
"transform-es2015-shorthand-properties",
13-
"transform-es2015-duplicate-keys",
14-
"transform-es2015-computed-properties",
15-
"check-es2015-constants",
16-
"transform-es2015-spread",
17-
"transform-es2015-parameters",
18-
"transform-es2015-destructuring",
19-
"transform-es2015-block-scoping",
20-
"transform-es2015-typeof-symbol"
5+
"@babel/plugin-transform-template-literals",
6+
"@babel/plugin-transform-literals",
7+
"@babel/plugin-transform-function-name",
8+
"@babel/plugin-transform-arrow-functions",
9+
"@babel/plugin-transform-block-scoped-functions",
10+
["@babel/plugin-transform-classes", {
11+
"loose": true
12+
}],
13+
"@babel/plugin-transform-object-super",
14+
"@babel/plugin-transform-shorthand-properties",
15+
"@babel/plugin-transform-duplicate-keys",
16+
"@babel/plugin-transform-computed-properties",
17+
"@babel/plugin-transform-spread",
18+
"@babel/plugin-transform-parameters",
19+
"@babel/plugin-transform-destructuring",
20+
"@babel/plugin-transform-block-scoping",
21+
"@babel/plugin-transform-typeof-symbol"
2122
]
2223
},
2324
"development": {
2425
"plugins": [
25-
"transform-es2015-modules-commonjs",
26-
"transform-es2015-template-literals",
27-
"transform-es2015-literals",
28-
"transform-es2015-function-name",
29-
"transform-es2015-arrow-functions",
30-
"transform-es2015-block-scoped-functions",
31-
["transform-es2015-classes", {loose: true}],
32-
"transform-es2015-object-super",
33-
"transform-es2015-shorthand-properties",
34-
"transform-es2015-duplicate-keys",
35-
"transform-es2015-computed-properties",
36-
"check-es2015-constants",
37-
"transform-es2015-spread",
38-
"transform-es2015-parameters",
39-
"transform-es2015-destructuring",
40-
"transform-es2015-block-scoping",
41-
"transform-es2015-typeof-symbol"
26+
"@babel/plugin-transform-modules-commonjs",
27+
"@babel/plugin-transform-template-literals",
28+
"@babel/plugin-transform-literals",
29+
"@babel/plugin-transform-function-name",
30+
"@babel/plugin-transform-arrow-functions",
31+
"@babel/plugin-transform-block-scoped-functions",
32+
["@babel/plugin-transform-classes", {
33+
"loose": true
34+
}],
35+
"@babel/plugin-transform-object-super",
36+
"@babel/plugin-transform-shorthand-properties",
37+
"@babel/plugin-transform-duplicate-keys",
38+
"@babel/plugin-transform-computed-properties",
39+
"@babel/plugin-transform-spread",
40+
"@babel/plugin-transform-parameters",
41+
"@babel/plugin-transform-destructuring",
42+
"@babel/plugin-transform-block-scoping",
43+
"@babel/plugin-transform-typeof-symbol"
4244
]
4345
}
4446
}

.github/probots.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enabled:
2+
- cla

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
sudo: required
22
language: node_js
3+
dist: trusty
34
before_script:
45
- "sudo chown root /opt/google/chrome/chrome-sandbox"
56
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"

CHANGELOG.md

+66
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
11
# Changelog
22

3+
### v2.1.3 (May 12, 2020)
4+
- Updated `JS Buy SDK` to `v2.10.0`, which uses Storefront API version [2020-04](https://shopify.dev/concepts/about-apis/versioning/release-notes/2020-04) ([#684](https://github.com/Shopify/buy-button-js/pull/684))
5+
6+
### v2.1.2 (April 6, 2020)
7+
- Updated code of conduct report link ([#678](https://github.com/Shopify/buy-button-js/pull/678))
8+
9+
### v2.1.1 (March 23, 2020)
10+
- Updated `JS Buy SDK` to `v2.9.2` ([#674](https://github.com/Shopify/buy-button-js/pull/674))
11+
- This update ensures that checkouts and content returned from Storefront API/JS Buy SDK will be in the store's primary language.
12+
13+
### v2.1.0 (January 9, 2020)
14+
- Add unit pricing to the product component ([#671](https://github.com/Shopify/buy-button-js/pull/671))
15+
16+
### v2.0.0 (November 19, 2019)
17+
- Defer creation of checkout until a variant is added to cart ([#657](https://github.com/Shopify/buy-button-js/pull/657))
18+
- The cart component's model will now be null until a variant has been added to the cart
19+
20+
### v1.0.4 (October 9, 2019)
21+
- Changed text-rendering to auto for select elements to prevent Safari 13 from crashing ([#653](https://github.com/Shopify/buy-button-js/pull/653))
22+
23+
### v1.0.3 (October 8, 2019)
24+
- Fix product set's `trackingInfo` to return tracking information for each product in set ([#651](https://github.com/Shopify/buy-button-js/pull/651))
25+
26+
### v1.0.2 (September 24, 2019)
27+
- Add `openCheckout` user event ([#647](https://github.com/Shopify/buy-button-js/pull/647))
28+
- Fixed pagination error for product set buy buttons ([#645](https://github.com/Shopify/buy-button-js/pull/645))
29+
- Tracker related updates:
30+
- Add 2 new events (`Open cart checkout` and `Open modal`) ([#648](https://github.com/Shopify/buy-button-js/pull/648))
31+
- Standardized tracking info's `id` value to be the `storefrontId` ([#645](https://github.com/Shopify/buy-button-js/pull/645))
32+
- Updated tracking info values and added addtional properties ([#645](https://github.com/Shopify/buy-button-js/pull/645))
33+
34+
### v1.0.1 (September 10, 2019)
35+
- Fix how ShopifyBuy.UI is set ([#643](https://github.com/Shopify/buy-button-js/pull/643))
36+
37+
### v1.0.0 (September 5, 2019)
38+
- Add support for automatic discounts in the `lineItem` component ([#640](https://github.com/Shopify/buy-button-js/pull/640))
39+
- Add `priceWithDiscounts` contents option and enable by default
40+
- Disable `price` contents option by default
41+
- Add `priceWithDiscounts` to the order array
42+
- Add `priceWithDiscounts`, `fullPrice`, `discount`, and `discountIcon` styles
43+
- Update default `price` styles to account for its position inside the `priceWithDiscounts` container
44+
- Add support for automatic discounts in the `cart` component ([#640](https://github.com/Shopify/buy-button-js/pull/640))
45+
- Add `discounts` contents option and enable by default
46+
- Add `discount`, `discountText`, `discountIcon`, `discountAmount`, and `cartScrollWithDiscounts` styles
47+
- Update layout of `lineItem` component to position variant title below product title ([#640](https://github.com/Shopify/buy-button-js/pull/640))
48+
- Update default position of `variantTitle` in the `lineItem` component's order array
49+
- Update default `variantTitle` styles
50+
- Update browser support ([#641](https://github.com/Shopify/buy-button-js/pull/641))
51+
- Internet Explorer: 11+
52+
- Safari: 8+
53+
- Chrome, Firefox, Opera, Edge: last 2 versions
54+
- iOS: 8+
55+
- Android: 4.4+
56+
57+
### v0.12.0 (August 15, 2019)
58+
- Bump various npm dependencies, notably the following major updates: ([#633](https://github.com/Shopify/buy-button-js/pull/633))
59+
- `babel/core` | `babel/cli` | `babel/runtime` : v7.x
60+
- `core-js`: v3.1.4
61+
- `node-sass`: v4.12.0
62+
- `mustache`: v3.0.1
63+
- `morphdom`: v2.5.5
64+
- `browserify`: v13.3.0
65+
- `postcss`: v7.1.17
66+
- Bump `shopify-buy` dependency to v2.7.0 ([#635](https://github.com/Shopify/buy-button-js/pull/635))
67+
- Fix missing double quotes around classes in options template ([#636](https://github.com/Shopify/buy-button-js/pull/636))
68+
369
### v0.11.0 (March 29, 2019)
470
- Bump `shopify-buy` dependency to v2.2.0.
571
- Asserts `lineItemsSubtotalPrice` is exposed.

CODE_OF_CONDUCT.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ This Code of Conduct applies both within project spaces and in public
3737
spaces when an individual is representing the project or its community.
3838

3939
Instances of abusive, harassing, or otherwise unacceptable behavior may
40-
be reported by contacting a project maintainer at <[email protected]>. All complaints will be reviewed and investigated and will
41-
result in a response that is deemed necessary and appropriate to the
42-
circumstances. Maintainers are obligated to maintain confidentiality
43-
with regard to the reporter of an incident.
40+
be reported [here](https://www.shopify.com/legal/report-aup-violation), or
41+
by contacting a project maintainer at <[email protected]>.
42+
All complaints will be reviewed and investigated and will result in a
43+
response that is deemed necessary and appropriate to the circumstances.
44+
Maintainers are obligated to maintain confidentiality with regard to the
45+
reporter of an incident.
4446

4547
This Code of Conduct is adapted from the Contributor Covenant, version
4648
1.3.0, available from http://contributor-covenant.org/version/1/3/0/

LICENSE.txt

+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) 2019 Shopify Inc.
44

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

docs/customization/index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var text = {
9999

100100
**Type**: object
101101

102-
**Default value**: dependent on component. [View component defaults](https://github.com/Shopify/buy-button-js/blob/master/src/defaults/components.j)
102+
**Default value**: dependent on component. [View component defaults](https://github.com/Shopify/buy-button-js/blob/master/src/defaults/components.js)
103103

104104
### `styles`
105105

@@ -270,6 +270,7 @@ var contents = {
270270
lineItems: true,
271271
footer: true,
272272
note: false,
273+
discounts: true,
273274
},
274275
```
275276

@@ -306,7 +307,8 @@ var contents = {
306307
image: true,
307308
variantTitle: true,
308309
title: true,
309-
price: true,
310+
price: false,
311+
priceWithDiscounts: true,
310312
quantity: true,
311313
quantityIncrement: true,
312314
quantityDecrement: true,

docs/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ This tool is intended for use by developers who are familiar with JavaScript and
1717

1818
## Current Support
1919

20-
| Internet Explorer | Chrome, Edge, Firefox | Safari | Opera | iOS | Android |
21-
| :-------------------- | :------------------------ | :------- | :------ | :---- | :-------- |
22-
| 10+ | (Current - 1) or Current | 5.1+ | 12.1x, (Current - 1) or Current | 6.1+ | 2.3, 4.0+
20+
| Internet Explorer | Chrome, Edge, Firefox, Opera | Safari | iOS | Android |
21+
| :-------------------- | :------------------------------- | :-------- | :------ | :-------- |
22+
| 11+ | (Current - 1) or Current | 8+ | 8+ | 4.4+
2323

2424
## Including the library
2525

26-
Include a script tag with a specific version of the library specified. The example below uses version `0.9.1`, but any version from `0.1.0` onwards is available on CDN. You can find the versions on [NPM](https://www.npmjs.com/package/@shopify/buy-button-js).
26+
Include a script tag with a specific version of the library specified. The example below uses version `1.0.0`, but the latest version can be found on [NPM](https://www.npmjs.com/package/@shopify/buy-button-js).
2727

2828
```html
29-
<script src="http://sdks.shopifycdn.com/buy-button/0.9.1/buybutton.js"></script>
29+
<script src="http://sdks.shopifycdn.com/buy-button/1.0.0/buybutton.js"></script>
3030
```
3131

3232
## Creating a Shop Client

package.json

+55-46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"name": "@shopify/buy-button-js",
3-
"version": "0.11.1",
3+
"version": "2.1.3",
4+
"browserslist": [
5+
"last 2 Chrome versions",
6+
"last 2 Firefox versions",
7+
"last 2 versions",
8+
"Safari >= 8",
9+
"iOS >= 8",
10+
"IE >= 11",
11+
"android >= 4.4"
12+
],
413
"description": "BuyButton.js allows merchants to build Shopify interfaces into any website",
514
"main": "lib/buybutton.umd.js",
615
"repository": "[email protected]:Shopify/buy-button-js.git",
@@ -40,63 +49,63 @@
4049
"author": "Shopify Inc.",
4150
"license": "MIT",
4251
"devDependencies": {
52+
"@babel/cli": "7.5.5",
53+
"@babel/core": "7.5.5",
54+
"@babel/plugin-external-helpers": "7.2.0",
55+
"@babel/plugin-transform-arrow-functions": "7.2.0",
56+
"@babel/plugin-transform-block-scoped-functions": "7.2.0",
57+
"@babel/plugin-transform-block-scoping": "7.5.5",
58+
"@babel/plugin-transform-classes": "7.5.5",
59+
"@babel/plugin-transform-computed-properties": "7.2.0",
60+
"@babel/plugin-transform-destructuring": "7.5.0",
61+
"@babel/plugin-transform-duplicate-keys": "7.5.0",
62+
"@babel/plugin-transform-function-name": "7.4.4",
63+
"@babel/plugin-transform-literals": "7.2.0",
64+
"@babel/plugin-transform-modules-commonjs": "7.5.0",
65+
"@babel/plugin-transform-object-super": "7.5.5",
66+
"@babel/plugin-transform-parameters": "7.4.4",
67+
"@babel/plugin-transform-shorthand-properties": "7.2.0",
68+
"@babel/plugin-transform-spread": "7.2.2",
69+
"@babel/plugin-transform-template-literals": "7.4.4",
70+
"@babel/plugin-transform-typeof-symbol": "7.2.0",
4371
"@shopify/js-uploader": "https://github.com/Shopify/js-uploader.git",
4472
"aws-sdk": "2.6.8",
45-
"babel-cli": "6.24.1",
46-
"babel-core": "6.25.0",
47-
"babel-plugin-check-es2015-constants": "6.8.0",
48-
"babel-plugin-external-helpers": "6.8.0",
49-
"babel-plugin-transform-es2015-arrow-functions": "6.8.0",
50-
"babel-plugin-transform-es2015-block-scoped-functions": "6.8.0",
51-
"babel-plugin-transform-es2015-block-scoping": "6.10.1",
52-
"babel-plugin-transform-es2015-classes": "6.9.0",
53-
"babel-plugin-transform-es2015-computed-properties": "6.8.0",
54-
"babel-plugin-transform-es2015-destructuring": "6.9.0",
55-
"babel-plugin-transform-es2015-duplicate-keys": "6.8.0",
56-
"babel-plugin-transform-es2015-function-name": "6.9.0",
57-
"babel-plugin-transform-es2015-literals": "6.8.0",
58-
"babel-plugin-transform-es2015-modules-commonjs": "6.11.5",
59-
"babel-plugin-transform-es2015-object-super": "6.8.0",
60-
"babel-plugin-transform-es2015-parameters": "6.11.4",
61-
"babel-plugin-transform-es2015-shorthand-properties": "6.8.0",
62-
"babel-plugin-transform-es2015-spread": "6.8.0",
63-
"babel-plugin-transform-es2015-template-literals": "6.8.0",
64-
"babel-plugin-transform-es2015-typeof-symbol": "6.8.0",
65-
"babelify": "7.3.0",
73+
"babelify": "10.0.0",
6674
"chai": "4.2.0",
67-
"core-js": "2.4.1",
75+
"core-js": "3.1.4",
6876
"eslint": "3.3.1",
6977
"eslint-plugin-shopify": "13.0",
7078
"fetch-pretender": "1.5.0",
7179
"global-npm": "0.3.0",
72-
"http-server": "0.9.0",
73-
"mime-types": "2.1.12",
74-
"mocha": "5.2.0",
75-
"postcss": "5.2.8",
76-
"postcss-cssnext": "2.9.0",
77-
"postcss-import": "9.0.0",
78-
"pretender": "1.1.0",
79-
"rollup": "0.45.2",
80-
"rollup-plugin-babel": "2.7.1",
81-
"rollup-plugin-commonjs": "8.0.2",
82-
"rollup-plugin-node-resolve": "3.0.0",
83-
"sinon": "6.3.5",
84-
"testem": "2.0.0",
85-
"watch": "0.19.1",
86-
"watchify": "3.7.0",
80+
"http-server": "0.11.1",
81+
"mime-types": "2.1.24",
82+
"mocha": "6.2.0",
83+
"postcss": "7.0.17",
84+
"postcss-calc": "7.0.1",
85+
"postcss-import": "12.0.1",
86+
"postcss-preset-env": "6.7.0",
87+
"pretender": "3.0.2",
88+
"rollup": "1.18.0",
89+
"rollup-plugin-babel": "4.3.3",
90+
"rollup-plugin-commonjs": "10.0.1",
91+
"rollup-plugin-node-resolve": "5.2.0",
92+
"sinon": "7.4.1",
93+
"testem": "2.17.0",
94+
"watch": "1.0.2",
95+
"watchify": "3.11.1",
8796
"wdio-dot-reporter": "0.0.6",
8897
"wdio-junit-reporter": "0.1.0",
8998
"wdio-mocha-framework": "0.5.13",
9099
"webdriverio": "4.2.8",
91-
"whatwg-fetch": "2.0.3"
100+
"whatwg-fetch": "3.0.0"
92101
},
93102
"dependencies": {
94-
"babel-runtime": "6.11.6",
95-
"browserify": "13.1.0",
96-
"morphdom": "1.4.6",
97-
"mustache": "2.2.1",
98-
"node-sass": "3.8.0",
99-
"shopify-buy": "2.2.1",
100-
"uglify-js": "2.7.0"
103+
"@babel/runtime": "7.5.5",
104+
"browserify": "16.3.0",
105+
"morphdom": "2.5.5",
106+
"mustache": "3.0.1",
107+
"node-sass": "4.12.0",
108+
"shopify-buy": "2.10.0",
109+
"uglify-js": "3.6.0"
101110
}
102111
}

0 commit comments

Comments
 (0)