xml-model 1.1.1 → 1.2.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/README.md +1 -0
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +2 -1
- package/package.json +2 -2
- package/vite/dist/index.d.ts +7 -0
- package/vite/dist/index.js +3 -2
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ import XMLModelVitePlugin from "xml-model/vite";
|
|
|
13
13
|
export default defineConfig({
|
|
14
14
|
plugins: [
|
|
15
15
|
// see options in JSDoc
|
|
16
|
+
// note that is tsconfig that includes your source files is not tsconfig.json you MUST use the tsconfig option
|
|
16
17
|
XMLModelVitePlugin(),
|
|
17
18
|
],
|
|
18
19
|
// ... rest of the config
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Constructor } from 'typescript-rtti';
|
|
2
2
|
import { XMLModelOptions, XMLModelPropertyOptions, CreateXMLModelOptions } from './types';
|
|
3
3
|
import { XMLRoot } from '../types';
|
|
4
|
+
export declare function getParentModel(model: XMLModel<any>): XMLModel<any>;
|
|
4
5
|
export declare class XMLModel<T = any> {
|
|
5
6
|
readonly type: Constructor<T>;
|
|
6
7
|
options: XMLModelOptions<T>;
|
package/dist/model/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xml-model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "allows transparent XML <-> Object conversion in typescript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MathisTLD",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"preversion": "npm test",
|
|
24
|
+
"preversion": "npm test -- --run",
|
|
25
25
|
"version": "npm run build",
|
|
26
26
|
"postversion": "git push && git push --tags",
|
|
27
27
|
"build": "vite build",
|
package/vite/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
+
import { RollupTypescriptOptions } from '@rollup/plugin-typescript';
|
|
2
3
|
/**
|
|
3
4
|
* When Building, class names are changed but the library relies on them
|
|
4
5
|
* so they need to be preserved
|
|
@@ -6,6 +7,12 @@ import { Plugin } from 'vite';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function FixClassNames(): Plugin;
|
|
8
9
|
type RTTIPluginOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* options for @rollup/plugin-typescript
|
|
12
|
+
*
|
|
13
|
+
* Plugin might not work if you override the `transformers` property as these options are assigned and not deep merged
|
|
14
|
+
*/
|
|
15
|
+
typescript?: RollupTypescriptOptions;
|
|
9
16
|
/** Files where the rtti transformer should be applied
|
|
10
17
|
*
|
|
11
18
|
* If not set, will include every files by default
|
package/vite/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ function FixClassNames() {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function TypescriptRTTI(options = {}) {
|
|
24
|
-
const { include, exclude, debug = false } = options;
|
|
24
|
+
const { typescript: rollupPluginTypescriptOptions, include, exclude, debug = false } = options;
|
|
25
25
|
const doTransform = !include && !exclude ? () => true : (path) => {
|
|
26
26
|
if (exclude?.test(path)) return false;
|
|
27
27
|
return include ? include.test(path) : true;
|
|
@@ -48,7 +48,8 @@ function TypescriptRTTI(options = {}) {
|
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
50
|
// set declaration to `false` to let plugin dts handle the declarations
|
|
51
|
-
declaration: false
|
|
51
|
+
declaration: false,
|
|
52
|
+
...rollupPluginTypescriptOptions
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
function XMLModelVitePlugin(options = {}) {
|