create-ereo 0.2.9 → 0.2.10

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -163,6 +163,26 @@ coverage
163
163
  *.tgz
164
164
  `;
165
165
  }
166
+ async function writeEreoEnvDts(projectDir) {
167
+ const content = `import 'react';
168
+
169
+ declare module 'react' {
170
+ namespace JSX {
171
+ interface IntrinsicAttributes {
172
+ /** Hydrate island immediately on page load */
173
+ 'client:load'?: boolean;
174
+ /** Hydrate island when browser is idle */
175
+ 'client:idle'?: boolean;
176
+ /** Hydrate island when element becomes visible */
177
+ 'client:visible'?: boolean;
178
+ /** Hydrate island when media query matches */
179
+ 'client:media'?: string;
180
+ }
181
+ }
182
+ }
183
+ `;
184
+ await Bun.write(join(projectDir, "ereo-env.d.ts"), content);
185
+ }
166
186
  async function generateMinimalProject(projectDir, projectName, typescript, trace = false) {
167
187
  const ext = typescript ? "tsx" : "jsx";
168
188
  await mkdir(projectDir, { recursive: true });
@@ -427,9 +447,10 @@ export default function HomePage() {
427
447
  "@/*": ["./app/*"]
428
448
  }
429
449
  },
430
- include: ["app/**/*", "*.config.ts"]
450
+ include: ["app/**/*", "*.config.ts", "ereo-env.d.ts"]
431
451
  };
432
452
  await Bun.write(join(projectDir, "tsconfig.json"), JSON.stringify(tsconfig, null, 2));
453
+ await writeEreoEnvDts(projectDir);
433
454
  } else {
434
455
  const jsconfig = {
435
456
  compilerOptions: {
@@ -539,9 +560,10 @@ export default defineConfig({
539
560
  "@/*": ["./app/*"]
540
561
  }
541
562
  },
542
- include: ["app/**/*", "*.config.ts"]
563
+ include: ["app/**/*", "*.config.ts", "ereo-env.d.ts"]
543
564
  };
544
565
  await Bun.write(join(projectDir, "tsconfig.json"), JSON.stringify(tsconfig, null, 2));
566
+ await writeEreoEnvDts(projectDir);
545
567
  } else {
546
568
  const jsconfig = {
547
569
  compilerOptions: {
@@ -2074,9 +2096,10 @@ export default defineConfig({
2074
2096
  "@/*": ["./app/*"]
2075
2097
  }
2076
2098
  },
2077
- include: ["app/**/*", "*.config.ts"]
2099
+ include: ["app/**/*", "*.config.ts", "ereo-env.d.ts"]
2078
2100
  };
2079
2101
  await Bun.write(join(projectDir, "tsconfig.json"), JSON.stringify(tsconfig, null, 2));
2102
+ await writeEreoEnvDts(projectDir);
2080
2103
  } else {
2081
2104
  const jsconfig = {
2082
2105
  compilerOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ereo",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "license": "MIT",
5
5
  "author": "Ereo Team",
6
6
  "homepage": "https://ereojs.github.io/ereoJS",