@test2doc/playwright-passkey-gen 0.0.0 → 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/README.md +4 -4
- package/bin/generate-passkey +5 -2
- package/package.json +1 -1
- package/src/generate-passkey/cli.ts +11 -3
package/README.md
CHANGED
|
@@ -8,16 +8,16 @@ Generate a test passkey file from the command line:
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
# Generate a TypeScript file (default)
|
|
11
|
-
npx playwright-passkey
|
|
11
|
+
npx @test2doc/playwright-passkey-gen
|
|
12
12
|
|
|
13
13
|
# Generate with custom output path
|
|
14
|
-
npx playwright-passkey --output path/to/my-passkey.ts
|
|
14
|
+
npx @test2doc/playwright-passkey-gen --output path/to/my-passkey.ts
|
|
15
15
|
|
|
16
16
|
# Generate JSON file
|
|
17
|
-
npx playwright-passkey --type json
|
|
17
|
+
npx @test2doc/playwright-passkey-gen --type json
|
|
18
18
|
|
|
19
19
|
# Generate JavaScript file
|
|
20
|
-
npx playwright-passkey --type js
|
|
20
|
+
npx @test2doc/playwright-passkey-gen --type js
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
**CLI Options:**
|
package/bin/generate-passkey
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { spawn } from "child_process"
|
|
2
|
+
import { fileURLToPath } from "node:url"
|
|
3
|
+
import { dirname, join } from "node:path"
|
|
2
4
|
|
|
3
|
-
const
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
6
|
+
|
|
7
|
+
// When installed via npm, the server will be in a different location
|
|
8
|
+
const serverPath = join(__dirname, "../scripts/server.js")
|
|
9
|
+
|
|
10
|
+
const server = spawn("node", [serverPath], { stdio: "inherit" })
|
|
4
11
|
|
|
5
12
|
const killServer = () => {
|
|
6
13
|
try {
|
|
@@ -17,8 +24,9 @@ const killServer = () => {
|
|
|
17
24
|
})
|
|
18
25
|
})
|
|
19
26
|
|
|
20
|
-
// Run the
|
|
21
|
-
const
|
|
27
|
+
// Run the generator from the same directory
|
|
28
|
+
const generatorPath = join(__dirname, "index.js")
|
|
29
|
+
const generator = spawn("node", [generatorPath], {
|
|
22
30
|
stdio: "inherit",
|
|
23
31
|
})
|
|
24
32
|
|