@intuned/runtime-dev 0.1.0-test.12 → 0.1.0-test.13

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.
@@ -28,7 +28,7 @@ program
28
28
  .allowUnknownOption()
29
29
  .action(async (mode, outfile) => {
30
30
  await moveWebTemplateFiles();
31
- const currentTemplateTsConfig = path.resolve(__dirname, "..", "..", "template.tsconfig.json");
31
+ const currentTemplateTsConfig = path.resolve(path.dirname(import.meta.url), "..", "..", "template.tsconfig.json");
32
32
  await fs.copy(currentTemplateTsConfig, "./intuned/WebTemplate/tsconfig.json");
33
33
  await build(outfile, mode);
34
34
  });
@@ -93,7 +93,7 @@ async function build(outfile, mode) {
93
93
  console.log(`📦 Building ${outfile}`);
94
94
  const outfileFolder = path.dirname(outfile);
95
95
  // copy assets to outfile folder
96
- const assetsDir = path.resolve(__dirname, "..", "common", "assets");
96
+ const assetsDir = path.resolve(path.dirname(import.meta.url), "..", "common", "assets");
97
97
  await fs.copy(assetsDir, `${outfileFolder}/assets`);
98
98
  await bundle.write({
99
99
  format: "cjs",
@@ -18,7 +18,7 @@ import dotenv from "dotenv";
18
18
  dotenv.config();
19
19
  program.description("build the intuned server").addArgument(new Argument("<mode>", "mode of execution").choices(["vanilla", "playwright"]).default("playwright").argOptional()).argument("[outfile]", "output bundle", "./output/bundle_v2.js").allowUnknownOption().action(async (mode, outfile) => {
20
20
  await moveWebTemplateFiles();
21
- const currentTemplateTsConfig = path.resolve(__dirname, "..", "..", "template.tsconfig.json");
21
+ const currentTemplateTsConfig = path.resolve(path.dirname(import.meta.url), "..", "..", "template.tsconfig.json");
22
22
  await fs.copy(currentTemplateTsConfig, "./intuned/WebTemplate/tsconfig.json");
23
23
  await build(outfile, mode);
24
24
  });
@@ -58,7 +58,7 @@ async function build(outfile, mode) {
58
58
  });
59
59
  console.log(`📦 Building ${outfile}`);
60
60
  const outfileFolder = path.dirname(outfile);
61
- const assetsDir = path.resolve(__dirname, "..", "common", "assets");
61
+ const assetsDir = path.resolve(path.dirname(import.meta.url), "..", "common", "assets");
62
62
  await fs.copy(assetsDir, `${outfileFolder}/assets`);
63
63
  await bundle.write({
64
64
  format: "cjs",
@@ -3,7 +3,7 @@ import getFirstLineNumber from "./getFirstLineNumber.js";
3
3
  import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  describe("getFirstLineNumber", () => {
6
- const testFilesDir = path.join(__dirname, "testFiles");
6
+ const testFilesDir = path.join(path.dirname(import.meta.url), "testFiles");
7
7
  const createTestFile = (fileName, content) => {
8
8
  const filePath = path.join(testFilesDir, fileName);
9
9
  fs.writeFileSync(filePath, content);
@@ -4,7 +4,7 @@ import { getFullPathInProject, listProjectFilesAndFolders, } from "./fileUtils.j
4
4
  export const moveWebTemplateFiles = async () => {
5
5
  await fs.remove("./intuned");
6
6
  await fs.ensureDir("./intuned");
7
- const currentFileLocation = path.resolve(__dirname, "..", "..", "..", "..", "WebTemplate");
7
+ const currentFileLocation = path.resolve(path.dirname(import.meta.url), "..", "..", "..", "..", "WebTemplate");
8
8
  // copy WebTemplate to ./intuned
9
9
  await fs.copy(`${currentFileLocation}`, "./intuned/WebTemplate", {
10
10
  filter: (src, dest) => {
@@ -4,7 +4,7 @@ import { getFullPathInProject, listProjectFilesAndFolders } from "./fileUtils.js
4
4
  export const moveWebTemplateFiles = async () => {
5
5
  await fs.remove("./intuned");
6
6
  await fs.ensureDir("./intuned");
7
- const currentFileLocation = path.resolve(__dirname, "..", "..", "..", "..", "WebTemplate");
7
+ const currentFileLocation = path.resolve(path.dirname(import.meta.url), "..", "..", "..", "..", "WebTemplate");
8
8
  await fs.copy(`${currentFileLocation}`, "./intuned/WebTemplate", {
9
9
  filter: (src, dest) => {
10
10
  if (src.includes(".d.ts")) {
@@ -9,7 +9,7 @@ program
9
9
  .allowUnknownOption()
10
10
  .action(async () => {
11
11
  await moveWebTemplateFiles();
12
- const templateTsConfig = path.resolve(__dirname, "..", "..", "template.tsconfig.json");
12
+ const templateTsConfig = path.resolve(path.dirname(import.meta.url), "..", "..", "template.tsconfig.json");
13
13
  await fs.copy(templateTsConfig, "./intuned/WebTemplate/tsconfig.json");
14
14
  checkTypes();
15
15
  });
@@ -6,7 +6,7 @@ import * as path from "path";
6
6
  import { moveWebTemplateFiles } from "./common/utils/webTemplate.js";
7
7
  program.description("Check TypeScript types in the project").allowUnknownOption().action(async () => {
8
8
  await moveWebTemplateFiles();
9
- const templateTsConfig = path.resolve(__dirname, "..", "..", "template.tsconfig.json");
9
+ const templateTsConfig = path.resolve(path.dirname(import.meta.url), "..", "..", "template.tsconfig.json");
10
10
  await fs.copy(templateTsConfig, "./intuned/WebTemplate/tsconfig.json");
11
11
  checkTypes();
12
12
  });
@@ -65,7 +65,7 @@ export async function getProductionPlaywrightConstructs({ proxy, headless = true
65
65
  if (storageState) {
66
66
  await loadSessionToContext({ context, session: storageState });
67
67
  }
68
- const assetsFile = path.join(__dirname, "./assets/browser_scripts.js");
68
+ const assetsFile = path.join(path.dirname(import.meta.url), "./assets/browser_scripts.js");
69
69
  await context.addInitScript({
70
70
  path: assetsFile,
71
71
  });
@@ -122,7 +122,7 @@ export async function getPlaywrightConstructsForMode(mode, cdpAddress, authSessi
122
122
  if (!context) {
123
123
  throw new Error("no context found");
124
124
  }
125
- const assetsFile = path.join(__dirname, "./assets/browser_scripts.js");
125
+ const assetsFile = path.join(path.dirname(import.meta.url), "./assets/browser_scripts.js");
126
126
  await context.addInitScript({
127
127
  path: assetsFile,
128
128
  });
@@ -64,7 +64,7 @@ export async function getProductionPlaywrightConstructs({
64
64
  session: storageState
65
65
  });
66
66
  }
67
- const assetsFile = path.join(__dirname, "./assets/browser_scripts.js");
67
+ const assetsFile = path.join(path.dirname(import.meta.url), "./assets/browser_scripts.js");
68
68
  await context.addInitScript({
69
69
  path: assetsFile
70
70
  });
@@ -92,7 +92,7 @@ export async function getPlaywrightConstructsForMode(mode, cdpAddress, authSessi
92
92
  if (!context) {
93
93
  throw new Error("no context found");
94
94
  }
95
- const assetsFile = path.join(__dirname, "./assets/browser_scripts.js");
95
+ const assetsFile = path.join(path.dirname(import.meta.url), "./assets/browser_scripts.js");
96
96
  await context.addInitScript({
97
97
  path: assetsFile
98
98
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
3
  "type": "module",
4
- "version": "0.1.0-test.12",
4
+ "version": "0.1.0-test.13",
5
5
  "description": "Intuned runtime",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",