@akinon/projectzero 1.24.0-rc.6 → 1.24.0
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 +1 -17
- package/commands/plugins.ts +0 -36
- package/dist/commands/plugins.js +3 -39
- package/dist/index.js +0 -0
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
-
## 1.24.0
|
|
4
|
-
|
|
5
|
-
## 1.24.0-rc.5
|
|
6
|
-
|
|
7
|
-
### Minor Changes
|
|
8
|
-
|
|
9
|
-
- 197d602: ZERO-2459: Warn if akinon-next version is not up to date
|
|
10
|
-
|
|
11
|
-
## 1.24.0-rc.4
|
|
12
|
-
|
|
13
|
-
## 1.24.0-rc.3
|
|
14
|
-
|
|
15
|
-
## 1.24.0-rc.2
|
|
16
|
-
|
|
17
|
-
## 1.24.0-rc.1
|
|
18
|
-
|
|
19
|
-
## 1.24.0-rc.0
|
|
3
|
+
## 1.24.0
|
|
20
4
|
|
|
21
5
|
## 1.23.0
|
|
22
6
|
|
package/commands/plugins.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
|
-
import semver from 'semver';
|
|
5
4
|
|
|
6
5
|
const Prompt = require('prompt-checkbox');
|
|
7
6
|
|
|
@@ -72,42 +71,7 @@ const definedPlugins = [
|
|
|
72
71
|
}
|
|
73
72
|
];
|
|
74
73
|
|
|
75
|
-
interface PackageInfo {
|
|
76
|
-
'dist-tags': {
|
|
77
|
-
latest: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface PackageJson {
|
|
82
|
-
dependencies: {
|
|
83
|
-
[key: string]: string;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async function checkVersion(pkg: PackageJson) {
|
|
88
|
-
const packageName = '@akinon/next';
|
|
89
|
-
const registryUrl = `https://registry.npmjs.org/${packageName}`;
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
const response = await fetch(registryUrl);
|
|
93
|
-
const pkgInfo = (await response.json()) as PackageInfo;
|
|
94
|
-
const latestVersion = pkgInfo['dist-tags'].latest;
|
|
95
|
-
|
|
96
|
-
if (!semver.satisfies(pkg.dependencies['@akinon/next'], latestVersion)) {
|
|
97
|
-
console.warn(
|
|
98
|
-
`\x1b[43mWarning: The "${packageName}" package is currently at version ${pkg.dependencies['@akinon/next']}. Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`,
|
|
99
|
-
'\x1b[0m\n'
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
} catch (error: any) {
|
|
103
|
-
console.error(`\x1b[41mError: ${error?.message}`, '\x1b[0m\n');
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
74
|
export default async () => {
|
|
108
|
-
const pkg: PackageJson = require(path.resolve(rootDir, './package.json'));
|
|
109
|
-
await checkVersion(pkg);
|
|
110
|
-
|
|
111
75
|
const prompt = new Prompt({
|
|
112
76
|
name: 'plugins',
|
|
113
77
|
message: 'Please check/uncheck plugins to install/uninstall.',
|
package/dist/commands/plugins.js
CHANGED
|
@@ -38,31 +38,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
39
|
const path_1 = __importDefault(require("path"));
|
|
40
40
|
const child_process_1 = require("child_process");
|
|
41
|
-
const semver_1 = __importDefault(require("semver"));
|
|
42
41
|
const Prompt = require('prompt-checkbox');
|
|
43
42
|
const rootDir = path_1.default.resolve(process.cwd());
|
|
44
|
-
|
|
45
|
-
const option1 = path_1.default.resolve(rootDir, './src/plugins.js');
|
|
46
|
-
const option2 = path_1.default.resolve(rootDir, './packages/akinon-next/plugins.js');
|
|
47
|
-
if (fs.existsSync(option1)) {
|
|
48
|
-
return option1;
|
|
49
|
-
}
|
|
50
|
-
else if (fs.existsSync(option2)) {
|
|
51
|
-
return option2;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
throw new Error('plugins.js was not found in either of the expected locations.');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const pluginsFilePath = findPluginsFilePath();
|
|
43
|
+
const pluginsFilePath = path_1.default.resolve(rootDir, './packages/akinon-next/plugins.js');
|
|
58
44
|
let installedPlugins = [];
|
|
59
45
|
try {
|
|
60
|
-
installedPlugins = require(
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.error('Error loading installed plugins:', error);
|
|
64
|
-
process.exit(1);
|
|
46
|
+
installedPlugins = require(path_1.default.resolve(rootDir, './packages/akinon-next/plugins.js'));
|
|
65
47
|
}
|
|
48
|
+
catch (error) { }
|
|
66
49
|
const definedPlugins = [
|
|
67
50
|
{
|
|
68
51
|
name: 'Basket Gift Pack',
|
|
@@ -101,26 +84,7 @@ const definedPlugins = [
|
|
|
101
84
|
value: 'pz-credit-payment'
|
|
102
85
|
}
|
|
103
86
|
];
|
|
104
|
-
function checkVersion(pkg) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
const packageName = '@akinon/next';
|
|
107
|
-
const registryUrl = `https://registry.npmjs.org/${packageName}`;
|
|
108
|
-
try {
|
|
109
|
-
const response = yield fetch(registryUrl);
|
|
110
|
-
const pkgInfo = (yield response.json());
|
|
111
|
-
const latestVersion = pkgInfo['dist-tags'].latest;
|
|
112
|
-
if (!semver_1.default.satisfies(pkg.dependencies['@akinon/next'], latestVersion)) {
|
|
113
|
-
console.warn(`\x1b[43mWarning: The "${packageName}" package is currently at version ${pkg.dependencies['@akinon/next']}. Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`, '\x1b[0m\n');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
console.error(`\x1b[41mError: ${error === null || error === void 0 ? void 0 : error.message}`, '\x1b[0m\n');
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
87
|
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
-
const pkg = require(path_1.default.resolve(rootDir, './package.json'));
|
|
123
|
-
yield checkVersion(pkg);
|
|
124
88
|
const prompt = new Prompt({
|
|
125
89
|
name: 'plugins',
|
|
126
90
|
message: 'Please check/uncheck plugins to install/uninstall.',
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/projectzero",
|
|
3
|
-
"version": "1.24.0
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI tool to manage your Project Zero Next project",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^18.8.0",
|
|
18
|
-
"@types/semver": "7.5.8",
|
|
19
18
|
"@types/temp": "0.9.4"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|