@akinon/projectzero 2.0.0-beta.1 → 2.0.0-beta.11
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 +41 -0
- package/app-template/.env.example +5 -0
- package/app-template/.gitignore +2 -0
- package/app-template/CHANGELOG.md +251 -0
- package/app-template/README.md +6 -0
- package/app-template/config/prebuild-tests.json +5 -0
- package/app-template/docs/plugins.md +60 -25
- package/app-template/jest.config.ts +2 -2
- package/app-template/{next.config.mjs → next.config.ts} +6 -3
- package/app-template/package.json +30 -27
- package/app-template/postcss.config.mjs +8 -0
- package/app-template/public/locales/en/account.json +4 -0
- package/app-template/public/locales/en/common.json +10 -0
- package/app-template/public/locales/tr/account.json +4 -0
- package/app-template/public/locales/tr/common.json +10 -0
- package/app-template/src/__tests__/middleware-matcher.test.ts +135 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +99 -7
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +112 -47
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/page.tsx +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/address/stores/page.tsx +2 -2
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/page.tsx +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +2 -2
- package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +12 -15
- package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/{pz-not-found/page.tsx → not-found.tsx} +2 -2
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/checkout/page.tsx +7 -4
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +47 -1
- package/app-template/src/assets/globals.scss +162 -34
- package/app-template/src/components/__tests__/badge.test.tsx +2 -2
- package/app-template/src/components/accordion.tsx +1 -1
- package/app-template/src/components/button.tsx +50 -35
- package/app-template/src/components/checkbox.tsx +1 -0
- package/app-template/src/components/file-input.tsx +44 -2
- package/app-template/src/components/input.tsx +3 -3
- package/app-template/src/components/modal.tsx +1 -1
- package/app-template/src/components/select.tsx +2 -2
- package/app-template/src/components/shimmer.tsx +1 -1
- package/app-template/src/components/tabs.tsx +2 -2
- package/app-template/src/components/types/index.ts +4 -1
- package/app-template/src/middleware.ts +1 -0
- package/app-template/src/plugins.js +2 -1
- package/app-template/src/redux/middlewares/category.ts +1 -1
- package/app-template/src/redux/reducers/category.ts +1 -1
- package/app-template/src/redux/store.ts +4 -3
- package/app-template/src/utils/convert-facet-search-params.ts +1 -1
- package/app-template/src/views/account/contact-form.tsx +3 -8
- package/app-template/src/views/account/content-header.tsx +2 -3
- package/app-template/src/views/account/order.tsx +11 -9
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +5 -4
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +45 -38
- package/app-template/src/views/basket/basket-item.tsx +1 -0
- package/app-template/src/views/category/category-active-filters.tsx +1 -1
- package/app-template/src/views/category/category-header.tsx +12 -6
- package/app-template/src/views/category/category-info.tsx +4 -4
- package/app-template/src/views/category/filters/index.tsx +2 -2
- package/app-template/src/views/checkout/auth.tsx +1 -1
- package/app-template/src/views/checkout/layout/header.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/index.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +5 -1
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +4 -4
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +3 -3
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +1 -1
- package/app-template/src/views/checkout/summary.tsx +2 -2
- package/app-template/src/views/header/action-menu.tsx +11 -4
- package/app-template/src/views/header/band.tsx +2 -2
- package/app-template/src/views/header/mini-basket.tsx +15 -4
- package/app-template/src/views/header/mobile-menu.tsx +6 -6
- package/app-template/src/views/header/navbar.tsx +1 -1
- package/app-template/src/views/header/pwa-back-button.tsx +1 -1
- package/app-template/src/views/header/search/index.tsx +16 -4
- package/app-template/src/views/header/search/results.tsx +1 -1
- package/app-template/src/views/header/user-menu.tsx +3 -1
- package/app-template/src/views/installment-options/index.tsx +1 -1
- package/app-template/src/views/login/index.tsx +30 -6
- package/app-template/src/views/otp-login/index.tsx +12 -14
- package/app-template/src/views/product/price-wrapper.tsx +7 -2
- package/app-template/src/views/product/product-info.tsx +35 -5
- package/app-template/src/views/product/slider.tsx +1 -1
- package/app-template/src/views/product-pointer-banner-item.tsx +1 -1
- package/app-template/src/views/register/index.tsx +29 -4
- package/app-template/src/views/sales-contract-modal/index.tsx +17 -17
- package/app-template/src/widgets/footer-info.tsx +1 -1
- package/app-template/src/widgets/footer-menu.tsx +1 -1
- package/app-template/src/widgets/footer-subscription/index.tsx +1 -1
- package/app-template/src/widgets/home-stories-eng.tsx +1 -1
- package/app-template/tailwind.config.js +2 -134
- package/codemods/sentry-9/index.js +30 -0
- package/codemods/sentry-9/remove-sentry-configs.js +14 -0
- package/codemods/sentry-9/remove-sentry-dependency.js +25 -0
- package/codemods/sentry-9/replace-error-page.js +32 -0
- package/codemods/update-tailwind-config/index.js +30 -0
- package/codemods/update-tailwind-config/transform.js +102 -0
- package/commands/codemod.ts +17 -0
- package/commands/index.ts +3 -1
- package/commands/plugins.ts +24 -30
- package/dist/codemods/sentry-9/templates/error.js +14 -0
- package/dist/commands/codemod.js +15 -0
- package/dist/commands/index.js +3 -1
- package/dist/commands/plugins.js +23 -20
- package/package.json +3 -2
- package/app-template/postcss.config.js +0 -6
- package/app-template/sentry.client.config.ts +0 -16
- package/app-template/sentry.edge.config.ts +0 -3
- package/app-template/sentry.properties +0 -4
- package/app-template/sentry.server.config.ts +0 -3
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +0 -67
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const yargs = require('yargs/yargs');
|
|
8
|
+
const { hideBin } = require('yargs/helpers');
|
|
9
|
+
const args = yargs(hideBin(process.argv)).argv;
|
|
10
|
+
exports.default = () => {
|
|
11
|
+
const codemodName = args.codemod;
|
|
12
|
+
const codemodPath = path_1.default.resolve(__dirname, `../../codemods/${codemodName}/index.js`);
|
|
13
|
+
const codemod = require(codemodPath);
|
|
14
|
+
codemod.transform();
|
|
15
|
+
};
|
package/dist/commands/index.js
CHANGED
|
@@ -9,11 +9,13 @@ const add_language_1 = __importDefault(require("./add-language"));
|
|
|
9
9
|
const remove_language_1 = __importDefault(require("./remove-language"));
|
|
10
10
|
const default_language_1 = __importDefault(require("./default-language"));
|
|
11
11
|
const plugins_1 = __importDefault(require("./plugins"));
|
|
12
|
+
const codemod_1 = __importDefault(require("./codemod"));
|
|
12
13
|
exports.default = {
|
|
13
14
|
commerceUrl: commerce_url_1.default,
|
|
14
15
|
create: create_1.default,
|
|
15
16
|
addLanguage: add_language_1.default,
|
|
16
17
|
removeLanguage: remove_language_1.default,
|
|
17
18
|
defaultLanguage: default_language_1.default,
|
|
18
|
-
plugins: plugins_1.default
|
|
19
|
+
plugins: plugins_1.default,
|
|
20
|
+
codemod: codemod_1.default
|
|
19
21
|
};
|
package/dist/commands/plugins.js
CHANGED
|
@@ -49,7 +49,7 @@ const fs = __importStar(require("fs"));
|
|
|
49
49
|
const path_1 = __importDefault(require("path"));
|
|
50
50
|
const child_process_1 = require("child_process");
|
|
51
51
|
const semver_1 = __importDefault(require("semver"));
|
|
52
|
-
const
|
|
52
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
53
53
|
const rootDir = path_1.default.resolve(process.cwd());
|
|
54
54
|
function checkVersion(pkg) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -137,31 +137,34 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
137
137
|
{
|
|
138
138
|
name: 'Tabby Payment Extension',
|
|
139
139
|
value: 'pz-tabby-extension'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'Tamara Payment Extension',
|
|
143
|
+
value: 'pz-tamara-extension'
|
|
140
144
|
}
|
|
141
145
|
];
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
console.log(`\nInstalling ${formattedAnswers.join(', ')}.`);
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
console.log(`\nUninstalling all plugins.`);
|
|
146
|
+
try {
|
|
147
|
+
const answers = yield (0, prompts_1.checkbox)({
|
|
148
|
+
message: 'Please check/uncheck plugins to install/uninstall.',
|
|
149
|
+
choices: definedPlugins.map((plugin) => ({
|
|
150
|
+
name: plugin.name,
|
|
151
|
+
value: plugin.value,
|
|
152
|
+
checked: installedPlugins.includes(plugin.value)
|
|
153
|
+
}))
|
|
154
|
+
});
|
|
155
|
+
if (!answers.length) {
|
|
156
|
+
console.log('\x1b[33m%s\x1b[0m', `\nUninstalling all plugins.`);
|
|
157
157
|
}
|
|
158
|
-
console.log(`\nPlease wait...`);
|
|
159
|
-
fs.writeFileSync(pluginsFilePath, `module.exports = ${JSON.stringify(
|
|
158
|
+
console.log('\x1b[36m%s\x1b[0m', `\nPlease wait...`);
|
|
159
|
+
fs.writeFileSync(pluginsFilePath, `module.exports = ${JSON.stringify(answers)};\n`, {
|
|
160
160
|
encoding: 'utf-8'
|
|
161
161
|
});
|
|
162
162
|
(0, child_process_1.execSync)('yarn install', { stdio: 'pipe' });
|
|
163
|
-
console.log('\x1b[32m%s\x1b[0m', `\n
|
|
163
|
+
console.log('\x1b[32m%s\x1b[0m', `\n✓ ${answers.length
|
|
164
164
|
? 'Installed selected plugins'
|
|
165
165
|
: 'Uninstalled all plugins'}.\n`);
|
|
166
|
-
}
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
167
170
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/projectzero",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI tool to manage your Project Zero Next project",
|
|
6
6
|
"bin": {
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"@types/temp": "0.9.4"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"jscodeshift": "^0.15.1",
|
|
23
|
+
"@inquirer/prompts": "7.5.0",
|
|
22
24
|
"loading-spinner": "1.2.1",
|
|
23
|
-
"prompt-checkbox": "2.2.0",
|
|
24
25
|
"semver": "7.6.2",
|
|
25
26
|
"temp": "0.9.4",
|
|
26
27
|
"yargs": "^17.6.0"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { initSentry } from '@akinon/next/sentry';
|
|
2
|
-
|
|
3
|
-
async function initializeSentry() {
|
|
4
|
-
const response = await fetch('/api/sentry', { next: { revalidate: 0 } });
|
|
5
|
-
const data = await response.json();
|
|
6
|
-
|
|
7
|
-
const options = {
|
|
8
|
-
dsn: data.dsn,
|
|
9
|
-
integrations: [],
|
|
10
|
-
tracesSampleRate: 1.0
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
initSentry('Client', options);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
initializeSentry();
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Skeleton, SkeletonWrapper } from 'components';
|
|
2
|
-
|
|
3
|
-
export default function Loading() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="container mx-auto">
|
|
6
|
-
<div className="max-w-5xl mx-auto my-5 px-7">
|
|
7
|
-
<SkeletonWrapper className="md:mb-7">
|
|
8
|
-
<Skeleton className="w-[17.25rem] h-4 lg:w-64" />
|
|
9
|
-
</SkeletonWrapper>
|
|
10
|
-
</div>
|
|
11
|
-
<div className="grid max-w-5xl grid-cols-2 lg:gap-8 mx-auto px-7">
|
|
12
|
-
<div className="col-span-2 mb-7 md:mb-0 lg:col-span-1">
|
|
13
|
-
<div className="flex gap-1">
|
|
14
|
-
<SkeletonWrapper className="hidden md:block md:mb-7">
|
|
15
|
-
{Array(5)
|
|
16
|
-
.fill(null)
|
|
17
|
-
.map((_, index) => (
|
|
18
|
-
<Skeleton key={index} className="w-20 h-24 mb-2" />
|
|
19
|
-
))}
|
|
20
|
-
</SkeletonWrapper>
|
|
21
|
-
|
|
22
|
-
<div className="flex-1">
|
|
23
|
-
<SkeletonWrapper className="md:mb-7">
|
|
24
|
-
<Skeleton className="w-full h-[30.375rem] md:h-[36.375rem]" />
|
|
25
|
-
</SkeletonWrapper>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<div className="flex flex-col items-center col-span-2 lg:col-span-1">
|
|
30
|
-
<div className="w-full">
|
|
31
|
-
<SkeletonWrapper className="w-full md:mb-7 flex justify-center items-center">
|
|
32
|
-
<Skeleton className="w-96 h-16 mb-9" />
|
|
33
|
-
<Skeleton className="hidden w-36 h-14 mb-9 md:block" />
|
|
34
|
-
|
|
35
|
-
<div className="flex flex-col justify-center items-center mb-9">
|
|
36
|
-
<Skeleton className="w-36 h-4 mb-2" />
|
|
37
|
-
<div className="flex items-center gap-2">
|
|
38
|
-
{Array(3)
|
|
39
|
-
.fill(null)
|
|
40
|
-
.map((_, index) => (
|
|
41
|
-
<Skeleton key={index} className="w-24 h-10" />
|
|
42
|
-
))}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div className="flex flex-col justify-center items-center mb-4">
|
|
47
|
-
<Skeleton className="w-36 h-4 mb-2" />
|
|
48
|
-
<div className="flex items-center gap-2">
|
|
49
|
-
{Array(5)
|
|
50
|
-
.fill(null)
|
|
51
|
-
.map((_, index) => (
|
|
52
|
-
<Skeleton key={index} className="w-11 h-11" />
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<Skeleton className="hidden w-full h-14 mb-6 md:block" />
|
|
58
|
-
<Skeleton className="w-40 h-10 mb-9 md:w-72" />
|
|
59
|
-
<Skeleton className="w-24 h-10 mb-7" />
|
|
60
|
-
<Skeleton className="w-full h-36" />
|
|
61
|
-
</SkeletonWrapper>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
}
|