@ordergroove/smi-serve 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/package.json +2 -2
- package/src/auth.js +4 -1
- package/src/deploy.js +6 -2
- package/src/init.js +5 -2
- package/src/utils.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.4.2](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.4.1...@ordergroove/smi-serve@1.4.2) (2024-04-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ordergroove/smi-serve
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.4.1](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.4.0...@ordergroove/smi-serve@1.4.1) (2024-04-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **smi-serve:** Include template version in smi-serve ([4d2c368](https://github.com/ordergroove/plush-toys/commit/4d2c368bfdd819de817d7d38fa6dfb563e908998))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.4.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.3.10...@ordergroove/smi-serve@1.4.0) (2024-04-01)
|
|
7
26
|
|
|
8
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/smi-serve",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Utility to serve a SMI template locally",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Eugenio Lattanzio <eugenio.lattanzio@ordergroove.com>",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"ora": "^5.4.1",
|
|
33
33
|
"yargs": "^17.7.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "92a950dbbce92fb61a1bfe26779e80ff7d1c9a8c"
|
|
36
36
|
}
|
package/src/auth.js
CHANGED
|
@@ -112,7 +112,10 @@ async function login(args) {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
server.listen(port, '127.0.0.1', () => {
|
|
115
|
-
const loginUrl = `${getRC3Url(args)}?${new URLSearchParams([
|
|
115
|
+
const loginUrl = `${getRC3Url(args)}?${new URLSearchParams([
|
|
116
|
+
['login_redirect', `http://localhost:${port}`],
|
|
117
|
+
['sm_local_dev', 'true']
|
|
118
|
+
])}`;
|
|
116
119
|
console.log(`Browsing ${loginUrl}`);
|
|
117
120
|
open(loginUrl);
|
|
118
121
|
});
|
package/src/deploy.js
CHANGED
|
@@ -4,7 +4,7 @@ const util = require('util');
|
|
|
4
4
|
const inquirer = require('inquirer');
|
|
5
5
|
const glob = util.promisify(require('glob'));
|
|
6
6
|
const { chooseMerchant, getRC3Url } = require('./auth');
|
|
7
|
-
const { getcwd } = require('./utils');
|
|
7
|
+
const { getcwd, readPackageJson, packageJsonKeys } = require('./utils');
|
|
8
8
|
|
|
9
9
|
function reportDiffFiles(original, newRequest) {
|
|
10
10
|
const originalFiles =
|
|
@@ -89,6 +89,9 @@ async function deploy(args) {
|
|
|
89
89
|
console.log(err);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
const packageJson = readPackageJson();
|
|
93
|
+
const smiTemplatesVersion = packageJson[packageJsonKeys.OG_SECTION]?.[packageJsonKeys.TEMPLATES_VERSION];
|
|
94
|
+
|
|
92
95
|
const newRequest = {
|
|
93
96
|
...original,
|
|
94
97
|
configs: {
|
|
@@ -96,7 +99,8 @@ async function deploy(args) {
|
|
|
96
99
|
smi: {
|
|
97
100
|
...((original.configs && original.configs.smi) || {}),
|
|
98
101
|
files: fileList
|
|
99
|
-
}
|
|
102
|
+
},
|
|
103
|
+
...(smiTemplatesVersion && { provisioned_with: { '@ordergroove/smi-templates': smiTemplatesVersion } })
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
106
|
|
package/src/init.js
CHANGED
|
@@ -31,7 +31,7 @@ async function getConfigs(args, endpoint, merchant, token) {
|
|
|
31
31
|
|
|
32
32
|
async function updateJsonFile(filename, config) {
|
|
33
33
|
const original = await fs.promises.readFile(filename, 'utf8').then(JSON.parse, () => ({}));
|
|
34
|
-
// update this way so it wont
|
|
34
|
+
// update this way so it wont lose the json sorting
|
|
35
35
|
Object.entries(config).forEach(([key, value]) => {
|
|
36
36
|
original[key] = value;
|
|
37
37
|
});
|
|
@@ -127,6 +127,8 @@ async function init(args) {
|
|
|
127
127
|
smiVersion = 'latest';
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
console.log(`Using templates version ${smiTemplateVersion}`);
|
|
131
|
+
|
|
130
132
|
// skip this for now
|
|
131
133
|
const installEntrypoint = args.entrypoint;
|
|
132
134
|
|
|
@@ -174,7 +176,8 @@ node_modules/
|
|
|
174
176
|
main: installEntrypoint ? 'entrypoint.js' : 'views/main.liquid',
|
|
175
177
|
keywords: ['Ordergroove SMI', merchant.name, merchant.public_id],
|
|
176
178
|
[packageJsonKeys.OG_SECTION]: {
|
|
177
|
-
[packageJsonKeys.CORE_VERSION]: smiVersion
|
|
179
|
+
[packageJsonKeys.CORE_VERSION]: smiVersion,
|
|
180
|
+
[packageJsonKeys.TEMPLATES_VERSION]: smiTemplateVersion
|
|
178
181
|
}
|
|
179
182
|
});
|
|
180
183
|
|
package/src/utils.js
CHANGED