@akinon/projectzero 1.36.0-rc.0 ā 1.36.0-rc.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.36.0-rc.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [dff0d59]
|
|
12
|
+
- @akinon/next@1.36.0-rc.2
|
|
13
|
+
- @akinon/pz-b2b@1.36.0-rc.2
|
|
14
|
+
- @akinon/pz-gpay@1.36.0-rc.2
|
|
15
|
+
- @akinon/pz-masterpass@1.36.0-rc.2
|
|
16
|
+
- @akinon/pz-one-click-checkout@1.36.0-rc.2
|
|
17
|
+
- @akinon/pz-otp@1.36.0-rc.2
|
|
18
|
+
- @akinon/pz-pay-on-delivery@1.36.0-rc.2
|
|
19
|
+
|
|
20
|
+
## 1.36.0-rc.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- @akinon/next@1.36.0-rc.1
|
|
25
|
+
- @akinon/pz-b2b@1.36.0-rc.1
|
|
26
|
+
- @akinon/pz-gpay@1.36.0-rc.1
|
|
27
|
+
- @akinon/pz-masterpass@1.36.0-rc.1
|
|
28
|
+
- @akinon/pz-one-click-checkout@1.36.0-rc.1
|
|
29
|
+
- @akinon/pz-otp@1.36.0-rc.1
|
|
30
|
+
- @akinon/pz-pay-on-delivery@1.36.0-rc.1
|
|
31
|
+
|
|
3
32
|
## 1.36.0-rc.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.36.0-rc.
|
|
3
|
+
"version": "1.36.0-rc.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"prestart": "pz-prestart"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@akinon/next": "1.36.0-rc.
|
|
26
|
-
"@akinon/pz-b2b": "1.36.0-rc.
|
|
27
|
-
"@akinon/pz-gpay": "1.36.0-rc.
|
|
28
|
-
"@akinon/pz-masterpass": "1.36.0-rc.
|
|
29
|
-
"@akinon/pz-one-click-checkout": "1.36.0-rc.
|
|
30
|
-
"@akinon/pz-otp": "1.36.0-rc.
|
|
31
|
-
"@akinon/pz-pay-on-delivery": "1.36.0-rc.
|
|
25
|
+
"@akinon/next": "1.36.0-rc.2",
|
|
26
|
+
"@akinon/pz-b2b": "1.36.0-rc.2",
|
|
27
|
+
"@akinon/pz-gpay": "1.36.0-rc.2",
|
|
28
|
+
"@akinon/pz-masterpass": "1.36.0-rc.2",
|
|
29
|
+
"@akinon/pz-one-click-checkout": "1.36.0-rc.2",
|
|
30
|
+
"@akinon/pz-otp": "1.36.0-rc.2",
|
|
31
|
+
"@akinon/pz-pay-on-delivery": "1.36.0-rc.2",
|
|
32
32
|
"@hookform/resolvers": "2.9.0",
|
|
33
33
|
"@next/third-parties": "14.1.0",
|
|
34
34
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"yup": "0.32.11"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@akinon/eslint-plugin-projectzero": "1.36.0-rc.
|
|
56
|
+
"@akinon/eslint-plugin-projectzero": "1.36.0-rc.2",
|
|
57
57
|
"@semantic-release/changelog": "6.0.2",
|
|
58
58
|
"@semantic-release/exec": "6.0.3",
|
|
59
59
|
"@semantic-release/git": "10.0.1",
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
Button,
|
|
4
4
|
FileInput,
|
|
5
5
|
Input,
|
|
6
|
+
Link,
|
|
6
7
|
LoaderSpinner,
|
|
7
|
-
Select
|
|
8
|
-
Link
|
|
8
|
+
Select
|
|
9
9
|
} from '@theme/components';
|
|
10
10
|
import { useSession } from 'next-auth/react';
|
|
11
11
|
import { useEffect, useState } from 'react';
|
|
@@ -45,7 +45,8 @@ const contactFormSchema = (t) =>
|
|
|
45
45
|
.when('subject', {
|
|
46
46
|
is: (value) => value === '2',
|
|
47
47
|
then: yup.string().required(t('account.contact.form.error.required'))
|
|
48
|
-
})
|
|
48
|
+
}),
|
|
49
|
+
file: yup.mixed()
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
const ContactForm = () => {
|
|
@@ -110,8 +111,18 @@ const ContactForm = () => {
|
|
|
110
111
|
resolver: yupResolver(contactFormSchema(t))
|
|
111
112
|
});
|
|
112
113
|
|
|
113
|
-
const onSubmit: SubmitHandler<ContactFormType> = (data) => {
|
|
114
|
-
|
|
114
|
+
const onSubmit: SubmitHandler<ContactFormType> = (data, event) => {
|
|
115
|
+
const formData = new FormData()
|
|
116
|
+
|
|
117
|
+
Object.keys(data ?? {}).forEach((key) => {
|
|
118
|
+
if (key === "file" && data[key]){
|
|
119
|
+
formData.append(key, data[key][0]);
|
|
120
|
+
} else if (data[key]) {
|
|
121
|
+
formData.append(key, data[key]);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
sendContact(formData);
|
|
115
126
|
};
|
|
116
127
|
|
|
117
128
|
const handleChange = (e) => {
|
|
@@ -242,7 +253,12 @@ const ContactForm = () => {
|
|
|
242
253
|
<label className="text-xs text-gray-800 mb-2 block">
|
|
243
254
|
{t('account.contact.form.file.title')}
|
|
244
255
|
</label>
|
|
245
|
-
<FileInput
|
|
256
|
+
<FileInput
|
|
257
|
+
name="file"
|
|
258
|
+
title="file"
|
|
259
|
+
className="w-full mb-5"
|
|
260
|
+
{...register('file')}
|
|
261
|
+
/>
|
|
246
262
|
<Button type="submit" className="w-full font-medium">
|
|
247
263
|
{t('account.contact.form.submit_button')}
|
|
248
264
|
</Button>
|
package/commands/create.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as fs from 'fs';
|
|
|
3
3
|
import * as readline from 'readline';
|
|
4
4
|
import { slugify } from '../utils';
|
|
5
5
|
|
|
6
|
+
const { execSync } = require('child_process');
|
|
6
7
|
const loadingSpinner = require('loading-spinner');
|
|
7
8
|
|
|
8
9
|
interface Question {
|
|
@@ -139,7 +140,8 @@ export default async (): Promise<void> => {
|
|
|
139
140
|
const answers = await getAnswers();
|
|
140
141
|
const brandName =
|
|
141
142
|
answers.brandName === '.' ? path.basename(workingDir) : answers.brandName;
|
|
142
|
-
const projectDir = path.resolve(workingDir, slugify(brandName));
|
|
143
|
+
const projectDir = answers.brandName === '.' ? workingDir : path.resolve(workingDir, slugify(brandName));
|
|
144
|
+
const relativeProjectDir = answers.brandName === '.' ? '.' : slugify(brandName);
|
|
143
145
|
|
|
144
146
|
if (!fs.existsSync(projectDir)) {
|
|
145
147
|
fs.mkdirSync(projectDir, { recursive: true });
|
|
@@ -172,12 +174,34 @@ export default async (): Promise<void> => {
|
|
|
172
174
|
name: slugify(brandName)
|
|
173
175
|
});
|
|
174
176
|
|
|
177
|
+
|
|
178
|
+
console.log('\x1b[34m%s\x1b[0m', '\nš Installing packages...\n');
|
|
179
|
+
|
|
180
|
+
execSync(`cd ${relativeProjectDir} && yarn install`, { stdio: 'ignore' });
|
|
181
|
+
|
|
175
182
|
loadingSpinner.stop();
|
|
176
183
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
const successMessage = `
|
|
185
|
+
⨠${brandName} project is ready at \x1b[4m${projectDir}\x1b[0m
|
|
186
|
+
|
|
187
|
+
Within the directory, the following commands are available:
|
|
188
|
+
|
|
189
|
+
\x1b[35m$ yarn dev\x1b[0m
|
|
190
|
+
\x1b[32mLaunches the development server.\x1b[0m
|
|
191
|
+
|
|
192
|
+
\x1b[35m$ yarn build\x1b[0m
|
|
193
|
+
\x1b[32mCompiles the app into static files for production.\x1b[0m
|
|
194
|
+
|
|
195
|
+
\x1b[35m$ yarn start\x1b[0m
|
|
196
|
+
\x1b[32mRuns the production server.\x1b[0m
|
|
197
|
+
`;
|
|
198
|
+
|
|
199
|
+
const getStartedMessage = answers.brandName === '.'
|
|
200
|
+
? 'To get started, you can type:\n\n \x1b[35m$ yarn dev\x1b[0m\n'
|
|
201
|
+
: `To get started, you can type:\n\n \x1b[35m$ cd ${relativeProjectDir}\x1b[0m\n \x1b[35m$ yarn dev\x1b[0m\n`;
|
|
181
202
|
|
|
203
|
+
console.log('\x1b[32m%s\x1b[0m', successMessage);
|
|
204
|
+
console.log('\x1b[36m%s\x1b[0m', getStartedMessage);
|
|
205
|
+
console.log('\x1b[33m%s\x1b[0m', 'Project setup is complete\n');
|
|
182
206
|
console.log('\x1b[33m%s\x1b[0m', 'Project Zero - Akinon\n');
|
|
183
207
|
};
|
package/dist/commands/create.js
CHANGED
|
@@ -39,6 +39,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const readline = __importStar(require("readline"));
|
|
41
41
|
const utils_1 = require("../utils");
|
|
42
|
+
const { execSync } = require('child_process');
|
|
42
43
|
const loadingSpinner = require('loading-spinner');
|
|
43
44
|
const workingDir = path_1.default.resolve(process.cwd());
|
|
44
45
|
const rl = readline.createInterface({
|
|
@@ -128,7 +129,8 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
128
129
|
}
|
|
129
130
|
const answers = yield getAnswers();
|
|
130
131
|
const brandName = answers.brandName === '.' ? path_1.default.basename(workingDir) : answers.brandName;
|
|
131
|
-
const projectDir = path_1.default.resolve(workingDir, (0, utils_1.slugify)(brandName));
|
|
132
|
+
const projectDir = answers.brandName === '.' ? workingDir : path_1.default.resolve(workingDir, (0, utils_1.slugify)(brandName));
|
|
133
|
+
const relativeProjectDir = answers.brandName === '.' ? '.' : (0, utils_1.slugify)(brandName);
|
|
132
134
|
if (!fs.existsSync(projectDir)) {
|
|
133
135
|
fs.mkdirSync(projectDir, { recursive: true });
|
|
134
136
|
}
|
|
@@ -150,7 +152,28 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
150
152
|
updateFileContents(path_1.default.join(projectDir, 'package.json'), {
|
|
151
153
|
name: (0, utils_1.slugify)(brandName)
|
|
152
154
|
});
|
|
155
|
+
console.log('\x1b[34m%s\x1b[0m', '\nš Installing packages...\n');
|
|
156
|
+
execSync(`cd ${relativeProjectDir} && yarn install`, { stdio: 'ignore' });
|
|
153
157
|
loadingSpinner.stop();
|
|
154
|
-
|
|
158
|
+
const successMessage = `
|
|
159
|
+
⨠${brandName} project is ready at \x1b[4m${projectDir}\x1b[0m
|
|
160
|
+
|
|
161
|
+
Within the directory, the following commands are available:
|
|
162
|
+
|
|
163
|
+
\x1b[35m$ yarn dev\x1b[0m
|
|
164
|
+
\x1b[32mLaunches the development server.\x1b[0m
|
|
165
|
+
|
|
166
|
+
\x1b[35m$ yarn build\x1b[0m
|
|
167
|
+
\x1b[32mCompiles the app into static files for production.\x1b[0m
|
|
168
|
+
|
|
169
|
+
\x1b[35m$ yarn start\x1b[0m
|
|
170
|
+
\x1b[32mRuns the production server.\x1b[0m
|
|
171
|
+
`;
|
|
172
|
+
const getStartedMessage = answers.brandName === '.'
|
|
173
|
+
? 'To get started, you can type:\n\n \x1b[35m$ yarn dev\x1b[0m\n'
|
|
174
|
+
: `To get started, you can type:\n\n \x1b[35m$ cd ${relativeProjectDir}\x1b[0m\n \x1b[35m$ yarn dev\x1b[0m\n`;
|
|
175
|
+
console.log('\x1b[32m%s\x1b[0m', successMessage);
|
|
176
|
+
console.log('\x1b[36m%s\x1b[0m', getStartedMessage);
|
|
177
|
+
console.log('\x1b[33m%s\x1b[0m', 'Project setup is complete\n');
|
|
155
178
|
console.log('\x1b[33m%s\x1b[0m', 'Project Zero - Akinon\n');
|
|
156
179
|
});
|