@aatulwork/customform-renderer 1.4.0 → 1.6.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.
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ // src/vite-plugin.ts
6
+ var PACKAGE_NAME = "@aatulwork/customform-renderer";
7
+ function customformRendererVite(options = {}) {
8
+ const { excludeCkeditorFromOptimize = true } = options;
9
+ return {
10
+ name: "vite-plugin-customform-renderer",
11
+ config(config, _env) {
12
+ const optimizeDeps = config.optimizeDeps ?? {};
13
+ const include = Array.isArray(optimizeDeps.include) ? [...optimizeDeps.include] : [];
14
+ if (!include.includes(PACKAGE_NAME)) {
15
+ include.push(PACKAGE_NAME);
16
+ }
17
+ const exclude = Array.isArray(optimizeDeps.exclude) ? [...optimizeDeps.exclude] : [];
18
+ if (excludeCkeditorFromOptimize) {
19
+ const ckEditorPath = `${PACKAGE_NAME}/lib/ckeditor/ckeditor.js`;
20
+ if (!exclude.includes(ckEditorPath)) {
21
+ exclude.push(ckEditorPath);
22
+ }
23
+ }
24
+ const ssr = config.ssr ?? {};
25
+ const noExternal = ssr.noExternal;
26
+ const noExternalList = Array.isArray(noExternal) ? [...noExternal] : noExternal === true ? true : [PACKAGE_NAME];
27
+ if (Array.isArray(noExternalList) && !noExternalList.includes(PACKAGE_NAME)) {
28
+ noExternalList.push(PACKAGE_NAME);
29
+ }
30
+ return {
31
+ ...config,
32
+ optimizeDeps: {
33
+ ...optimizeDeps,
34
+ include,
35
+ ...exclude.length > 0 ? { exclude } : {}
36
+ },
37
+ ssr: {
38
+ ...ssr,
39
+ noExternal: noExternalList
40
+ }
41
+ };
42
+ }
43
+ };
44
+ }
45
+ var vite_plugin_default = customformRendererVite;
46
+
47
+ exports.customformRendererVite = customformRendererVite;
48
+ exports.default = vite_plugin_default;
49
+ //# sourceMappingURL=vite-plugin.js.map
50
+ //# sourceMappingURL=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ACb,IAAA,GACA,CAAC,YAAY,CAAA;AACnB,MAAA,IAAI,KAAA,CAAM,QAAQ,cAAc,CAAA,IAAK,CAAC,cAAA,CAAe,QAAA,CAAS,YAAY,CAAA,EAAG;AAC3E,QAAA,cAAA,CAAe,KAAK,YAAY,CAAA;AAAA,MAClC;AAEA,MAAA,OAAO;AAAA,QACL,GAAG,MAAA;AAAA,QACH,YAAA,EAAc;AAAA,UACZ,GAAG,YAAA;AAAA,UACH,OAAA;AAAA,UACA,GAAI,OAAA,CAAQ,MAAA,GAAS,IAAI,EAAE,OAAA,KAAY;AAAC,SAC1C;AAAA,QACA,GAAA,EAAK;AAAA,UACH,GAAG,GAAA;AAAA,UACH,UAAA,EAAY;AAAA;AACd,OACF;AAAA,IACF;AAAA,GACF;AACF;AAEA,IAAO,mBAAA,GAAQ","file":"vite-plugin.js","sourcesContent":["/**\r\n * Optional Vite plugin for @aatulwork/customform-renderer.\r\n * Use only if you need SSR or dependency optimization workarounds (e.g. \"module not found\" in SSR).\r\n * With the package's fixed exports, most Vite projects work with zero config.\r\n */\r\nimport type { Plugin, UserConfig, ConfigEnv } from 'vite';\r\n\r\nconst PACKAGE_NAME = '@aatulwork/customform-renderer';\r\n\r\nexport interface CustomFormRendererVitePluginOptions {\r\n /** Exclude CKEditor script from pre-bundling (default: true). Set false if you load CKEditor via HTML only. */\r\n excludeCkeditorFromOptimize?: boolean;\r\n}\r\n\r\n/**\r\n * Vite plugin that applies recommended settings for @aatulwork/customform-renderer:\r\n * - optimizeDeps.include: pre-bundle the package for faster dev startup\r\n * - ssr.noExternal: bundle the package in SSR instead of externalizing it\r\n * - optimizeDeps.exclude: optionally exclude the package's CKEditor build from pre-bundling\r\n *\r\n * Usage in vite.config.ts:\r\n * import { customformRendererVite } from '@aatulwork/customform-renderer/vite';\r\n * export default defineConfig({\r\n * plugins: [react(), customformRendererVite()],\r\n * });\r\n */\r\nexport function customformRendererVite(options: CustomFormRendererVitePluginOptions = {}): Plugin {\r\n const { excludeCkeditorFromOptimize = true } = options;\r\n\r\n return {\r\n name: 'vite-plugin-customform-renderer',\r\n config(config: UserConfig, _env: ConfigEnv) {\r\n const optimizeDeps = config.optimizeDeps ?? {};\r\n const include = Array.isArray(optimizeDeps.include) ? [...optimizeDeps.include] : [];\r\n if (!include.includes(PACKAGE_NAME)) {\r\n include.push(PACKAGE_NAME);\r\n }\r\n const exclude = Array.isArray(optimizeDeps.exclude) ? [...optimizeDeps.exclude] : [];\r\n if (excludeCkeditorFromOptimize) {\r\n const ckEditorPath = `${PACKAGE_NAME}/lib/ckeditor/ckeditor.js`;\r\n if (!exclude.includes(ckEditorPath)) {\r\n exclude.push(ckEditorPath);\r\n }\r\n }\r\n const ssr = config.ssr ?? {};\r\n const noExternal = ssr.noExternal;\r\n const noExternalList = Array.isArray(noExternal)\r\n ? [...noExternal]\r\n : noExternal === true\r\n ? true\r\n : [PACKAGE_NAME];\r\n if (Array.isArray(noExternalList) && !noExternalList.includes(PACKAGE_NAME)) {\r\n noExternalList.push(PACKAGE_NAME);\r\n }\r\n\r\n return {\r\n ...config,\r\n optimizeDeps: {\r\n ...optimizeDeps,\r\n include,\r\n ...(exclude.length > 0 ? { exclude } : {}),\r\n },\r\n ssr: {\r\n ...ssr,\r\n noExternal: noExternalList,\r\n },\r\n };\r\n },\r\n };\r\n}\r\n\r\nexport default customformRendererVite;\r\n"]}
@@ -0,0 +1,45 @@
1
+ // src/vite-plugin.ts
2
+ var PACKAGE_NAME = "@aatulwork/customform-renderer";
3
+ function customformRendererVite(options = {}) {
4
+ const { excludeCkeditorFromOptimize = true } = options;
5
+ return {
6
+ name: "vite-plugin-customform-renderer",
7
+ config(config, _env) {
8
+ const optimizeDeps = config.optimizeDeps ?? {};
9
+ const include = Array.isArray(optimizeDeps.include) ? [...optimizeDeps.include] : [];
10
+ if (!include.includes(PACKAGE_NAME)) {
11
+ include.push(PACKAGE_NAME);
12
+ }
13
+ const exclude = Array.isArray(optimizeDeps.exclude) ? [...optimizeDeps.exclude] : [];
14
+ if (excludeCkeditorFromOptimize) {
15
+ const ckEditorPath = `${PACKAGE_NAME}/lib/ckeditor/ckeditor.js`;
16
+ if (!exclude.includes(ckEditorPath)) {
17
+ exclude.push(ckEditorPath);
18
+ }
19
+ }
20
+ const ssr = config.ssr ?? {};
21
+ const noExternal = ssr.noExternal;
22
+ const noExternalList = Array.isArray(noExternal) ? [...noExternal] : noExternal === true ? true : [PACKAGE_NAME];
23
+ if (Array.isArray(noExternalList) && !noExternalList.includes(PACKAGE_NAME)) {
24
+ noExternalList.push(PACKAGE_NAME);
25
+ }
26
+ return {
27
+ ...config,
28
+ optimizeDeps: {
29
+ ...optimizeDeps,
30
+ include,
31
+ ...exclude.length > 0 ? { exclude } : {}
32
+ },
33
+ ssr: {
34
+ ...ssr,
35
+ noExternal: noExternalList
36
+ }
37
+ };
38
+ }
39
+ };
40
+ }
41
+ var vite_plugin_default = customformRendererVite;
42
+
43
+ export { customformRendererVite, vite_plugin_default as default };
44
+ //# sourceMappingURL=vite-plugin.mjs.map
45
+ //# sourceMappingURL=vite-plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite-plugin.ts"],"names":[],"mappings":";AAOA,IAAM,YAAA,GAAe,gCAAA;AAmBd,SAAS,sBAAA,CAAuB,OAAA,GAA+C,EAAC,EAAW;AAChG,EAAA,MAAM,EAAE,2BAAA,GAA8B,IAAA,EAAK,GAAI,OAAA;AAE/C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,iCAAA;AAAA,IACN,MAAA,CAAO,QAAoB,IAAA,EAAiB;AAC1C,MAAA,MAAM,YAAA,GAAe,MAAA,CAAO,YAAA,IAAgB,EAAC;AAC7C,MAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,YAAA,CAAa,OAAO,CAAA,GAAI,CAAC,GAAG,YAAA,CAAa,OAAO,CAAA,GAAI,EAAC;AACnF,MAAA,IAAI,CAAC,OAAA,CAAQ,QAAA,CAAS,YAAY,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.\r\n * Use only if you need SSR or dependency optimization workarounds (e.g. \"module not found\" in SSR).\r\n * With the package's fixed exports, most Vite projects work with zero config.\r\n */\r\nimport type { Plugin, UserConfig, ConfigEnv } from 'vite';\r\n\r\nconst PACKAGE_NAME = '@aatulwork/customform-renderer';\r\n\r\nexport interface CustomFormRendererVitePluginOptions {\r\n /** Exclude CKEditor script from pre-bundling (default: true). Set false if you load CKEditor via HTML only. */\r\n excludeCkeditorFromOptimize?: boolean;\r\n}\r\n\r\n/**\r\n * Vite plugin that applies recommended settings for @aatulwork/customform-renderer:\r\n * - optimizeDeps.include: pre-bundle the package for faster dev startup\r\n * - ssr.noExternal: bundle the package in SSR instead of externalizing it\r\n * - optimizeDeps.exclude: optionally exclude the package's CKEditor build from pre-bundling\r\n *\r\n * Usage in vite.config.ts:\r\n * import { customformRendererVite } from '@aatulwork/customform-renderer/vite';\r\n * export default defineConfig({\r\n * plugins: [react(), customformRendererVite()],\r\n * });\r\n */\r\nexport function customformRendererVite(options: CustomFormRendererVitePluginOptions = {}): Plugin {\r\n const { excludeCkeditorFromOptimize = true } = options;\r\n\r\n return {\r\n name: 'vite-plugin-customform-renderer',\r\n config(config: UserConfig, _env: ConfigEnv) {\r\n const optimizeDeps = config.optimizeDeps ?? {};\r\n const include = Array.isArray(optimizeDeps.include) ? [...optimizeDeps.include] : [];\r\n if (!include.includes(PACKAGE_NAME)) {\r\n include.push(PACKAGE_NAME);\r\n }\r\n const exclude = Array.isArray(optimizeDeps.exclude) ? [...optimizeDeps.exclude] : [];\r\n if (excludeCkeditorFromOptimize) {\r\n const ckEditorPath = `${PACKAGE_NAME}/lib/ckeditor/ckeditor.js`;\r\n if (!exclude.includes(ckEditorPath)) {\r\n exclude.push(ckEditorPath);\r\n }\r\n }\r\n const ssr = config.ssr ?? {};\r\n const noExternal = ssr.noExternal;\r\n const noExternalList = Array.isArray(noExternal)\r\n ? [...noExternal]\r\n : noExternal === true\r\n ? true\r\n : [PACKAGE_NAME];\r\n if (Array.isArray(noExternalList) && !noExternalList.includes(PACKAGE_NAME)) {\r\n noExternalList.push(PACKAGE_NAME);\r\n }\r\n\r\n return {\r\n ...config,\r\n optimizeDeps: {\r\n ...optimizeDeps,\r\n include,\r\n ...(exclude.length > 0 ? { exclude } : {}),\r\n },\r\n ssr: {\r\n ...ssr,\r\n noExternal: noExternalList,\r\n },\r\n };\r\n },\r\n };\r\n}\r\n\r\nexport default customformRendererVite;\r\n"]}
package/package.json CHANGED
@@ -1,10 +1,23 @@
1
1
  {
2
2
  "name": "@aatulwork/customform-renderer",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "A powerful, reusable form renderer component for React with Material-UI support",
5
5
  "main": "dist/index.js",
6
- "module": "dist/index.esm.js",
6
+ "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./lib/ckeditor/ckeditor.js": "./lib/ckeditor/ckeditor.js",
15
+ "./vite": {
16
+ "types": "./dist/vite-plugin.d.ts",
17
+ "import": "./dist/vite-plugin.mjs",
18
+ "require": "./dist/vite-plugin.js"
19
+ }
20
+ },
8
21
  "files": [
9
22
  "dist",
10
23
  "lib",
@@ -64,14 +77,19 @@
64
77
  "dayjs": "^1.11.0",
65
78
  "@ckeditor/ckeditor5-react": "^11.0.0"
66
79
  },
80
+ "optionalPeerDependencies": {
81
+ "vite": ">=4.0.0"
82
+ },
67
83
  "dependencies": {
68
84
  "@emotion/react": "^11.14.0",
69
- "@emotion/styled": "^11.14.1"
85
+ "@emotion/styled": "^11.14.1",
86
+ "@mui/system": "^6.0.0"
70
87
  },
71
88
  "devDependencies": {
72
89
  "@types/react": "^18.2.0",
73
90
  "@types/react-dom": "^18.2.0",
74
91
  "typescript": "^5.2.0",
75
- "tsup": "^8.0.0"
92
+ "tsup": "^8.0.0",
93
+ "vite": "^5.0.0"
76
94
  }
77
95
  }