zotero-plugin 6.0.0 → 6.0.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/bin/fetch-log.mjs +1 -1
- package/bin/release.mjs +6 -3
- package/bin/zipup.mjs +35 -13
- package/package.json +1 -1
- package/version.js +5 -3
package/bin/fetch-log.mjs
CHANGED
package/bin/release.mjs
CHANGED
|
@@ -15,7 +15,7 @@ var require_package = __commonJS({
|
|
|
15
15
|
"package.json"(exports, module) {
|
|
16
16
|
module.exports = {
|
|
17
17
|
name: "zotero-plugin",
|
|
18
|
-
version: "6.0.
|
|
18
|
+
version: "6.0.2",
|
|
19
19
|
description: "Zotero plugin builder",
|
|
20
20
|
homepage: "https://github.com/retorquere/zotero-plugin/wiki",
|
|
21
21
|
bin: {
|
|
@@ -208,12 +208,15 @@ import * as fs from "fs";
|
|
|
208
208
|
import * as os from "os";
|
|
209
209
|
import * as path from "path";
|
|
210
210
|
var version = null;
|
|
211
|
+
function load(vpath) {
|
|
212
|
+
return JSON.parse(fs.readFileSync(vpath, "utf-8")).version;
|
|
213
|
+
}
|
|
211
214
|
var version_json = path.join(root_default, "gen/version.json");
|
|
212
215
|
if (fs.existsSync(version_json)) {
|
|
213
|
-
version =
|
|
216
|
+
version = load(version_json);
|
|
214
217
|
} else {
|
|
215
218
|
console.log("writing version");
|
|
216
|
-
version =
|
|
219
|
+
version = load(path.join(root_default, "package.json"));
|
|
217
220
|
if (ContinuousIntegration.service && !ContinuousIntegration.tag) {
|
|
218
221
|
const issue = ContinuousIntegration.issue && process.env.VERSION_WITH_ISSUE !== "false" ? `.${ContinuousIntegration.issue}` : "";
|
|
219
222
|
version = `${version}${issue}.${ContinuousIntegration.build_number}`;
|
package/bin/zipup.mjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
-
}) : x)(function(x) {
|
|
5
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
-
});
|
|
8
2
|
|
|
9
3
|
// bin/zipup.ts
|
|
10
|
-
import
|
|
4
|
+
import archiver from "archiver";
|
|
11
5
|
import * as fs2 from "fs";
|
|
12
6
|
import * as path2 from "path";
|
|
13
7
|
|
|
@@ -74,12 +68,15 @@ var ContinuousIntegration = new ContinuousIntegrationSingleton();
|
|
|
74
68
|
|
|
75
69
|
// version.ts
|
|
76
70
|
var version = null;
|
|
71
|
+
function load(vpath) {
|
|
72
|
+
return JSON.parse(fs.readFileSync(vpath, "utf-8")).version;
|
|
73
|
+
}
|
|
77
74
|
var version_json = path.join(root_default, "gen/version.json");
|
|
78
75
|
if (fs.existsSync(version_json)) {
|
|
79
|
-
version =
|
|
76
|
+
version = load(version_json);
|
|
80
77
|
} else {
|
|
81
78
|
console.log("writing version");
|
|
82
|
-
version =
|
|
79
|
+
version = load(path.join(root_default, "package.json"));
|
|
83
80
|
if (ContinuousIntegration.service && !ContinuousIntegration.tag) {
|
|
84
81
|
const issue = ContinuousIntegration.issue && process.env.VERSION_WITH_ISSUE !== "false" ? `.${ContinuousIntegration.issue}` : "";
|
|
85
82
|
version = `${version}${issue}.${ContinuousIntegration.build_number}`;
|
|
@@ -97,7 +94,32 @@ var xpi = path2.join(root_default, "xpi", `${target}-${version_default}.xpi`);
|
|
|
97
94
|
console.log(`creating ${xpi}`);
|
|
98
95
|
if (fs2.existsSync(xpi)) fs2.unlinkSync(xpi);
|
|
99
96
|
if (!fs2.existsSync(path2.dirname(xpi))) fs2.mkdirSync(path2.dirname(xpi));
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
async function main() {
|
|
98
|
+
await new Promise((resolve, reject) => {
|
|
99
|
+
const xpi2 = path2.join(root_default, "xpi", `${target}-${version_default}.xpi`);
|
|
100
|
+
const output = fs2.createWriteStream(xpi2);
|
|
101
|
+
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
102
|
+
output.on("close", () => {
|
|
103
|
+
console.log(archive.pointer() + " total bytes");
|
|
104
|
+
console.log("Archiver has been finalized and the output file descriptor has closed.");
|
|
105
|
+
resolve();
|
|
106
|
+
});
|
|
107
|
+
archive.on("warning", (err) => {
|
|
108
|
+
if (err.code === "ENOENT") {
|
|
109
|
+
console.warn(err.message);
|
|
110
|
+
} else {
|
|
111
|
+
console.error(err);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
archive.on("error", (err) => {
|
|
115
|
+
reject(err);
|
|
116
|
+
});
|
|
117
|
+
archive.pipe(output);
|
|
118
|
+
archive.directory(`${root_default}/${source}`, false);
|
|
119
|
+
archive.finalize();
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
main().catch((err) => {
|
|
123
|
+
console.log(err);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
});
|
package/package.json
CHANGED
package/version.js
CHANGED
|
@@ -8,14 +8,16 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
8
8
|
const continuous_integration_1 = require("./continuous-integration");
|
|
9
9
|
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
10
10
|
let version = null;
|
|
11
|
+
function load(vpath) {
|
|
12
|
+
return JSON.parse(fs.readFileSync(vpath, 'utf-8')).version;
|
|
13
|
+
}
|
|
11
14
|
const version_json = path.join(root_1.default, 'gen/version.json');
|
|
12
15
|
if (fs.existsSync(version_json)) {
|
|
13
|
-
version =
|
|
16
|
+
version = load(version_json);
|
|
14
17
|
}
|
|
15
18
|
else {
|
|
16
19
|
console.log('writing version');
|
|
17
|
-
|
|
18
|
-
version = require(path.join(root_1.default, 'package.json')).version; // eslint-disable-line @typescript-eslint/no-require-imports
|
|
20
|
+
version = load(path.join(root_1.default, 'package.json'));
|
|
19
21
|
if (continuous_integration_1.ContinuousIntegration.service && !continuous_integration_1.ContinuousIntegration.tag) {
|
|
20
22
|
const issue = continuous_integration_1.ContinuousIntegration.issue && process.env.VERSION_WITH_ISSUE !== 'false' ? `.${continuous_integration_1.ContinuousIntegration.issue}` : '';
|
|
21
23
|
version = `${version}${issue}.${continuous_integration_1.ContinuousIntegration.build_number}`;
|