web-ggf 1.0.6 → 1.0.8

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.
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs');
4
+ var path = require('path');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
24
+ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
25
+
26
+ function findOrInitialsFile(pathWithNameExtension) {
27
+ if (isExist(pathWithNameExtension)) {
28
+ console.warn(`❎ ${pathWithNameExtension} is existing`);
29
+ return path__namespace.join(process.cwd(), pathWithNameExtension);
30
+ }
31
+ for (const pathName of pathWithNameExtension.split('/').reduce((acc, cur, idx) => {
32
+ if (idx === 0)
33
+ return [cur];
34
+ return [...acc, `${acc.slice(-1)[0]}/${cur}`];
35
+ }, [])) {
36
+ if (pathName.includes('.'))
37
+ continue;
38
+ if (!isExist(pathName)) {
39
+ console.warn(`${pathName} is not exist`);
40
+ mkdirSync(pathName);
41
+ }
42
+ else
43
+ console.warn(`${pathName} is exist`);
44
+ }
45
+ return path__namespace.join(process.cwd(), pathWithNameExtension);
46
+ }
47
+ function deleteFile(filePath) {
48
+ if (isExist(filePath)) {
49
+ fs__namespace.unlinkSync(getFilePath(filePath));
50
+ console.warn(`${filePath} is removed`);
51
+ }
52
+ }
53
+ function getFilePath(name) {
54
+ return path__namespace.join(process.cwd(), name);
55
+ }
56
+ function isExist(name) {
57
+ return fs__namespace.existsSync(getFilePath(name));
58
+ }
59
+ function mkdirSync(name) {
60
+ fs__namespace.mkdirSync(getFilePath(name), { recursive: true });
61
+ return console.warn(`🆗 ${name} directory created`);
62
+ }
63
+ function readUtf8File(filePath) {
64
+ return JSON.parse(fs__namespace.readFileSync(filePath, 'utf-8'));
65
+ }
66
+ function writeFileSyncWithLog({ targetPath, content, fileName, option }) {
67
+ try {
68
+ fs__namespace.writeFileSync(targetPath, content, option);
69
+ console.warn(`🆗 -> ${fileName} successfully ${fs__namespace.existsSync(targetPath) ? 'updated' : 'created'}`);
70
+ }
71
+ catch (err) {
72
+ console.error('❌ Error creating file:', err);
73
+ }
74
+ }
75
+
76
+ exports.deleteFile = deleteFile;
77
+ exports.findOrInitialsFile = findOrInitialsFile;
78
+ exports.getFilePath = getFilePath;
79
+ exports.readUtf8File = readUtf8File;
80
+ exports.writeFileSyncWithLog = writeFileSyncWithLog;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var npmInstall = require('./npm-install-DR6c952D.js');
4
+ require('child_process');
5
+
6
+ npmInstall.npmInstall([
7
+ { name: 'web-ggf', version: 'latest' },
8
+ { name: 'js-cookie', version: '^3.0.5' },
9
+ { name: 'daisyui', version: 'latest', dev: true },
10
+ { name: '@types/js-cookie', version: '^3.0.6', dev: true },
11
+ ]);
@@ -0,0 +1,121 @@
1
+ 'use strict';
2
+
3
+ var fileHelper = require('./file-helper-CPVdSg32.js');
4
+ require('fs');
5
+ require('path');
6
+
7
+ const fileName$5 = `page.tsx`;
8
+ const targetPath$5 = fileHelper.findOrInitialsFile(`src/app/[locale]/auth/${fileName$5}`);
9
+ const content$5 = `export default function AuthPage() {
10
+ return <div>AuthPage</div>;
11
+ }
12
+ `;
13
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$5, content: content$5, fileName: fileName$5 });
14
+
15
+ const fileName$4 = `globals.css`;
16
+ const targetPath$4 = fileHelper.findOrInitialsFile(`src/app/[locale]/${fileName$4}`);
17
+ const content$4 = `@import "tailwindcss";
18
+ @import "../../configs/THEME_CONFIG/index.css";
19
+ `;
20
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$4, content: content$4, fileName: fileName$4 });
21
+
22
+ const fileName$3 = `page.tsx`;
23
+ const targetPath$3 = fileHelper.findOrInitialsFile(`src/app/[locale]/${fileName$3}`);
24
+ const content$3 = `import { t } from '@lingui/core/macro';
25
+
26
+ import { initLingui, PageLangParam } from '@/locales/init-lingui';
27
+
28
+ export default async function Page({ params }: PageLangParam) {
29
+ const { locale } = await params;
30
+ initLingui(locale);
31
+
32
+ return (
33
+ <div>
34
+ <p>{t\`Hello world\`}</p>
35
+ </div>
36
+ );
37
+ }
38
+ `;
39
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$3, content: content$3, fileName: fileName$3 });
40
+
41
+ const fileName$2 = `layout.tsx`;
42
+ const targetPath$2 = fileHelper.findOrInitialsFile(`src/app/[locale]/${fileName$2}`);
43
+ const content$2 = `import { ReactNode } from 'react';
44
+
45
+ import { i18n as Lingui18n } from '@lingui/core';
46
+ import type { Metadata } from 'next';
47
+
48
+ import './globals.css';
49
+
50
+ import { allMessages } from '@/locales/lingui-server-instance';
51
+ import { ApolloProvider } from '@/utils/apollo-provider';
52
+ import { LinguiClientProvider } from '@/utils/linqui-client-provider';
53
+
54
+ export default async function RootLayout({ children, params }: Readonly<{ children: ReactNode; params: Promise<{ locale: string }> }>) {
55
+ const { locale } = await params;
56
+ Lingui18n.loadAndActivate({ locale, messages: allMessages[locale] });
57
+
58
+ return (
59
+ <html lang={locale}>
60
+ <body>
61
+ <LinguiClientProvider initialLocale={locale} initialMessages={allMessages[locale]!}>
62
+ <ApolloProvider>
63
+ <>{children}</>
64
+ </ApolloProvider>
65
+ </LinguiClientProvider>
66
+ </body>
67
+ </html>
68
+ );
69
+ }
70
+
71
+ export const metadata: Metadata = {
72
+ title: 'Test title',
73
+ description: 'Test description',
74
+ };
75
+ `;
76
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$2, content: content$2, fileName: fileName$2 });
77
+
78
+ const fileName$1 = `middleware.ts`;
79
+ const targetPath$1 = fileHelper.findOrInitialsFile(`src/${fileName$1}`);
80
+ const content$1 = `import { NextRequest } from 'next/server';
81
+
82
+ import { middlewareConfig } from '@/configs/MIDDLEWARE_CONFIG';
83
+
84
+ export async function middleware(request: NextRequest) {
85
+ return middlewareConfig.generateResponse(request as never);
86
+ }
87
+
88
+ export const config = {
89
+ matcher: '/((?!api|_next/data|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)',
90
+ };
91
+ `;
92
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$1, content: content$1, fileName: fileName$1 });
93
+
94
+ const fileName = `next.config.ts`;
95
+ const targetPath = fileHelper.findOrInitialsFile(fileName);
96
+ const content = `import type { NextConfig } from 'next';
97
+
98
+ const nextConfig: NextConfig = {
99
+ experimental: {
100
+ swcPlugins: [['@lingui/swc-plugin', {}]],
101
+ },
102
+ webpack: (config) => {
103
+ config.module.rules.push({
104
+ test: /\\.po$/,
105
+ use: {
106
+ loader: '@lingui/loader',
107
+ },
108
+ });
109
+
110
+ return config;
111
+ },
112
+ };
113
+
114
+ export default nextConfig;
115
+ `;
116
+ fileHelper.writeFileSyncWithLog({ targetPath, content, fileName });
117
+
118
+ fileHelper.deleteFile('src/app/page.tsx');
119
+ fileHelper.deleteFile('src/app/layout.tsx');
120
+ fileHelper.deleteFile('src/app/favicon.ico');
121
+ fileHelper.deleteFile('src/app/globals.css');
@@ -0,0 +1,135 @@
1
+ 'use strict';
2
+
3
+ var npmInstall = require('./npm-install-DR6c952D.js');
4
+ var fileHelper = require('./file-helper-CPVdSg32.js');
5
+ require('child_process');
6
+ require('fs');
7
+ require('path');
8
+
9
+ npmInstall.npmInstall([
10
+ { name: '@lingui/cli', version: 'latest', dev: true },
11
+ { name: '@lingui/swc-plugin', version: '5.7.0', dev: true },
12
+ { name: '@lingui/loader', version: 'latest', dev: true },
13
+ { name: '@lingui/react', version: 'latest' },
14
+ { name: '@lingui/core', version: 'latest' },
15
+ ]);
16
+
17
+ const fileName$4 = `init-lingui.ts`;
18
+ const targetPath$4 = fileHelper.findOrInitialsFile(`src/locales/${fileName$4}`);
19
+ const content$4 = `import { setI18n } from '@lingui/react/server';
20
+
21
+ import { getI18nInstance } from './lingui-server-instance';
22
+
23
+ export type PageLangParam = {
24
+ params: Promise<{ locale: string }>;
25
+ };
26
+
27
+ export function initLingui(lang: string) {
28
+ const i18n = getI18nInstance(lang);
29
+ setI18n(i18n);
30
+ return i18n;
31
+ }
32
+ `;
33
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$4, content: content$4, fileName: fileName$4 });
34
+
35
+ const fileName$3 = `linqui-client-provider.tsx`;
36
+ const targetPath$3 = fileHelper.findOrInitialsFile(`src/utils/${fileName$3}`);
37
+ const content$3 = `'use client';
38
+
39
+ import { type ReactNode, useState } from 'react';
40
+
41
+ import { type Messages, setupI18n } from '@lingui/core';
42
+ import { I18nProvider } from '@lingui/react';
43
+
44
+ export function LinguiClientProvider({
45
+ children,
46
+ initialLocale,
47
+ initialMessages,
48
+ }: {
49
+ children: ReactNode;
50
+ initialLocale: string;
51
+ initialMessages: Messages;
52
+ }) {
53
+ const [i18n] = useState(() =>
54
+ setupI18n({
55
+ locale: initialLocale,
56
+ messages: { [initialLocale]: initialMessages },
57
+ }),
58
+ );
59
+
60
+ return <I18nProvider i18n={i18n}>{children}</I18nProvider>;
61
+ }
62
+ `;
63
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$3, content: content$3, fileName: fileName$3 });
64
+
65
+ const fileName$2 = `lingui.config.js`;
66
+ const targetPath$2 = fileHelper.findOrInitialsFile(fileName$2);
67
+ const content$2 = `/** @type {import('@lingui/conf').LinguiConfig} */
68
+ module.exports = {
69
+ locales: ['en', 'mn'],
70
+ sourceLocale: 'en',
71
+ fallbackLocales: { default: 'en' },
72
+ catalogs: [
73
+ {
74
+ path: 'src/locales/{locale}',
75
+ include: ['src/'],
76
+ },
77
+ ],
78
+ format: 'po',
79
+ orderBy: 'message',
80
+ compileNamespace: 'ts',
81
+ };
82
+ `;
83
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$2, content: content$2, fileName: fileName$2 });
84
+
85
+ const fileName$1 = `lingui-server-instance.ts`;
86
+ const targetPath$1 = fileHelper.findOrInitialsFile(`src/locales/${fileName$1}`);
87
+ const content$1 = `import 'server-only';
88
+
89
+ import { I18n, Messages, setupI18n } from '@lingui/core';
90
+
91
+ import linguiConfig from '../../lingui.config';
92
+
93
+ const { locales } = linguiConfig;
94
+ // optionally use a stricter union type
95
+ type SupportedLocales = string;
96
+
97
+ async function loadCatalog(locale: SupportedLocales): Promise<{
98
+ [k: string]: Messages;
99
+ }> {
100
+ const { messages } = await import(\`./\${locale}.po\`);
101
+ return {
102
+ [locale]: messages,
103
+ };
104
+ }
105
+ const catalogs = await Promise.all(locales.map(loadCatalog));
106
+
107
+ // transform array of catalogs into a single object
108
+ export const allMessages = catalogs.reduce((acc, oneCatalog) => ({ ...acc, ...oneCatalog }), {});
109
+
110
+ type AllI18nInstances = { [K in SupportedLocales]: I18n };
111
+
112
+ export const allI18nInstances: AllI18nInstances = locales.reduce((acc, locale) => {
113
+ const messages = allMessages[locale] ?? {};
114
+ const i18n = setupI18n({
115
+ locale,
116
+ messages: { [locale]: messages },
117
+ });
118
+ return { ...acc, [locale]: i18n };
119
+ }, {});
120
+
121
+ export const getI18nInstance = (locale: SupportedLocales): I18n => {
122
+ if (!allI18nInstances[locale]) {
123
+ console.warn(\`No i18n instance found for locale "\${locale}"\`);
124
+ }
125
+ return allI18nInstances[locale] || allI18nInstances['en']!;
126
+ };
127
+ `;
128
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$1, content: content$1, fileName: fileName$1 });
129
+
130
+ const fileName = `package.json`;
131
+ const targetPath = fileHelper.getFilePath(fileName);
132
+ const content = fileHelper.readUtf8File(targetPath);
133
+ content.scripts['lingui:extract:clean'] = `lingui extract --clean`;
134
+ content.scripts['lingui:compile:typescript'] = `lingui compile --typescript`;
135
+ fileHelper.writeFileSyncWithLog({ targetPath, content: JSON.stringify(content, null, 2), fileName, option: 'utf-8' });
@@ -0,0 +1,133 @@
1
+ 'use strict';
2
+
3
+ var fileHelper = require('./file-helper-CPVdSg32.js');
4
+ require('fs');
5
+ require('path');
6
+
7
+ const fileName$7 = `APP_CONFIG.d.ts`;
8
+ const targetPath$7 = fileHelper.findOrInitialsFile(`src/configs/${fileName$7}`);
9
+ const content$7 = `export interface AppConfigProps {
10
+ appIndex: string;
11
+ tokens: {
12
+ uid: string;
13
+ secret: string;
14
+ };
15
+ map: {
16
+ googleMapApiKey: string;
17
+ defaultCenter: { lat: number; lng: number };
18
+ defaultZoom: number;
19
+ };
20
+ }
21
+ `;
22
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$7, content: content$7, fileName: fileName$7 });
23
+
24
+ const fileName$6 = `APP_CONFIG.ts`;
25
+ const targetPath$6 = fileHelper.findOrInitialsFile(`src/configs/${fileName$6}`);
26
+ const content$6 = `import type { AppConfigProps } from './APP_CONFIG.d';
27
+
28
+ export const APP_CONFIG: AppConfigProps = {
29
+ appIndex: '<app_index>',
30
+ tokens: { uid: '<uid>', secret: '<secret>' },
31
+ map: { googleMapApiKey: '', defaultCenter: { lat: 47.919045645074696, lng: 106.91752910614014 }, defaultZoom: 12 },
32
+ };
33
+ `;
34
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$6, content: content$6, fileName: fileName$6 });
35
+
36
+ const fileName$5 = `HOST_CONFIG.d.ts`;
37
+ const targetPath$5 = fileHelper.findOrInitialsFile(`src/configs/${fileName$5}`);
38
+ const content$5 = `export interface HostConfigProps {
39
+ host: string;
40
+ elastic: {
41
+ host: string;
42
+ username: string;
43
+ password: string;
44
+ };
45
+ }
46
+ `;
47
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$5, content: content$5, fileName: fileName$5 });
48
+
49
+ const fileName$4 = `HOST_CONFIG.ts`;
50
+ const targetPath$4 = fileHelper.findOrInitialsFile(`src/configs/${fileName$4}`);
51
+ const content$4 = `import type { HostConfigProps } from './HOST_CONFIG.d';
52
+
53
+ export const HOST_CONFIG: HostConfigProps = {
54
+ host: '<host_url>',
55
+ elastic: {
56
+ host: '<host_url>',
57
+ username: '<username>',
58
+ password: '<password>'
59
+ }
60
+ };
61
+ `;
62
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$4, content: content$4, fileName: fileName$4 });
63
+
64
+ const fileName$3 = `MIDDLEWARE_CONFIG.ts`;
65
+ const targetPath$3 = fileHelper.findOrInitialsFile(`src/configs/${fileName$3}`);
66
+ const content$3 = `import { NextJSAuthMiddleware } from 'web-ggf/nextjs-middleware';
67
+
68
+ import { APP_CONFIG } from '@/configs/APP_CONFIG';
69
+ import { HOST_CONFIG } from '@/configs/HOST_CONFIG';
70
+ import { STORE_KEY_CONFIG } from '@/configs/STORE_KEY_CONFIG';
71
+
72
+ export const middlewareConfig = new NextJSAuthMiddleware({
73
+ userTokenKey: STORE_KEY_CONFIG.USER_TOKEN,
74
+ clientTokenKey: STORE_KEY_CONFIG.CLIENT_TOKEN,
75
+ refreshTokenKey: STORE_KEY_CONFIG.REFRESH_TOKEN,
76
+ appKey: APP_CONFIG.tokens.uid,
77
+ appSecret: APP_CONFIG.tokens.secret,
78
+ host: HOST_CONFIG.host,
79
+ protectedPaths: [/^(\\/\\w{2})?\\/account\\/?/, /^(\\/\\w{2})?\\/checkout\\/address\\/?/, /^(\\/\\w{2})?\\/checkout\\/confirm\\/?/],
80
+ secure: process.env.NODE_ENV === 'production',
81
+ locale: 'mn',
82
+ });
83
+ `;
84
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$3, content: content$3, fileName: fileName$3 });
85
+
86
+ const fileName$2 = `STORE_KEY_CONFIG.d.ts`;
87
+ const targetPath$2 = fileHelper.findOrInitialsFile(`src/configs/${fileName$2}`);
88
+ const content$2 = `export interface StoreKeyConfigProps {
89
+ USER_TOKEN: string;
90
+ REFRESH_TOKEN: string;
91
+ CLIENT_TOKEN: string;
92
+ EXPIRES_IN: string;
93
+ }
94
+ `;
95
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$2, content: content$2, fileName: fileName$2 });
96
+
97
+ const fileName$1 = `STORE_KEY_CONFIG.ts`;
98
+ const targetPath$1 = fileHelper.findOrInitialsFile(`src/configs/${fileName$1}`);
99
+ const content$1 = `import type { StoreKeyConfigProps } from './STORE_KEY_CONFIG.d';
100
+
101
+ import { APP_CONFIG } from '@/configs/APP_CONFIG';
102
+
103
+ export const STORE_KEY_CONFIG: StoreKeyConfigProps = {
104
+ USER_TOKEN: \`\${APP_CONFIG.appIndex}_USER_TOKEN\`,
105
+ CLIENT_TOKEN: \`\${APP_CONFIG.appIndex}CLIENT_TOKEN\`,
106
+ REFRESH_TOKEN: \`\${APP_CONFIG.appIndex}REFRESH_TOKEN\`,
107
+ EXPIRES_IN: \`\${APP_CONFIG.appIndex}EXPIRES_IN\`,
108
+ };
109
+ `;
110
+ fileHelper.writeFileSyncWithLog({ targetPath: targetPath$1, content: content$1, fileName: fileName$1 });
111
+
112
+ const fileName = `index.css`;
113
+ const targetPath = fileHelper.findOrInitialsFile(`src/configs/THEME_CONFIG/${fileName}`);
114
+ const content = `@plugin "daisyui" {
115
+ /*noinspection CssUnknownProperty*/
116
+ themes: light --default, dark --prefersdark;
117
+ }
118
+ @plugin "daisyui/theme" {
119
+ /*noinspection CssUnknownProperty*/
120
+ default: true;
121
+ name: light;
122
+ --color-primary: #EE3562;
123
+ --color-secondary: teal;
124
+ }
125
+ @plugin "daisyui/theme" {
126
+ /*noinspection CssUnknownProperty*/
127
+ prefersdark: true;
128
+ name: dark;
129
+ --color-primary: #EE3562;
130
+ --color-secondary: teal;
131
+ }
132
+ `;
133
+ fileHelper.writeFileSyncWithLog({ targetPath, content, fileName });
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var fileHelper = require('./file-helper-CPVdSg32.js');
4
+ var npmInstall = require('./npm-install-DR6c952D.js');
5
+ require('fs');
6
+ require('path');
7
+ require('child_process');
8
+
9
+ const fileName = `apollo-provider.tsx`;
10
+ const targetPath = fileHelper.findOrInitialsFile(`src/utils/${fileName}`);
11
+ const content = `'use client';
12
+
13
+ import { ReactNode } from 'react';
14
+
15
+ import cookies from 'js-cookie';
16
+ import { ApolloWrapper, GenerateMakeClient } from 'web-ggf/apollo-nextjs-wrapper';
17
+
18
+ import { HOST_CONFIG } from '@/configs/HOST_CONFIG';
19
+ import { STORE_KEY_CONFIG } from '@/configs/STORE_KEY_CONFIG';
20
+
21
+ export function ApolloProvider({ children }: { children: ReactNode }) {
22
+ return (
23
+ <ApolloWrapper
24
+ makeClient={() =>
25
+ new GenerateMakeClient({
26
+ host: HOST_CONFIG.host,
27
+ getToken: () => {
28
+ const user = cookies.get(STORE_KEY_CONFIG.USER_TOKEN);
29
+ const client = cookies.get(STORE_KEY_CONFIG.CLIENT_TOKEN);
30
+ return user || client || '-';
31
+ },
32
+ })
33
+ }
34
+ >
35
+ <>{children}</>
36
+ </ApolloWrapper>
37
+ );
38
+ }
39
+ `;
40
+ fileHelper.writeFileSyncWithLog({ targetPath, content, fileName });
41
+
42
+ npmInstall.npmInstall([
43
+ { name: '@apollo/client', version: '^4.1.6' },
44
+ { name: '@apollo/client-integration-nextjs', version: '^0.14.4' },
45
+ { name: 'rxjs', version: '^7.8.2' },
46
+ { name: 'graphql', version: '^16.13.1' },
47
+ { name: 'apollo-upload-client', version: '^19.0.0' },
48
+ { name: '@types/apollo-upload-client', version: '^19.0.0', dev: true },
49
+ ]);
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var child_process = require('child_process');
4
+
5
+ //
6
+ function npmInstall(dependencies) {
7
+ try {
8
+ for (const dep of dependencies) {
9
+ process.stdout.write(`⌛ Installing "${dep.name}"...`);
10
+ child_process.execSync(`npm i${dep.dev ? ' -D' : ''} ${dep.name}@${dep.version} --silent`, { stdio: 'ignore', cwd: process.cwd() });
11
+ process.stdout.write(`\r✅ Installed "${dep.name}@${dep.version}"\n`);
12
+ }
13
+ }
14
+ catch (error) {
15
+ console.error('❌ Failed to install dependencies:', error?.message);
16
+ process.exit(1);
17
+ }
18
+ }
19
+
20
+ exports.npmInstall = npmInstall;
@@ -1,11 +1,16 @@
1
1
  'use strict';
2
2
 
3
+ const init = process.argv[2];
4
+ console.warn('>>> , init >>>', init);
5
+ if (init !== 'nextjs' || !init) {
6
+ console.error('Invalid init. Usage: npx web-ggf nextjs');
7
+ process.exit(1);
8
+ }
3
9
  function main() {
4
- Promise.resolve().then(function () { return require('../_chunks/index-YUr8zBwz.cjs'); });
5
- Promise.resolve().then(function () { return require('../_chunks/index-CLUMH2P-.cjs'); });
6
- Promise.resolve().then(function () { return require('../_chunks/index-QBVsw3Et.cjs'); });
7
- Promise.resolve().then(function () { return require('../_chunks/index-DdjTuv1_.cjs'); });
8
- Promise.resolve().then(function () { return require('../_chunks/index-BT6h0oBH.cjs'); });
10
+ Promise.resolve().then(function () { return require('../_chunks/index-B6tEqrai.js'); });
11
+ Promise.resolve().then(function () { return require('../_chunks/index-DDL8vi6o.js'); });
12
+ Promise.resolve().then(function () { return require('../_chunks/index-BaQt8yVT.js'); });
13
+ Promise.resolve().then(function () { return require('../_chunks/index-m0G5jZTY.js'); });
14
+ Promise.resolve().then(function () { return require('../_chunks/index-CJwhB9ZM.js'); });
9
15
  }
10
16
  main();
11
- //# sourceMappingURL=index.cjs.map
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "web-ggf",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "type": "module",
9
9
  "bin": {
10
- "nextjs15": "./bin/nextjs15/index.cjs"
10
+ "nextjs15": "./bin/nextjs15/index.mjs"
11
11
  },
12
12
  "exports": {
13
13
  "./apollo-nextjs-client": {
@@ -32,7 +32,9 @@
32
32
  }
33
33
  },
34
34
  "files": [
35
- "dist"
35
+ "dist/",
36
+ "bin/",
37
+ "README.md"
36
38
  ],
37
39
  "sideEffects": false,
38
40
  "scripts": {
@@ -48,31 +50,33 @@
48
50
  "keywords": [],
49
51
  "author": "",
50
52
  "license": "ISC",
51
- "devDependencies": {
53
+ "dependencies": {
52
54
  "@apollo/client": "^4.1.6",
53
55
  "@apollo/client-integration-nextjs": "^0.14.4",
56
+ "cookie": "^1.1.1",
57
+ "apollo-upload-client": "^19.0.0",
58
+ "@types/js-cookie": "^3.0.6",
59
+ "graphql": "^16.13.1",
60
+ "js-cookie": "^3.0.5",
61
+ "next": "15.5.12",
62
+ "react": "^19.2.4",
63
+ "rxjs": "7.3.0",
64
+ "sonner": "^2.0.7"
65
+ },
66
+ "devDependencies": {
54
67
  "@rollup/plugin-commonjs": "^29.0.2",
55
68
  "@rollup/plugin-json": "^6.1.0",
56
69
  "@rollup/plugin-node-resolve": "^16.0.3",
57
70
  "@rollup/plugin-terser": "^1.0.0",
58
71
  "@rollup/plugin-typescript": "^12.3.0",
59
72
  "@types/apollo-upload-client": "^19.0.0",
60
- "@types/js-cookie": "^3.0.6",
61
- "apollo-upload-client": "^19.0.0",
62
- "cookie": "^1.1.1",
63
73
  "eslint": "^9.39.4",
64
74
  "eslint-config-sukedesu": "^2.1.1",
65
75
  "eslint-plugin-react": "^7.37.5",
66
76
  "globals": "^17.4.0",
67
- "graphql": "^16.13.1",
68
- "js-cookie": "^3.0.5",
69
- "next": "15.5.12",
70
- "react": "^19.2.4",
71
77
  "rollup": "^4.59.0",
72
78
  "rollup-plugin-peer-deps-external": "^2.2.4",
73
79
  "rollup-plugin-postcss": "^4.0.2",
74
- "rxjs": "7.3.0",
75
- "sonner": "^2.0.7",
76
80
  "vitest": "^4.1.0"
77
81
  }
78
82
  }