zuby 1.0.28 → 1.0.30

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 CHANGED
@@ -30,6 +30,7 @@ Zuby.js integrates with JSX libraries through the `JsxProvider` interface.
30
30
  Following integrations are available:
31
31
 
32
32
  - [@zubyjs/preact](https://www.npmjs.com/package/@zubyjs/preact) - Preact integration for Zuby.js
33
+ - [@zubyjs/react](https://www.npmjs.com/package/@zubyjs/react) - React integration for Zuby.js
33
34
 
34
35
  ## Recommended versions
35
36
 
package/config.js CHANGED
@@ -40,6 +40,9 @@ export const getZubyConfig = async (configFile = ZUBY_CONFIG_FILE, cache = true)
40
40
  throw new Error(`No valid default export found in config file: ${foundConfigFile}`);
41
41
  }
42
42
  zubyConfig = await mergeDefaultConfig(zubyConfig);
43
+ // Check if the user has provided the Jsx Provider
44
+ if (!zubyConfig.jsx)
45
+ throw new Error('You must provide the JSX provider.');
43
46
  return zubyConfig;
44
47
  };
45
48
  /**
@@ -47,9 +50,6 @@ export const getZubyConfig = async (configFile = ZUBY_CONFIG_FILE, cache = true)
47
50
  * @param config
48
51
  */
49
52
  export const mergeDefaultConfig = async (config = {}) => {
50
- // Check if the user has provided the Jsx Provider
51
- if (!config.jsx)
52
- throw new Error('You must provide the JSX provider.');
53
53
  // Call the jsx function if user forgot to call it
54
54
  if (typeof config.jsx === 'function') {
55
55
  config.jsx = config.jsx();
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "<projectName>",
3
+ "description": "My awesome project built with Zuby.js",
3
4
  "private": true,
4
5
  "version": "0.0.0",
5
6
  "type": "module",
@@ -11,5 +12,9 @@
11
12
  "dependencies": {
12
13
  "zuby": "^<zubyVersion>",
13
14
  "@zubyjs/<jsxProviderName>": "^<zubyVersion>"
15
+ },
16
+ "devDependencies": {
17
+ "@types/node": "^20.8.3",
18
+ "typescript": "^5.2.2"
14
19
  }
15
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zuby",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Zuby.js is framework for building SPA apps using Vite",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -54,7 +54,8 @@
54
54
  "vite",
55
55
  "spa",
56
56
  "framework",
57
- "web"
57
+ "web",
58
+ "zuby"
58
59
  ],
59
60
  "engines": {
60
61
  "node": ">=16"
package/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { UserConfig as ViteUserConfig } from 'vite';
2
2
  import type { Plugin as VitePlugin } from 'vite';
3
+ import type { PluginOption as VitePluginOption } from 'vite';
3
4
  import { Template } from './templates/types.js';
4
5
  import { ZubyLogger } from './logger/types.js';
5
6
  export interface ZubyConfig {
@@ -152,11 +153,10 @@ export declare const MODES: {
152
153
  export type Mode = (typeof MODES)[keyof typeof MODES];
153
154
  export interface ZubyPlugin extends VitePlugin {
154
155
  }
155
- import { Plugin } from 'vite';
156
156
  export interface JsxProvider {
157
157
  name: string;
158
158
  render(node: any): Promise<string>;
159
- getPlugins(): Plugin[] | Plugin[][];
159
+ getPlugins(): VitePluginOption[] | VitePluginOption[][];
160
160
  appTemplateFile: string;
161
161
  entryTemplateFile: string;
162
162
  layoutTemplateFile: string;