minista 2.4.1 → 2.4.4

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
@@ -31,7 +31,7 @@ $ npm init minista@latest
31
31
  ### Manual Setup
32
32
 
33
33
  ```bash
34
- $ npm install --save-dev minista react react-dom
34
+ $ npm install --save-dev minista react@17 react-dom@17
35
35
  ```
36
36
 
37
37
  ```bash
package/dist/build.d.ts CHANGED
@@ -25,7 +25,6 @@ export declare function buildTempAssets(viteConfig: InlineConfig, buildOptions:
25
25
  bundleOutName: string;
26
26
  outDir: string;
27
27
  assetDir: string;
28
- generateJs: boolean;
29
28
  }): Promise<void>;
30
29
  export declare function buildAssetsTagStr(entryPoints: string[], buildOptions: {
31
30
  outBase: string;
@@ -57,7 +56,6 @@ export declare function buildPartialHydrateAssets(viteConfig: InlineConfig, buil
57
56
  bundleOutName: string;
58
57
  outDir: string;
59
58
  assetDir: string;
60
- generateJs: boolean;
61
59
  usePreact: boolean;
62
60
  }): Promise<void>;
63
61
  export declare function buildCopyDir(targetDir: string, outDir: string, log?: "public" | "assets"): Promise<void>;
package/dist/build.js CHANGED
@@ -252,10 +252,6 @@ async function buildTempAssets(viteConfig, buildOptions) {
252
252
  const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".css";
253
253
  return (item == null ? void 0 : item.source) && fs.outputFile(customFileName, item == null ? void 0 : item.source);
254
254
  } else if (item.fileName.match(/__minista_bundle_assets\.js/)) {
255
- if (buildOptions.generateJs) {
256
- const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
257
- return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
258
- }
259
255
  return;
260
256
  } else {
261
257
  const customFileName = buildOptions.outDir + item.fileName.replace(buildOptions.assetDir, "");
@@ -538,14 +534,10 @@ async function buildPartialHydrateAssets(viteConfig, buildOptions) {
538
534
  if (Array.isArray(items) && items.length > 0) {
539
535
  items.map((item) => {
540
536
  if (item.fileName.match(/\.css/)) {
541
- const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".css";
542
- return (item == null ? void 0 : item.source) && fs.outputFile(customFileName, item == null ? void 0 : item.source);
543
- } else if (item.fileName.match(/\.js/)) {
544
- if (buildOptions.generateJs) {
545
- const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
546
- return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
547
- }
548
537
  return;
538
+ } else if (item.fileName.match(/\.js/)) {
539
+ const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
540
+ return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
549
541
  } else {
550
542
  const customFileName = buildOptions.outDir + item.fileName.replace(buildOptions.assetDir, "");
551
543
  const customCode = (item == null ? void 0 : item.source) ? item == null ? void 0 : item.source : (item == null ? void 0 : item.code) ? item == null ? void 0 : item.code : "";
package/dist/download.js CHANGED
@@ -15,7 +15,7 @@ async function downloadFiles(entryPoints, remoteUrl, remoteName, downloadOutDir,
15
15
  const html = await fs.readFile(entryPoint, "utf8");
16
16
  const parsedHtml = parseHtml(html);
17
17
  const imgTags = parsedHtml.getElementsByTagName("img");
18
- const sourseTags = parsedHtml.getElementsByTagName("sourse");
18
+ const sourceTags = parsedHtml.getElementsByTagName("source");
19
19
  if (imgTags.length > 0) {
20
20
  for (const item of imgTags) {
21
21
  const itemSrc = item.getAttribute("src");
@@ -34,8 +34,8 @@ async function downloadFiles(entryPoints, remoteUrl, remoteName, downloadOutDir,
34
34
  }
35
35
  }
36
36
  }
37
- if (sourseTags.length > 0) {
38
- for (const item of sourseTags) {
37
+ if (sourceTags.length > 0) {
38
+ for (const item of sourceTags) {
39
39
  const itemSrc = item.getAttribute("src");
40
40
  const itemSrcset = item.getAttribute("srcset");
41
41
  if (itemSrc && matchSrcUrls(itemSrc, remoteUrl)) {
package/dist/generate.js CHANGED
@@ -65,8 +65,7 @@ async function generateTempAssets(config, viteConfig) {
65
65
  input: path.resolve(__dirname + "/../dist/bundle.js"),
66
66
  bundleOutName: config.assets.bundle.outName,
67
67
  outDir: systemConfig.temp.assets.outDir,
68
- assetDir: config.assets.outDir,
69
- generateJs: false
68
+ assetDir: config.assets.outDir
70
69
  });
71
70
  await buildCopyDir(systemConfig.temp.assets.outDir, slashEnd(config.out) + noSlashEnd(config.assets.outDir), "assets");
72
71
  }
@@ -105,7 +104,6 @@ async function generatePartialHydration(config, mdxConfig, viteConfig) {
105
104
  bundleOutName: config.assets.partial.outName,
106
105
  outDir: systemConfig.temp.assets.outDir,
107
106
  assetDir: config.assets.outDir,
108
- generateJs: true,
109
107
  usePreact: config.assets.partial.usePreact
110
108
  });
111
109
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minista",
3
3
  "description": "Next.js Like Development with 100% Static Generate",
4
- "version": "2.4.1",
4
+ "version": "2.4.4",
5
5
  "bin": {
6
6
  "minista": "./bin/minista.js"
7
7
  },
@@ -101,8 +101,8 @@
101
101
  "@types/js-beautify": "^1.13.3",
102
102
  "@types/mime-types": "^2.1.1",
103
103
  "@types/node": "^17.0.31",
104
- "@types/react": "^17.0.43",
105
- "@types/react-dom": "^17.0.14",
104
+ "@types/react": "^17.0.45",
105
+ "@types/react-dom": "^17.0.16",
106
106
  "@types/react-helmet": "^6.1.5",
107
107
  "@types/uuid": "^8.3.4",
108
108
  "react": "^17.0.2",