@akinon/projectzero 1.25.0-rc.4 → 1.25.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 CHANGED
@@ -1,27 +1,17 @@
1
1
  # @akinon/projectzero
2
2
 
3
- ## 1.25.0-rc.4
4
-
5
- ## 1.25.0-rc.3
6
-
7
- ## 1.25.0-rc.2
8
-
9
- ## 1.25.0-rc.1
3
+ ## 1.25.0
10
4
 
11
5
  ### Minor Changes
12
6
 
13
- - 197d602: ZERO-2459: Warn if akinon-next version is not up to date
7
+ - 350ffc0: ZERO-2522: Create command fixed for the cli
8
+
9
+ ## 1.24.1
14
10
 
15
11
  ### Patch Changes
16
12
 
17
13
  - 95510c7: ZERO-2508: Enable rc branch pipeline and add check-publish-version step
18
14
 
19
- ## 1.25.0-rc.0
20
-
21
- ### Minor Changes
22
-
23
- - 197d602: ZERO-2459: Warn if akinon-next version is not up to date
24
-
25
15
  ## 1.24.0
26
16
 
27
17
  ## 1.23.0
@@ -1,112 +1,76 @@
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
 
8
7
  const rootDir = path.resolve(process.cwd());
9
8
 
10
- function findPluginsFilePath() {
11
- const option1 = path.resolve(rootDir, './src/plugins.js');
12
- const option2 = path.resolve(rootDir, './packages/akinon-next/plugins.js');
13
-
14
- if (fs.existsSync(option1)) {
15
- return option1;
16
- } else if (fs.existsSync(option2)) {
17
- return option2;
18
- } else {
19
- throw new Error(
20
- 'plugins.js was not found in either of the expected locations.'
21
- );
22
- }
23
- }
24
-
25
- const pluginsFilePath = findPluginsFilePath();
26
-
27
- let installedPlugins: Array<string> = [];
28
-
29
- try {
30
- installedPlugins = require(pluginsFilePath);
31
- } catch (error) {
32
- console.error('Error loading installed plugins:', error);
33
- process.exit(1);
34
- }
35
-
36
- const definedPlugins = [
37
- {
38
- name: 'Basket Gift Pack',
39
- value: 'pz-basket-gift-pack'
40
- },
41
- {
42
- name: 'Click & Collect',
43
- value: 'pz-click-collect'
44
- },
45
- {
46
- name: 'Checkout Gift Pack',
47
- value: 'pz-checkout-gift-pack'
48
- },
49
- {
50
- name: 'One Click Checkout',
51
- value: 'pz-one-click-checkout'
52
- },
53
- {
54
- name: 'Garanti Pay',
55
- value: 'pz-gpay'
56
- },
57
- {
58
- name: 'Pay On Delivery',
59
- value: 'pz-pay-on-delivery'
60
- },
61
- {
62
- name: 'Otp',
63
- value: 'pz-otp'
64
- },
65
- {
66
- name: 'BKM Express',
67
- value: 'pz-bkm'
68
- },
69
- {
70
- name: 'Credit Payment',
71
- value: 'pz-credit-payment'
9
+ export default async () => {
10
+ function findPluginsFilePath() {
11
+ const option1 = path.resolve(rootDir, './src/plugins.js');
12
+ const option2 = path.resolve(rootDir, './packages/akinon-next/plugins.js');
13
+
14
+ if (fs.existsSync(option1)) {
15
+ return option1;
16
+ } else if (fs.existsSync(option2)) {
17
+ return option2;
18
+ } else {
19
+ throw new Error(
20
+ 'plugins.js was not found in either of the expected locations.'
21
+ );
22
+ }
72
23
  }
73
- ];
74
24
 
75
- interface PackageInfo {
76
- 'dist-tags': {
77
- latest: string;
78
- };
79
- }
25
+ const pluginsFilePath = findPluginsFilePath();
80
26
 
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}`;
27
+ let installedPlugins: Array<string> = [];
90
28
 
91
29
  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');
30
+ installedPlugins = require(pluginsFilePath);
31
+ } catch (error) {
32
+ console.error('Error loading installed plugins:', error);
33
+ process.exit(1);
104
34
  }
105
- }
106
35
 
107
- export default async () => {
108
- const pkg: PackageJson = require(path.resolve(rootDir, './package.json'));
109
- await checkVersion(pkg);
36
+ const definedPlugins = [
37
+ {
38
+ name: 'Basket Gift Pack',
39
+ value: 'pz-basket-gift-pack'
40
+ },
41
+ {
42
+ name: 'Click & Collect',
43
+ value: 'pz-click-collect'
44
+ },
45
+ {
46
+ name: 'Checkout Gift Pack',
47
+ value: 'pz-checkout-gift-pack'
48
+ },
49
+ {
50
+ name: 'One Click Checkout',
51
+ value: 'pz-one-click-checkout'
52
+ },
53
+ {
54
+ name: 'Garanti Pay',
55
+ value: 'pz-gpay'
56
+ },
57
+ {
58
+ name: 'Pay On Delivery',
59
+ value: 'pz-pay-on-delivery'
60
+ },
61
+ {
62
+ name: 'Otp',
63
+ value: 'pz-otp'
64
+ },
65
+ {
66
+ name: 'BKM Express',
67
+ value: 'pz-bkm'
68
+ },
69
+ {
70
+ name: 'Credit Payment',
71
+ value: 'pz-credit-payment'
72
+ }
73
+ ];
110
74
 
111
75
  const prompt = new Prompt({
112
76
  name: 'plugins',
@@ -38,89 +38,69 @@ 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
- function findPluginsFilePath() {
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;
43
+ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
44
+ function findPluginsFilePath() {
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
+ }
52
56
  }
53
- else {
54
- throw new Error('plugins.js was not found in either of the expected locations.');
57
+ const pluginsFilePath = findPluginsFilePath();
58
+ let installedPlugins = [];
59
+ try {
60
+ installedPlugins = require(pluginsFilePath);
55
61
  }
56
- }
57
- const pluginsFilePath = findPluginsFilePath();
58
- let installedPlugins = [];
59
- try {
60
- installedPlugins = require(pluginsFilePath);
61
- }
62
- catch (error) {
63
- console.error('Error loading installed plugins:', error);
64
- process.exit(1);
65
- }
66
- const definedPlugins = [
67
- {
68
- name: 'Basket Gift Pack',
69
- value: 'pz-basket-gift-pack'
70
- },
71
- {
72
- name: 'Click & Collect',
73
- value: 'pz-click-collect'
74
- },
75
- {
76
- name: 'Checkout Gift Pack',
77
- value: 'pz-checkout-gift-pack'
78
- },
79
- {
80
- name: 'One Click Checkout',
81
- value: 'pz-one-click-checkout'
82
- },
83
- {
84
- name: 'Garanti Pay',
85
- value: 'pz-gpay'
86
- },
87
- {
88
- name: 'Pay On Delivery',
89
- value: 'pz-pay-on-delivery'
90
- },
91
- {
92
- name: 'Otp',
93
- value: 'pz-otp'
94
- },
95
- {
96
- name: 'BKM Express',
97
- value: 'pz-bkm'
98
- },
99
- {
100
- name: 'Credit Payment',
101
- value: 'pz-credit-payment'
62
+ catch (error) {
63
+ console.error('Error loading installed plugins:', error);
64
+ process.exit(1);
102
65
  }
103
- ];
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');
66
+ const definedPlugins = [
67
+ {
68
+ name: 'Basket Gift Pack',
69
+ value: 'pz-basket-gift-pack'
70
+ },
71
+ {
72
+ name: 'Click & Collect',
73
+ value: 'pz-click-collect'
74
+ },
75
+ {
76
+ name: 'Checkout Gift Pack',
77
+ value: 'pz-checkout-gift-pack'
78
+ },
79
+ {
80
+ name: 'One Click Checkout',
81
+ value: 'pz-one-click-checkout'
82
+ },
83
+ {
84
+ name: 'Garanti Pay',
85
+ value: 'pz-gpay'
86
+ },
87
+ {
88
+ name: 'Pay On Delivery',
89
+ value: 'pz-pay-on-delivery'
90
+ },
91
+ {
92
+ name: 'Otp',
93
+ value: 'pz-otp'
94
+ },
95
+ {
96
+ name: 'BKM Express',
97
+ value: 'pz-bkm'
98
+ },
99
+ {
100
+ name: 'Credit Payment',
101
+ value: 'pz-credit-payment'
118
102
  }
119
- });
120
- }
121
- 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);
103
+ ];
124
104
  const prompt = new Prompt({
125
105
  name: 'plugins',
126
106
  message: 'Please check/uncheck plugins to install/uninstall.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "1.25.0-rc.4",
3
+ "version": "1.25.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": {