buner 1.0.1 → 1.0.2

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/bin/buner.js CHANGED
@@ -13,7 +13,7 @@ import { globby } from "globby";
13
13
  import { exec } from "node:child_process";
14
14
  import validateProjectName from "validate-npm-package-name";
15
15
  const name = "buner";
16
- const version = "1.0.1";
16
+ const version = "1.0.2";
17
17
  const description = "Frontend build toolkit for Vite + React SSR projects — SCSS pipeline, prerender, SSR dev server, and backend integration.";
18
18
  const type = "module";
19
19
  const license = "MIT";
@@ -212,11 +212,15 @@ const formatFiles = async (root) => {
212
212
  `;
213
213
  await fs$1.writeFile(filePath, data + os.EOL);
214
214
  filePath = path.join(root, "src/react-loader.tsx");
215
- data = await fs$1.readFile(filePath, "utf8");
216
- data = data.replace(
217
- /export const blocks((?!};).)*};/s,
218
- "export const blocks: { [name: string]: any } = {\n root: lazy(() => import('./organisms/root/Root')),\n};"
219
- );
215
+ await fs$1.mkdir(path.dirname(filePath), { recursive: true });
216
+ data = [
217
+ "import { lazy } from 'react';",
218
+ "",
219
+ "export const blocks: { [name: string]: any } = {",
220
+ " root: lazy(() => import('./organisms/root/Root')),",
221
+ "};",
222
+ ""
223
+ ].join("\n");
220
224
  await fs$1.writeFile(filePath, data);
221
225
  filePath = path.join(root, "src/_types/atoms.d.ts");
222
226
  await fs$1.writeFile(
@@ -28,11 +28,15 @@ const formatFiles = async (root: string) => {
28
28
 
29
29
  // react loader
30
30
  filePath = path.join(root, 'src/react-loader.tsx');
31
- data = await fs.readFile(filePath, 'utf8');
32
- data = data.replace(
33
- /export const blocks((?!};).)*};/s,
34
- "export const blocks: { [name: string]: any } = {\n\troot: lazy(() => import('./organisms/root/Root')),\n};"
35
- );
31
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
32
+ data = [
33
+ "import { lazy } from 'react';",
34
+ '',
35
+ 'export const blocks: { [name: string]: any } = {',
36
+ "\troot: lazy(() => import('./organisms/root/Root')),",
37
+ '};',
38
+ '',
39
+ ].join('\n');
36
40
 
37
41
  await fs.writeFile(filePath, data);
38
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buner",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Frontend build toolkit for Vite + React SSR projects — SCSS pipeline, prerender, SSR dev server, and backend integration.",
5
5
  "type": "module",
6
6
  "license": "MIT",