@ronas-it/nx-generators 0.3.7 → 0.4.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/generators.json +5 -0
- package/package.json +1 -1
- package/src/generators/expo-app/files/app.config.ts.template +1 -1
- package/src/generators/expo-app/generator.js +2 -1
- package/src/generators/expo-app/generator.js.map +1 -1
- package/src/generators/expo-app/schema.d.ts +0 -1
- package/src/generators/next-app/files/.env.development.template +1 -0
- package/src/generators/next-app/files/.env.production.template +1 -0
- package/src/generators/next-app/files/.env.template +1 -0
- package/src/generators/next-app/files/README.md.template +39 -0
- package/src/generators/next-app/files/app/[locale]/layout.tsx.template +48 -0
- package/src/generators/next-app/files/app/[locale]/page.tsx.template +18 -0
- package/src/generators/next-app/files/app/[locale]/providers.tsx.template +16 -0
- package/src/generators/next-app/files/constants.ts.template +11 -0
- package/src/generators/next-app/files/i18n/en.json.template +5 -0
- package/src/generators/next-app/files/i18n.ts.template +13 -0
- package/src/generators/next-app/files/middleware.ts.template +12 -0
- package/src/generators/next-app/files/next.config.js.template +19 -0
- package/src/generators/next-app/generator.d.ts +4 -0
- package/src/generators/next-app/generator.js +49 -0
- package/src/generators/next-app/generator.js.map +1 -0
- package/src/generators/next-app/schema.d.ts +4 -0
- package/src/generators/next-app/schema.json +27 -0
- package/src/generators/react-component/schema.d.ts +0 -2
- package/src/generators/react-lib/schema.d.ts +0 -1
- package/src/shared/utils/format-utils.d.ts +1 -0
- package/src/shared/utils/format-utils.js +3 -1
- package/src/shared/utils/format-utils.js.map +1 -1
package/generators.json
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"schema": "./src/generators/expo-app/schema.json",
|
|
11
11
|
"description": "expo-app generator"
|
|
12
12
|
},
|
|
13
|
+
"next-app": {
|
|
14
|
+
"factory": "./src/generators/next-app/generator",
|
|
15
|
+
"schema": "./src/generators/next-app/schema.json",
|
|
16
|
+
"description": "next-app generator"
|
|
17
|
+
},
|
|
13
18
|
"repo-config": {
|
|
14
19
|
"factory": "./src/generators/repo-config/generator",
|
|
15
20
|
"schema": "./src/generators/repo-config/schema.json",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { EASConfig } from 'expo-constants/build/Constants.types';
|
|
|
4
4
|
const createConfig = (): Omit<ExpoConfig, 'extra'> & { extra: { eas: EASConfig } & typeof extra } => {
|
|
5
5
|
const projectId = '';
|
|
6
6
|
|
|
7
|
-
const appId = 'com.<%= name %>.dev';
|
|
7
|
+
const appId = 'com.<%= formatAppIdentifier(name) %>.dev';
|
|
8
8
|
|
|
9
9
|
const extra = {
|
|
10
10
|
eas: { projectId } as EASConfig,
|
|
@@ -46,7 +46,8 @@ function expoAppGenerator(tree, options) {
|
|
|
46
46
|
appPackageJson.scripts = Object.assign(Object.assign({}, scripts_1.default), appPackageJson.scripts);
|
|
47
47
|
(0, devkit_1.writeJson)(tree, appPackagePath, appPackageJson);
|
|
48
48
|
// Add app files
|
|
49
|
-
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), appRoot, Object.assign(Object.assign({}, options), { formatName: utils_1.formatName
|
|
49
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), appRoot, Object.assign(Object.assign({}, options), { formatName: utils_1.formatName,
|
|
50
|
+
formatAppIdentifier: utils_1.formatAppIdentifier }));
|
|
50
51
|
// Add dependencies
|
|
51
52
|
(0, devkit_1.addDependenciesToPackageJson)(tree, Object.assign(Object.assign({}, dependencies), {
|
|
52
53
|
// Need new version to fix this error:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/expo-app/generator.ts"],"names":[],"mappings":";;;;AAAA,iDAAyC;AACzC,6BAA6B;AAC7B,uCAQoB;AAEpB,uCAAgC;AAChC,2BAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/expo-app/generator.ts"],"names":[],"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,4CAqEC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NEXT_PUBLIC_APP_ENV=development
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NEXT_PUBLIC_APP_ENV=production
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NEXT_PUBLIC_APP_ENV=development
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# <%= formatName(name) %> - Next.js app
|
|
2
|
+
|
|
3
|
+
This is a web app built with Next.js.
|
|
4
|
+
|
|
5
|
+
## Tasks overview
|
|
6
|
+
|
|
7
|
+
You can run tasks for this project with:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx nx <task-name> <%= name %>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
To view the list of available tasks, run:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npx nx show project <%= name %> --web
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The following tasks are included by default:
|
|
20
|
+
|
|
21
|
+
- `dev` – Start the local development server.
|
|
22
|
+
- `build` – Create a production build.
|
|
23
|
+
- `start` – Create and start a production build.
|
|
24
|
+
- `lint` – Check the source code with `eslint`.
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
To run this application locally, follow these steps:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
# 1. Navigate to Nx workspace directory containing this app
|
|
32
|
+
cd <path-to-nx-workspace>
|
|
33
|
+
|
|
34
|
+
# 2. Install dependencies
|
|
35
|
+
npm install
|
|
36
|
+
|
|
37
|
+
# 3. Start the local development server
|
|
38
|
+
npx nx dev <%= name %>
|
|
39
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { constants, Locale } from '../../constants';
|
|
2
|
+
import { notFound } from 'next/navigation';
|
|
3
|
+
import { unstable_setRequestLocale } from 'next-intl/server';
|
|
4
|
+
import { ReactElement, ReactNode } from 'react';
|
|
5
|
+
import { Providers } from './providers';
|
|
6
|
+
|
|
7
|
+
export const metadata = {
|
|
8
|
+
title: '<%= formatName(name) %>',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface RootLayoutProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
params: { locale: Locale };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const locales = constants.locales;
|
|
17
|
+
|
|
18
|
+
export const generateStaticParams = (): Array<{ locale: Locale }> =>
|
|
19
|
+
locales.map((locale) => ({ locale }));
|
|
20
|
+
|
|
21
|
+
export default function RootLayout({
|
|
22
|
+
children,
|
|
23
|
+
params: { locale },
|
|
24
|
+
}: RootLayoutProps): ReactElement {
|
|
25
|
+
if (!locales.includes(locale)) {
|
|
26
|
+
notFound();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
unstable_setRequestLocale(locale);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<html lang={locale}>
|
|
33
|
+
<head>
|
|
34
|
+
<meta
|
|
35
|
+
name="robots"
|
|
36
|
+
content={
|
|
37
|
+
process.env.NEXT_PUBLIC_APP_ENV === 'production'
|
|
38
|
+
? 'index'
|
|
39
|
+
: 'noindex'
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
</head>
|
|
43
|
+
<body>
|
|
44
|
+
<Providers>{children}</Providers>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Locale } from '../../constants';
|
|
3
|
+
import { unstable_setRequestLocale } from 'next-intl/server';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
|
|
6
|
+
export interface IndexPageProps {
|
|
7
|
+
params: { locale: Locale };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function Index({
|
|
11
|
+
params: { locale },
|
|
12
|
+
}: IndexPageProps): ReactElement {
|
|
13
|
+
unstable_setRequestLocale(locale);
|
|
14
|
+
|
|
15
|
+
const t = useTranslations('HOME_PAGE');
|
|
16
|
+
|
|
17
|
+
return <div>{t('HOME_PAGE_TEXT')}</div>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { NextIntlClientProvider, useMessages } from 'next-intl';
|
|
3
|
+
|
|
4
|
+
export function Providers({
|
|
5
|
+
children,
|
|
6
|
+
}: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): ReactElement {
|
|
9
|
+
const messages = useMessages();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<NextIntlClientProvider messages={messages}>
|
|
13
|
+
{children}
|
|
14
|
+
</NextIntlClientProvider>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { notFound } from 'next/navigation';
|
|
2
|
+
import { getRequestConfig } from 'next-intl/server';
|
|
3
|
+
import { constants, Locale } from './constants';
|
|
4
|
+
|
|
5
|
+
export default getRequestConfig(async ({ locale }) => {
|
|
6
|
+
if (!constants.locales.includes(locale as Locale)) {
|
|
7
|
+
notFound();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
messages: (await import(`./i18n/${locale}.json`)).default,
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { constants } from './constants';
|
|
2
|
+
import createMiddleware from 'next-intl/middleware';
|
|
3
|
+
|
|
4
|
+
export default createMiddleware({
|
|
5
|
+
locales: constants.locales,
|
|
6
|
+
defaultLocale: constants.defaultLocale,
|
|
7
|
+
localePrefix: 'never',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const config = {
|
|
11
|
+
matcher: ['/((?!api|_next|.*\\..*).*)'],
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { withNx } = require('@nrwl/next/plugins/with-nx');
|
|
2
|
+
const withNextIntl = require('next-intl/plugin')();
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
6
|
+
**/
|
|
7
|
+
const nextConfig = {
|
|
8
|
+
nx: {
|
|
9
|
+
// Set this to true if you would like to use SVGR
|
|
10
|
+
// See: https://github.com/gregberge/svgr
|
|
11
|
+
svgr: false,
|
|
12
|
+
},
|
|
13
|
+
output: 'standalone',
|
|
14
|
+
async redirects() {
|
|
15
|
+
return [];
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
module.exports = withNx(withNextIntl(nextConfig));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nextAppGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const utils_1 = require("../../shared/utils");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const dependencies = {
|
|
11
|
+
'next-intl': '^3.17.2',
|
|
12
|
+
};
|
|
13
|
+
function nextAppGenerator(tree, options) {
|
|
14
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const appRoot = `apps/${options.directory}`;
|
|
16
|
+
// Install @nx/next plugin
|
|
17
|
+
(0, child_process_1.execSync)('npx nx add @nx/next', { stdio: 'inherit' });
|
|
18
|
+
if (!(0, fs_1.existsSync)(appRoot)) {
|
|
19
|
+
(0, child_process_1.execSync)(`npx nx g @nx/next:app ${options.name} --directory=apps/${options.directory} --projectNameAndRootFormat=as-provided --appDir=true --style=scss --src=false --unitTestRunner=none --e2eTestRunner=none`, { stdio: 'inherit' });
|
|
20
|
+
}
|
|
21
|
+
// Remove unnecessary files and files that will be replaced
|
|
22
|
+
tree.delete(`${appRoot}/public/.gitkeep`);
|
|
23
|
+
tree.delete(`${appRoot}/app/api`);
|
|
24
|
+
tree.delete(`${appRoot}/app/page.tsx`);
|
|
25
|
+
tree.delete(`${appRoot}/app/page.module.scss`);
|
|
26
|
+
tree.delete(`${appRoot}/app/global.css`);
|
|
27
|
+
tree.delete(`${appRoot}/app/layout.tsx`);
|
|
28
|
+
tree.delete(`${appRoot}/.eslintrc.json`);
|
|
29
|
+
// Update app tsconfig.json to skip automatic reconfiguration during the first application run
|
|
30
|
+
const appTsconfigPath = `${appRoot}/tsconfig.json`;
|
|
31
|
+
const appTsconfigJson = (0, devkit_1.readJson)(tree, appTsconfigPath);
|
|
32
|
+
const nextTypesInclude = '.next/types/**/*.ts';
|
|
33
|
+
if (!appTsconfigJson.include.includes(nextTypesInclude)) {
|
|
34
|
+
appTsconfigJson.include.push(nextTypesInclude);
|
|
35
|
+
(0, devkit_1.writeJson)(tree, appTsconfigPath, appTsconfigJson);
|
|
36
|
+
}
|
|
37
|
+
// Add app files
|
|
38
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), appRoot, Object.assign(Object.assign({}, options), { formatName: utils_1.formatName }));
|
|
39
|
+
// Add dependencies
|
|
40
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, {});
|
|
41
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
42
|
+
return () => {
|
|
43
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.nextAppGenerator = nextAppGenerator;
|
|
48
|
+
exports.default = nextAppGenerator;
|
|
49
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/next-app/generator.ts"],"names":[],"mappings":";;;;AAAA,iDAAyC;AACzC,uCAQoB;AAEpB,2BAAgC;AAChC,8CAAgD;AAChD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C,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/C,IAAA,kBAAS,EAAC,IAAI,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QACpD,CAAC;QAED,gBAAgB;QAChB,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,kCACrD,OAAO,KACV,UAAU,EAAV,kBAAU,IACV,CAAC;QAEH,mBAAmB;QACnB,IAAA,qCAA4B,EAAC,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;QAErD,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AAjDD,4CAiDC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NextApp",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Enter the name of the app (e.g: my-app)"
|
|
15
|
+
},
|
|
16
|
+
"directory": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "Enter the name of the directory in the 'apps/' folder (e.g: web)"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": ["name", "directory"]
|
|
27
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const formatName: (value: string, withoutSpaces?: boolean) => string;
|
|
2
|
+
export declare const formatAppIdentifier: (value: string) => string;
|
|
2
3
|
export declare const getProjectName: (str: string) => string;
|
|
3
4
|
export declare const getLibName: (path: string) => string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLibName = exports.getProjectName = exports.formatName = void 0;
|
|
3
|
+
exports.getLibName = exports.getProjectName = exports.formatAppIdentifier = exports.formatName = void 0;
|
|
4
4
|
const formatName = (value, withoutSpaces = false) => value
|
|
5
5
|
.split('-')
|
|
6
6
|
.map((word) => `${word.charAt(0).toUpperCase()}${word.substring(1)}`)
|
|
7
7
|
.join(withoutSpaces ? '' : ' ');
|
|
8
8
|
exports.formatName = formatName;
|
|
9
|
+
const formatAppIdentifier = (value) => value.toLowerCase().replace(/-/g, '.');
|
|
10
|
+
exports.formatAppIdentifier = formatAppIdentifier;
|
|
9
11
|
const getProjectName = (str) => {
|
|
10
12
|
const parts = str.split('@');
|
|
11
13
|
return parts.length > 1 ? parts[1].split('/')[0] : parts[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-utils.js","sourceRoot":"","sources":["../../../../../plugin/src/shared/utils/format-utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,aAAa,GAAG,KAAK,EAAE,EAAE,CACjE,KAAK;KACF,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAJvB,QAAA,UAAU,cAIa;AAE7B,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,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