@ronas-it/nx-generators 0.15.0-alpha.3 → 0.15.0-alpha.5
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/README.md +22 -24
- package/package.json +1 -1
- package/src/generators/code-checks/config.d.ts +1 -1
- package/src/generators/code-checks/config.js +1 -1
- package/src/generators/code-checks/config.js.map +1 -1
- package/src/generators/form/utils/add-form-usage.js +6 -20
- package/src/generators/form/utils/add-form-usage.js.map +1 -1
- package/src/generators/react-component/files/component.tsx.template +1 -12
- package/src/generators/react-component/schema.d.ts +0 -1
- package/src/generators/react-component/schema.json +0 -6
- package/src/generators/react-lib/files/lib/component.tsx.template +2 -9
- package/src/generators/react-lib/generator.js +1 -6
- package/src/generators/react-lib/generator.js.map +1 -1
- package/src/generators/react-lib/schema.d.ts +0 -1
- package/src/generators/react-lib/schema.json +0 -4
- /package/src/generators/{code-checks/files → expo-app/app-files}/.gitignore.template +0 -0
package/README.md
CHANGED
|
@@ -28,12 +28,16 @@ The generators enforce several best practices according to [Nx concepts](https:/
|
|
|
28
28
|
|
|
29
29
|
1. Create monorepo with Expo app using [Nx Expo preset](https://nx.dev/nx-api/expo) or with Next.js app using [Nx Next preset](https://nx.dev/nx-api/next):
|
|
30
30
|
|
|
31
|
+
**Expo app:**
|
|
32
|
+
|
|
31
33
|
```sh
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
npx create-nx-workspace@latest my-project --preset=expo --appName=my-app --e2eTestRunner=none --unitTestRunner=none --formatter=prettier --linter=eslint --ci=skip
|
|
35
|
+
```
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
**Next.js app:**
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npx create-nx-workspace@latest my-project --preset=next --appName=my-app --nextAppDir=true --unitTestRunner=none --formatter=prettier --linter=eslint --nextSrcDir=false --style=scss --e2eTestRunner=none --ci=skip
|
|
37
41
|
```
|
|
38
42
|
|
|
39
43
|
2. Install this package:
|
|
@@ -44,25 +48,24 @@ npm i @ronas-it/nx-generators --save-dev
|
|
|
44
48
|
|
|
45
49
|
3. Run generators:
|
|
46
50
|
|
|
51
|
+
Configure workspace:
|
|
52
|
+
|
|
47
53
|
```sh
|
|
48
|
-
npx nx g repo-config
|
|
49
|
-
|
|
54
|
+
npx nx g repo-config && npx nx g code-checks
|
|
55
|
+
```
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
npx nx g expo-app
|
|
57
|
+
Then run app generators:
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
**Expo app:**
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
npx nx g expo-app
|
|
56
63
|
```
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
**Next.js app:**
|
|
59
66
|
|
|
60
67
|
```sh
|
|
61
|
-
|
|
62
|
-
npx nx g repo-config && npx nx g code-checks && npx nx g expo-app
|
|
63
|
-
|
|
64
|
-
# For Next.js app:
|
|
65
|
-
npx nx g repo-config && npx nx g code-checks && npx nx g next-app
|
|
68
|
+
npx nx g next-app
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
4. Start the app:
|
|
@@ -161,15 +164,12 @@ Generates a library according to [Nx notation](https://nx.dev/concepts/decisions
|
|
|
161
164
|
1. `withComponent` (optional) - generate the library with `lib/component.tsx` file.
|
|
162
165
|
This option is for `features` or `ui` library.
|
|
163
166
|
|
|
164
|
-
1. `withComponentForwardRef` (optional) - generate a component with `forwardRef` in `lib/component.tsx` file.
|
|
165
|
-
This option works if `withComponent` is `true`.
|
|
166
|
-
|
|
167
167
|
1. `dryRun` (optional) - generate the library without creating files
|
|
168
168
|
|
|
169
169
|
#### Example
|
|
170
170
|
|
|
171
171
|
```sh
|
|
172
|
-
npx nx g react-lib --app=mobile --scope=account --type=features --name=profile-settings --withComponent --
|
|
172
|
+
npx nx g react-lib --app=mobile --scope=account --type=features --name=profile-settings --withComponent --dryRun
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
or
|
|
@@ -260,18 +260,16 @@ Creates a React component in particular library.
|
|
|
260
260
|
|
|
261
261
|
2. `subcomponent` (optional) - generate a folder for components
|
|
262
262
|
|
|
263
|
-
3. `withForwardRef` (optional) - generate a component with forwardRef
|
|
264
|
-
|
|
265
263
|
#### Example
|
|
266
264
|
|
|
267
265
|
```sh
|
|
268
|
-
npx nx g react-component --name=AppButton --subcomponent
|
|
266
|
+
npx nx g react-component --name=AppButton --subcomponent
|
|
269
267
|
```
|
|
270
268
|
|
|
271
269
|
or
|
|
272
270
|
|
|
273
271
|
```sh
|
|
274
|
-
npx nx g react-component AppButton --subcomponent
|
|
272
|
+
npx nx g react-component AppButton --subcomponent
|
|
275
273
|
```
|
|
276
274
|
|
|
277
275
|
### 11. `form`
|
package/package.json
CHANGED
|
@@ -8,11 +8,11 @@ declare const _default: {
|
|
|
8
8
|
baseUrl: string;
|
|
9
9
|
rootDir: string;
|
|
10
10
|
sourceMap: boolean;
|
|
11
|
+
noEmit: boolean;
|
|
11
12
|
emitDecoratorMetadata: boolean;
|
|
12
13
|
experimentalDecorators: boolean;
|
|
13
14
|
jsx: string;
|
|
14
15
|
allowJs: boolean;
|
|
15
|
-
noEmit: boolean;
|
|
16
16
|
strict: boolean;
|
|
17
17
|
allowSyntheticDefaultImports: boolean;
|
|
18
18
|
noImplicitAny: boolean;
|
|
@@ -10,11 +10,11 @@ exports.default = {
|
|
|
10
10
|
baseUrl: '.',
|
|
11
11
|
rootDir: '.',
|
|
12
12
|
sourceMap: true,
|
|
13
|
+
noEmit: true,
|
|
13
14
|
emitDecoratorMetadata: true,
|
|
14
15
|
experimentalDecorators: true,
|
|
15
16
|
jsx: 'react-native',
|
|
16
17
|
allowJs: true,
|
|
17
|
-
noEmit: true,
|
|
18
18
|
strict: true,
|
|
19
19
|
allowSyntheticDefaultImports: true,
|
|
20
20
|
noImplicitAny: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/code-checks/config.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,aAAa,EAAE;QACb,YAAY,EAAE,+BAA+B;QAC7C,4BAA4B,EAAE,kBAAkB;QAChD,eAAe,EAAE,sBAAsB;KACxC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,GAAG;QACZ,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,IAAI;QACf,qBAAqB,EAAE,IAAI;QAC3B,sBAAsB,EAAE,IAAI;QAC5B,GAAG,EAAE,cAAc;QACnB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/code-checks/config.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,aAAa,EAAE;QACb,YAAY,EAAE,+BAA+B;QAC7C,4BAA4B,EAAE,kBAAkB;QAChD,eAAe,EAAE,sBAAsB;KACxC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,GAAG;QACZ,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;QACZ,qBAAqB,EAAE,IAAI;QAC3B,sBAAsB,EAAE,IAAI;QAC5B,GAAG,EAAE,cAAc;QACnB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,4BAA4B,EAAE,IAAI;QAClC,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,KAAK;QACnC,gBAAgB,EAAE,IAAI;KACvB;IACD,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,CAAC;CAClE,CAAC"}
|
|
@@ -11,23 +11,6 @@ const form = useForm({
|
|
|
11
11
|
resolver: yupResolver(${formClassName}.validationSchema)
|
|
12
12
|
});\n\n`;
|
|
13
13
|
}
|
|
14
|
-
function getForwardRefFunction(variable) {
|
|
15
|
-
const callExpressionInitializer = variable.getInitializerIfKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
16
|
-
const hasForwardRef = (callExpressionInitializer === null || callExpressionInitializer === void 0 ? void 0 : callExpressionInitializer.getExpression().getText()) === 'forwardRef';
|
|
17
|
-
if (!hasForwardRef) {
|
|
18
|
-
throw new Error('Could not find forwardRef');
|
|
19
|
-
}
|
|
20
|
-
const argument = callExpressionInitializer.getArguments()[0];
|
|
21
|
-
const hasComponentFunction = argument && [ts_morph_1.SyntaxKind.FunctionExpression, ts_morph_1.SyntaxKind.ArrowFunction].includes(argument.getKind());
|
|
22
|
-
if (!hasComponentFunction) {
|
|
23
|
-
throw new Error('Could not find a component function in forwardRef');
|
|
24
|
-
}
|
|
25
|
-
const functionExpression = argument.asKind(argument.getKind() === ts_morph_1.SyntaxKind.FunctionExpression ? ts_morph_1.SyntaxKind.FunctionExpression : ts_morph_1.SyntaxKind.ArrowFunction);
|
|
26
|
-
if (!functionExpression) {
|
|
27
|
-
throw new Error('Could not get a component function in forwardRef');
|
|
28
|
-
}
|
|
29
|
-
return functionExpression;
|
|
30
|
-
}
|
|
31
14
|
function getPlaceOfUse(file, placeOfUseName) {
|
|
32
15
|
const placeOfUseFunction = file.getFunction(placeOfUseName);
|
|
33
16
|
if (placeOfUseFunction) {
|
|
@@ -37,9 +20,12 @@ function getPlaceOfUse(file, placeOfUseName) {
|
|
|
37
20
|
if (!variable) {
|
|
38
21
|
throw new Error(`Could not find the place where the form should be used (${placeOfUseName}).`);
|
|
39
22
|
}
|
|
40
|
-
|
|
41
|
-
variable.getInitializerIfKind(ts_morph_1.SyntaxKind.ArrowFunction)
|
|
42
|
-
|
|
23
|
+
const initializer = variable.getInitializerIfKind(ts_morph_1.SyntaxKind.FunctionExpression) ||
|
|
24
|
+
variable.getInitializerIfKind(ts_morph_1.SyntaxKind.ArrowFunction);
|
|
25
|
+
if (!initializer) {
|
|
26
|
+
throw new Error(`The variable "${placeOfUseName}" is not a function.`);
|
|
27
|
+
}
|
|
28
|
+
return initializer;
|
|
43
29
|
}
|
|
44
30
|
function addFormUsage(libPath, placeOfUseName, formClassName) {
|
|
45
31
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-form-usage.js","sourceRoot":"","sources":["../../../../../../plugin/src/generators/form/utils/add-form-usage.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"add-form-usage.js","sourceRoot":"","sources":["../../../../../../plugin/src/generators/form/utils/add-form-usage.ts"],"names":[],"mappings":";;;;AAAA,uCASkB;AAClB,iDAAuD;AAEvD,SAAS,gBAAgB,CAAC,aAAqB;IAC7C,OAAO,0BAA0B,aAAa;;;0BAGtB,aAAa;QAC/B,CAAC;AACT,CAAC;AAED,SAAS,aAAa,CACpB,IAAgB,EAChB,cAAsB;IAEtB,MAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE5D,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAE7D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,2DAA2D,cAAc,IAAI,CAAC,CAAC;IACjG,CAAC;IAED,MAAM,WAAW,GACf,QAAQ,CAAC,oBAAoB,CAAC,qBAAU,CAAC,kBAAkB,CAAC;QAC5D,QAAQ,CAAC,oBAAoB,CAAC,qBAAU,CAAC,aAAa,CAAC,CAAC;IAE1D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,iBAAiB,cAAc,sBAAsB,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAsB,YAAY,CAAC,OAAe,EAAE,cAAsB,EAAE,aAAqB;;QAC/F,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;YAC1B,oBAA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
|
|
1
|
+
import React, {Fragment, ReactElement} from 'react';
|
|
2
2
|
|
|
3
3
|
interface <%= name %>Props {
|
|
4
4
|
// TODO: Describe props
|
|
5
|
-
<% if (withForwardRef) { %>
|
|
6
|
-
forwardedRef?: React.Ref<any>;
|
|
7
|
-
<% } %>
|
|
8
5
|
}
|
|
9
6
|
|
|
10
|
-
<% if (withForwardRef) { %>
|
|
11
|
-
export function <%= name %>(props: <%= name %>Props): ReactElement {
|
|
12
|
-
const refCallback = useRefCallback(props.forwardedRef);
|
|
13
|
-
// TODO: Implement component
|
|
14
|
-
return <Fragment ref={refCallback} />;
|
|
15
|
-
}
|
|
16
|
-
<% } else { %>
|
|
17
7
|
export function <%= name %>(props: <%= name %>Props): ReactElement {
|
|
18
8
|
// TODO: Implement component
|
|
19
9
|
return <Fragment />;
|
|
20
10
|
}
|
|
21
|
-
<% } %>
|
|
@@ -19,12 +19,6 @@
|
|
|
19
19
|
"description": "Generate a folder for components",
|
|
20
20
|
"default": false,
|
|
21
21
|
"x-prompt": "Generate component inside components folder?"
|
|
22
|
-
},
|
|
23
|
-
"withForwardRef": {
|
|
24
|
-
"type": "boolean",
|
|
25
|
-
"description": "Generate a component with forwardRef",
|
|
26
|
-
"default": false,
|
|
27
|
-
"x-prompt": "Generate component with forwardRef?"
|
|
28
22
|
}
|
|
29
23
|
},
|
|
30
24
|
"required": ["name"]
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {Fragment, ReactElement} from 'react';
|
|
2
2
|
|
|
3
3
|
interface <%= name %>Props {
|
|
4
4
|
// TODO: Describe props
|
|
5
|
-
<% if (withComponentForwardRef) { %>
|
|
6
|
-
forwardedRef?: React.Ref<any>;
|
|
7
|
-
<% } %>
|
|
8
5
|
}
|
|
9
6
|
|
|
10
7
|
export function <%= name %>(props: <%= name %>Props): ReactElement {
|
|
11
|
-
<% if (withComponentForwardRef) { %>
|
|
12
|
-
const refCallback = useRefCallback(props.forwardedRef);
|
|
13
|
-
<% } %>
|
|
14
|
-
|
|
15
8
|
// TODO: Implement component
|
|
16
|
-
return <Fragment
|
|
9
|
+
return <Fragment />;
|
|
17
10
|
}
|
|
@@ -27,9 +27,6 @@ function reactLibGenerator(tree, options) {
|
|
|
27
27
|
if ([utils_1.LibraryType.FEATURES, utils_1.LibraryType.UI].includes(options.type) &&
|
|
28
28
|
!(0, lodash_1.isBoolean)(options.withComponent)) {
|
|
29
29
|
options.withComponent = yield (0, utils_1.confirm)('Generate component inside lib folder?');
|
|
30
|
-
if (options.withComponent && !(0, lodash_1.isBoolean)(options.withComponentForwardRef)) {
|
|
31
|
-
options.withComponentForwardRef = yield (0, utils_1.confirm)('Generate component with forwardRef?');
|
|
32
|
-
}
|
|
33
30
|
}
|
|
34
31
|
const scopeTag = options.scope || utils_1.constants.sharedValue;
|
|
35
32
|
const tags = [`app:${options.app}`, `scope:${scopeTag}`, `type:${options.type}`];
|
|
@@ -45,10 +42,8 @@ function reactLibGenerator(tree, options) {
|
|
|
45
42
|
if (options.withComponent) {
|
|
46
43
|
const srcPath = `${libPath}/src`;
|
|
47
44
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), srcPath, Object.assign(Object.assign({}, options), { name: (0, utils_1.formatName)(options.name, true) }));
|
|
48
|
-
tree.write(`${srcPath}/index.ts`,
|
|
45
|
+
tree.write(`${srcPath}/index.ts`, `export * from './lib';`);
|
|
49
46
|
}
|
|
50
|
-
//Remove unnecessary tsconfig.lib.json
|
|
51
|
-
tree.delete(`${libPath}/tsconfig.lib.json`);
|
|
52
47
|
(0, utils_1.addNxScopeTag)(tree, scopeTag);
|
|
53
48
|
yield (0, devkit_1.formatFiles)(tree);
|
|
54
49
|
if (libDirectoryName !== options.name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../plugin/src/generators/react-lib/generator.ts"],"names":[],"mappings":";;;;AAAA,iDAAyC;AACzC,6BAA6B;AAC7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,GAAG,OAAO,MAAM,CAAC;YACjC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,kCAAO,OAAO,KAAE,IAAI,EAAE,IAAA,kBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAG,CAAC;YAClH,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,WAAW,EAAE,wBAAwB,CAAC,CAAC;QAC9D,CAAC;QAED,IAAA,qBAAa,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE9B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,gBAAgB,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;YACtC,eAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,wCAAwC,eAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,iDAAiD;aAC9H,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CAAA;AAzDD,8CAyDC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -29,10 +29,6 @@
|
|
|
29
29
|
"type": "boolean",
|
|
30
30
|
"description": "Generate the library with 'lib/component.tsx' file"
|
|
31
31
|
},
|
|
32
|
-
"withComponentForwardRef": {
|
|
33
|
-
"type": "boolean",
|
|
34
|
-
"description": "Generate a component with forwardRef in 'lib/component.tsx' file"
|
|
35
|
-
},
|
|
36
32
|
"dryRun": {
|
|
37
33
|
"type": "boolean",
|
|
38
34
|
"description": "Generate the library without creating files",
|
|
File without changes
|