@pisell/common 0.0.13-0 → 0.0.13

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/es/bin/pisell.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import("../../es/script/index");
2
+ import("../../es/script/index.js");
@@ -5,10 +5,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import deploy from "./deploy.js";
8
+ import { loadJSON } from "./utils/index.js";
8
9
  var args = process.argv.slice(2);
9
- var loadJSON = function loadJSON(path) {
10
- return JSON.parse(fs.readFileSync(new URL(path, import.meta.url)));
11
- };
12
10
  var isVersion = function isVersion(v) {
13
11
  return ['-v', '--version', '-V'].includes(v);
14
12
  };
@@ -236,6 +236,9 @@ var versionSort = function versionSort(versionList) {
236
236
  * @returns {*}
237
237
  */
238
238
  var getCurrentProjectName = function getCurrentProjectName() {
239
- return require("".concat(process.env.PWD, "/package.json")).name;
239
+ return loadJSON("".concat(process.env.PWD, "/package.json")).name;
240
240
  };
241
- export { isWorkingTreeClean, getServerConfig, connectServer, serverUpload, serverUnpack, versionSort, releaseProject, getGitCurrentBranch, getCurrentProjectName };
241
+ var loadJSON = function loadJSON(path) {
242
+ return JSON.parse(fs.readFileSync(new URL(path, import.meta.url)));
243
+ };
244
+ export { isWorkingTreeClean, getServerConfig, connectServer, serverUpload, serverUnpack, versionSort, releaseProject, getGitCurrentBranch, getCurrentProjectName, loadJSON };
package/lib/bin/pisell.js CHANGED
@@ -23,4 +23,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
 
25
25
  // src/bin/pisell.js
26
- import("../../es/script/index");
26
+ import("../../es/script/index.js");
@@ -23,9 +23,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
 
24
24
  // src/script/index.js
25
25
  var import_deploy = __toESM(require("./deploy.js"));
26
- var import_meta = {};
26
+ var import_utils = require("./utils/index.js");
27
27
  var args = process.argv.slice(2);
28
- var loadJSON = (path) => JSON.parse(fs.readFileSync(new URL(path, import_meta.url)));
29
28
  var isVersion = (v) => {
30
29
  return ["-v", "--version", "-V"].includes(v);
31
30
  };
@@ -40,7 +39,7 @@ var isHelp = (v) => {
40
39
  (0, import_deploy.default)(...params);
41
40
  break;
42
41
  case isVersion(args[0]):
43
- console.log(`@pisell/common@${loadJSON("../../package.json").version}`);
42
+ console.log(`@pisell/common@${(0, import_utils.loadJSON)("../../package.json").version}`);
44
43
  break;
45
44
  case isHelp(args[0]):
46
45
  console.log("pisell -h --help -H [全部命令]");
@@ -34,6 +34,7 @@ __export(utils_exports, {
34
34
  getGitCurrentBranch: () => getGitCurrentBranch,
35
35
  getServerConfig: () => getServerConfig,
36
36
  isWorkingTreeClean: () => isWorkingTreeClean,
37
+ loadJSON: () => loadJSON,
37
38
  releaseProject: () => releaseProject,
38
39
  serverUnpack: () => serverUnpack,
39
40
  serverUpload: () => serverUpload,
@@ -41,6 +42,7 @@ __export(utils_exports, {
41
42
  });
42
43
  module.exports = __toCommonJS(utils_exports);
43
44
  var import_ssh2 = __toESM(require("ssh2"));
45
+ var import_meta = {};
44
46
  var isWorkingTreeClean = async () => {
45
47
  const v = await $`git status --porcelain`;
46
48
  return v.stdout === "";
@@ -192,8 +194,9 @@ var versionSort = (versionList) => {
192
194
  });
193
195
  };
194
196
  var getCurrentProjectName = () => {
195
- return require(`${process.env.PWD}/package.json`).name;
197
+ return loadJSON(`${process.env.PWD}/package.json`).name;
196
198
  };
199
+ var loadJSON = (path) => JSON.parse(fs.readFileSync(new URL(path, import_meta.url)));
197
200
  // Annotate the CommonJS export names for ESM import in node:
198
201
  0 && (module.exports = {
199
202
  connectServer,
@@ -201,6 +204,7 @@ var getCurrentProjectName = () => {
201
204
  getGitCurrentBranch,
202
205
  getServerConfig,
203
206
  isWorkingTreeClean,
207
+ loadJSON,
204
208
  releaseProject,
205
209
  serverUnpack,
206
210
  serverUpload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/common",
3
- "version": "0.0.13-0",
3
+ "version": "0.0.13",
4
4
  "description": "A collection of reusable UI components for web development",
5
5
  "license": "MIT",
6
6
  "sideEffects": [