w3wallets 0.0.1
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/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +61 -0
- package/dist/index.mjs +24 -0
- package/package.json +37 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as playwright_test from 'playwright/test';
|
|
2
|
+
import { test, BrowserContext } from '@playwright/test';
|
|
3
|
+
|
|
4
|
+
type Config = {
|
|
5
|
+
backpack: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function withExtensions(test: typeof test, config: Config): playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & {
|
|
8
|
+
context: BrowserContext;
|
|
9
|
+
}, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions>;
|
|
10
|
+
|
|
11
|
+
export { withExtensions };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as playwright_test from 'playwright/test';
|
|
2
|
+
import { test, BrowserContext } from '@playwright/test';
|
|
3
|
+
|
|
4
|
+
type Config = {
|
|
5
|
+
backpack: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function withExtensions(test: typeof test, config: Config): playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & {
|
|
8
|
+
context: BrowserContext;
|
|
9
|
+
}, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions>;
|
|
10
|
+
|
|
11
|
+
export { withExtensions };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
withExtensions: () => withExtensions
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/withExtension.ts
|
|
38
|
+
var import_path = __toESM(require("path"));
|
|
39
|
+
var import_test = require("@playwright/test");
|
|
40
|
+
var import_test2 = require("@playwright/test");
|
|
41
|
+
function withExtensions(test, config) {
|
|
42
|
+
const backpack = import_path.default.join(process.cwd(), "extensions", "backpack");
|
|
43
|
+
return test.extend({
|
|
44
|
+
context: async ({}, use) => {
|
|
45
|
+
const userDataDir = import_path.default.join(process.cwd(), ".tmp-user-data");
|
|
46
|
+
const context = await import_test2.chromium.launchPersistentContext(userDataDir, {
|
|
47
|
+
headless: false,
|
|
48
|
+
args: [
|
|
49
|
+
`--disable-extensions-except=${backpack}`,
|
|
50
|
+
`--load-extension=${backpack}`
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
await use(context);
|
|
54
|
+
await context.close();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
withExtensions
|
|
61
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/withExtension.ts
|
|
2
|
+
import path from "path";
|
|
3
|
+
import "@playwright/test";
|
|
4
|
+
import { chromium } from "@playwright/test";
|
|
5
|
+
function withExtensions(test, config) {
|
|
6
|
+
const backpack = path.join(process.cwd(), "extensions", "backpack");
|
|
7
|
+
return test.extend({
|
|
8
|
+
context: async ({}, use) => {
|
|
9
|
+
const userDataDir = path.join(process.cwd(), ".tmp-user-data");
|
|
10
|
+
const context = await chromium.launchPersistentContext(userDataDir, {
|
|
11
|
+
headless: false,
|
|
12
|
+
args: [
|
|
13
|
+
`--disable-extensions-except=${backpack}`,
|
|
14
|
+
`--load-extension=${backpack}`
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
await use(context);
|
|
18
|
+
await context.close();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
withExtensions
|
|
24
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "w3wallets",
|
|
3
|
+
"description": "browser wallets for playwright",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Max Andreev <maxick20@gmail.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@arethetypeswrong/cli": "^0.17.2",
|
|
17
|
+
"@changesets/cli": "^2.27.11",
|
|
18
|
+
"@playwright/test": "^1.49.1",
|
|
19
|
+
"@types/node": "^22.10.5",
|
|
20
|
+
"prettier": "^3.4.2",
|
|
21
|
+
"standard-version": "^9.5.0",
|
|
22
|
+
"tsup": "^8.3.5",
|
|
23
|
+
"typescript": "^5.7.2"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@playwright/test": "^1.49.1"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"check-format": "prettier --check .",
|
|
32
|
+
"check-exports": "attw --pack .",
|
|
33
|
+
"lint": "tsc",
|
|
34
|
+
"ci": "yarn lint && yarn clean && yarn build && yarn check-format && yarn check-exports",
|
|
35
|
+
"local-release": "changeset version && changeset publish"
|
|
36
|
+
}
|
|
37
|
+
}
|