@gadmin2n/prisma-react-generator 0.0.35 → 0.0.37
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 +38 -0
- package/dist/generator/generate-create-page.js +1 -1
- package/dist/generator/generate-edit-page.js +1 -1
- package/dist/generator/generate-list-page.js +2 -2
- package/dist/generator/generate-model-props.js +1 -1
- package/dist/generator/generate-show-page.js +1 -1
- package/dist/generator/generate-ui-config.js +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [1.4.1] - 2021-10-08
|
|
9
|
+
|
|
10
|
+
- upgrades prisma dependencies to their latest 3.x versions
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Generated code imports using \ instead of / ([#10](https://github.com/vegardit/prisma-generator-nestjs-dto/issues/10))
|
|
19
|
+
|
|
20
|
+
## [1.4.0] - 2021-09-24
|
|
21
|
+
|
|
22
|
+
- upgrades prisma dependencies to their latest 3.x versions
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
## [1.3.1] - 2021-09-24
|
|
31
|
+
|
|
32
|
+
- applies available minor and patch updates to dependencies
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
handleOnFinish,
|
|
15
15
|
ModelType,
|
|
16
16
|
produceModel,
|
|
17
|
-
} from '@
|
|
17
|
+
} from '@gadmin2n/react-common';
|
|
18
18
|
import { Create, useFileUploadState, useForm } from "@refinedev/antd";
|
|
19
19
|
import { Form } from "antd";
|
|
20
20
|
import { IResourceComponentsProps, useApiUrl, useTranslate } from "@refinedev/core";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
handleOnFinish,
|
|
15
15
|
ModelType,
|
|
16
16
|
produceModel,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@gadmin2n/react-common";
|
|
18
18
|
import { Edit, ListButton, RefreshButton, useFileUploadState, useForm } from "@refinedev/antd";
|
|
19
19
|
import { Form } from "antd";
|
|
20
20
|
import { IResourceComponentsProps, useApiUrl, useParsed, useTranslate } from "@refinedev/core";
|
|
@@ -10,7 +10,7 @@ const generateListPage = ({ model, templateHelpers: t, uiConfig, allModels, }) =
|
|
|
10
10
|
/**
|
|
11
11
|
* ${model.name} List Page
|
|
12
12
|
*
|
|
13
|
-
* Generated using simplified pattern with @
|
|
13
|
+
* Generated using simplified pattern with @gadmin2n/react-common hooks and components.
|
|
14
14
|
*
|
|
15
15
|
* Flexibility Levels:
|
|
16
16
|
* 1. Basic usage - Use components with defaults (this file)
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
ModelType,
|
|
38
38
|
produceModel,
|
|
39
39
|
tableSearchBar,
|
|
40
|
-
} from '@
|
|
40
|
+
} from '@gadmin2n/react-common';
|
|
41
41
|
|
|
42
42
|
// Generated imports
|
|
43
43
|
import { modelsEnum, modelsMap } from 'generated/models.index';
|
|
@@ -7,7 +7,7 @@ const helpers_1 = require("./helpers");
|
|
|
7
7
|
const generateModelProps = ({ dmmf, model, templateHelpers: t, uiConfig, allModels, }) => {
|
|
8
8
|
const instanceName = (0, case_1.camel)(model.name);
|
|
9
9
|
return `
|
|
10
|
-
import { ModelsFieldsTypeMap, ModelType } from "@
|
|
10
|
+
import { ModelsFieldsTypeMap, ModelType } from "@gadmin2n/react-common";
|
|
11
11
|
import { useSelect } from "@refinedev/antd";
|
|
12
12
|
${t.each(dmmf.datamodel.models, (model) => `import type { ${model.name} } from '../../types/prisma.types';`, '\n')}
|
|
13
13
|
import { modelsMap } from '../../models.index';
|
|
@@ -6,7 +6,7 @@ const fs = require("fs");
|
|
|
6
6
|
const generatePageShow = ({ model, templateHelpers: t, uiConfig, allModels, }) => {
|
|
7
7
|
const instanceName = (0, case_1.camel)(model.name);
|
|
8
8
|
return `
|
|
9
|
-
import { ModelType, getColumns, produceModel } from "@
|
|
9
|
+
import { ModelType, getColumns, produceModel } from "@gadmin2n/react-common";
|
|
10
10
|
import { CloneButton, DeleteButton, EditButton, ListButton, RefreshButton, Show } from "@refinedev/antd";
|
|
11
11
|
import { IResourceComponentsProps, useShow, useTranslate } from "@refinedev/core";
|
|
12
12
|
import React, { useState } from "react";
|
|
@@ -81,7 +81,19 @@ function loadConfigFromDirectory(allModels, enums = []) {
|
|
|
81
81
|
console.log(`Created new config file: config/ui/${model.name}.ts`);
|
|
82
82
|
});
|
|
83
83
|
console.log('Compile UI config files ...');
|
|
84
|
-
const
|
|
84
|
+
const tempTsConfig = {
|
|
85
|
+
compilerOptions: {
|
|
86
|
+
moduleResolution: 'node',
|
|
87
|
+
esModuleInterop: true,
|
|
88
|
+
outDir: '.',
|
|
89
|
+
},
|
|
90
|
+
include: ['./*.ts'],
|
|
91
|
+
exclude: ['./*.d.ts'],
|
|
92
|
+
};
|
|
93
|
+
const tempTsConfigPath = path.join(configDirAbs, '_tsconfig.tmp.json');
|
|
94
|
+
fs.writeFileSync(tempTsConfigPath, JSON.stringify(tempTsConfig, null, 2));
|
|
95
|
+
const { code } = shell.cd(configDirAbs).exec('tsc -p _tsconfig.tmp.json');
|
|
96
|
+
fs.unlinkSync(tempTsConfigPath);
|
|
85
97
|
if (code !== 0) {
|
|
86
98
|
shell.cd('../../server');
|
|
87
99
|
process.exit(code);
|
package/package.json
CHANGED