@heymantle/litho 0.0.1 → 0.0.3
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/README.md +1 -1
- package/dist/cjs/dev/verify-publish.js +69 -0
- package/dist/esm/dev/verify-publish.js +60 -0
- package/package.json +13 -8
package/README.md
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env zx
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _semver = /*#__PURE__*/ _interop_require_default(require("semver"));
|
|
7
|
+
function _interop_require_default(obj) {
|
|
8
|
+
return obj && obj.__esModule ? obj : {
|
|
9
|
+
default: obj
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function _tagged_template_literal(strings, raw) {
|
|
13
|
+
if (!raw) {
|
|
14
|
+
raw = strings.slice(0);
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
17
|
+
raw: {
|
|
18
|
+
value: Object.freeze(raw)
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function _templateObject() {
|
|
23
|
+
var data = _tagged_template_literal([
|
|
24
|
+
"npm view @heymantle/litho version"
|
|
25
|
+
]);
|
|
26
|
+
_templateObject = function _templateObject() {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
var packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
32
|
+
var currentVersion = packageJson.version;
|
|
33
|
+
var npmVersion = await $(_templateObject()).text();
|
|
34
|
+
if (_semver.default.gte(npmVersion, currentVersion)) {
|
|
35
|
+
var shouldIncrement = await question("npm version is greater than package.json version. Increment local version? (y/n)", {
|
|
36
|
+
choices: [
|
|
37
|
+
"y",
|
|
38
|
+
"n"
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
if (shouldIncrement === "y") {
|
|
42
|
+
var versionType = await question("Which type of release is this? (patch/minor/major)", {
|
|
43
|
+
choices: [
|
|
44
|
+
"patch",
|
|
45
|
+
"minor",
|
|
46
|
+
"major"
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
if (![
|
|
50
|
+
"patch",
|
|
51
|
+
"minor",
|
|
52
|
+
"major"
|
|
53
|
+
].includes(versionType)) {
|
|
54
|
+
echo("Invalid version type. Please choose from patch, minor, or major.");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
var newVersion = _semver.default.inc(currentVersion, versionType);
|
|
58
|
+
packageJson.version = newVersion;
|
|
59
|
+
await fs.writeFile("package.json", JSON.stringify(packageJson, null, 2));
|
|
60
|
+
echo("Incremented version to ".concat(newVersion));
|
|
61
|
+
process.exit(0);
|
|
62
|
+
} else {
|
|
63
|
+
echo("Cannot publish if npm version is greater or equal to local version");
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
echo("Valid release version ".concat(npmVersion, ". Publishing..."));
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env zx
|
|
2
|
+
function _tagged_template_literal(strings, raw) {
|
|
3
|
+
if (!raw) {
|
|
4
|
+
raw = strings.slice(0);
|
|
5
|
+
}
|
|
6
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
7
|
+
raw: {
|
|
8
|
+
value: Object.freeze(raw)
|
|
9
|
+
}
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
function _templateObject() {
|
|
13
|
+
var data = _tagged_template_literal([
|
|
14
|
+
"npm view @heymantle/litho version"
|
|
15
|
+
]);
|
|
16
|
+
_templateObject = function _templateObject() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
import semver from "semver";
|
|
22
|
+
var packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
23
|
+
var currentVersion = packageJson.version;
|
|
24
|
+
var npmVersion = await $(_templateObject()).text();
|
|
25
|
+
if (semver.gte(npmVersion, currentVersion)) {
|
|
26
|
+
var shouldIncrement = await question("npm version is greater than package.json version. Increment local version? (y/n)", {
|
|
27
|
+
choices: [
|
|
28
|
+
"y",
|
|
29
|
+
"n"
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
if (shouldIncrement === "y") {
|
|
33
|
+
var versionType = await question("Which type of release is this? (patch/minor/major)", {
|
|
34
|
+
choices: [
|
|
35
|
+
"patch",
|
|
36
|
+
"minor",
|
|
37
|
+
"major"
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
if (![
|
|
41
|
+
"patch",
|
|
42
|
+
"minor",
|
|
43
|
+
"major"
|
|
44
|
+
].includes(versionType)) {
|
|
45
|
+
echo("Invalid version type. Please choose from patch, minor, or major.");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
var newVersion = semver.inc(currentVersion, versionType);
|
|
49
|
+
packageJson.version = newVersion;
|
|
50
|
+
await fs.writeFile("package.json", JSON.stringify(packageJson, null, 2));
|
|
51
|
+
echo("Incremented version to ".concat(newVersion));
|
|
52
|
+
process.exit(0);
|
|
53
|
+
} else {
|
|
54
|
+
echo("Cannot publish if npm version is greater or equal to local version");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
echo("Valid release version ".concat(npmVersion, ". Publishing..."));
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heymantle/litho",
|
|
3
3
|
"description": "Litho is a library of components for building Mantle extensions",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "npm run build:cjs; npm run build:esm",
|
|
34
34
|
"build:cjs": "npx swc . --out-dir dist/cjs --config-file .swcrc",
|
|
35
|
-
"build:esm": "npx swc . --out-dir dist/esm --config-file .esm.swcrc --out-file-extension js"
|
|
35
|
+
"build:esm": "npx swc . --out-dir dist/esm --config-file .esm.swcrc --out-file-extension js",
|
|
36
|
+
"build-and-publish": "npm run build && ./dev/verify-publish.mjs && npm publish"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": ">=18",
|
|
@@ -40,14 +41,18 @@
|
|
|
40
41
|
"tailwindcss": ">=4"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"tailwind-variants": "^0.3.1",
|
|
44
|
-
"dayjs": "^1.11.7",
|
|
45
44
|
"@shopify/polaris-icons": "^7.13.0",
|
|
46
|
-
"
|
|
45
|
+
"dayjs": "^1.11.7",
|
|
46
|
+
"react-color": "^2.19.3",
|
|
47
|
+
"react-datepicker": "^8.1.0",
|
|
48
|
+
"tailwind-variants": "^0.3.1",
|
|
49
|
+
"use-debounce": "^9.0.4"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@swc/cli": "^0.7.7",
|
|
50
|
-
"@swc/core": "^1.12.1"
|
|
53
|
+
"@swc/core": "^1.12.1",
|
|
54
|
+
"semver": "^7.7.2",
|
|
55
|
+
"zx": "^8.7.1"
|
|
51
56
|
},
|
|
52
|
-
"license": "
|
|
53
|
-
}
|
|
57
|
+
"license": "MIT"
|
|
58
|
+
}
|