Skip to content

Commit 5346598

Browse files
committed
fix: fixes no .cache folder bug 🐛
1 parent 26ad031 commit 5346598

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { existsSync, readFileSync } from "node:fs";
1+
import { existsSync, readFileSync, mkdirSync } from "node:fs";
22
import { join } from "node:path";
33
import { fileURLToPath } from "node:url";
44
import { ImportMap } from "@jspm/import-map";
@@ -20,6 +20,8 @@ export const root = fileURLToPath(`file://${wd}`);
2020
export const cacheMap = new Map();
2121
export const nodeImportMapPath = join(root, "node.importmap");
2222
export const cache = join(root, ".cache");
23+
const hasCacheFoler = existsSync(cache)
24+
if (!hasCacheFoler) mkdirSync(cache);
2325
const map = existsSync(nodeImportMapPath) ? JSON.parse(readFileSync(nodeImportMapPath, { encoding: "utf8" })) : {};
2426
export const importmap = new ImportMap({ rootUrl: import.meta.url, map });
2527

@@ -28,4 +30,4 @@ export const options = parseArgs({
2830
options: { debugNodeImportmapLoader: { alias: "d", type: "boolean", default: false } },
2931
});
3032

31-
export const isDebuggingEnabled = Boolean(options.debugNodeImportmapLoader);
33+
export const isDebuggingEnabled = Boolean(options?.debugNodeImportmapLoader);

tests/e2e/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import * as TeleportProjectGeneratorPreact from "@teleporthq/teleport-project-generator-preact";
2-
import * as TeleportProjectGeneratorReact from "@teleporthq/teleport-project-generator-react";
3-
import * as TeleportTypes from "@teleporthq/teleport-types";
1+
// import * as TeleportProjectGeneratorPreact from "@teleporthq/teleport-project-generator-preact";
2+
// import * as TeleportProjectGeneratorReact from "@teleporthq/teleport-project-generator-react";
3+
// import * as TeleportTypes from "@teleporthq/teleport-types";
44
import * as react from "react";
55
import * as reactRouter from "react-router";
66
import * as reactRouterDom from "react-router-dom";
77
import assert from "assert";
88

99
// Write main module code here, or as a separate file with a "src" attribute on the module script.
1010
console.log(
11-
TeleportProjectGeneratorPreact,
12-
TeleportProjectGeneratorReact,
13-
TeleportTypes,
11+
// TeleportProjectGeneratorPreact,
12+
// TeleportProjectGeneratorReact,
13+
// TeleportTypes,
1414
react,
1515
reactRouter,
1616
reactRouterDom,

0 commit comments

Comments
 (0)