@zhiweiliu/playwright-generator 1.0.22 → 1.0.24

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
@@ -233,29 +233,38 @@ npx playwright-generator generate --tc TC-0001,TC-0002,TC-0003
233
233
 
234
234
  Various npm scripts are provided to run and debug Playwright test cases.
235
235
 
236
+ Since this is essentially a standard Playwright project, nothing prevents you from using the Playwright CLI commands you are already familiar with. The npm scripts below are provided as convenient shortcuts for common tasks, but you can always fall back to running `npx playwright test` directly with any flags you need.
237
+
236
238
  **Available Commands**:
237
239
 
238
240
  ```bash
239
241
  # Run all tests
240
- npm test
241
-
242
- # Run tests by specific tag
243
- npm run test:tag -- --tag SMOKE
242
+ npm run test
244
243
 
245
- # Run a specific test case
246
- npm run test:case -- --tc TC-0001
244
+ # Run tests by tag or test case ID
245
+ npm run test:case -- SMOKE
246
+ npm run test:case -- TC-0001
247
247
 
248
248
  # Debug mode (opens inspector)
249
- npm run test:debug -- --tag SMOKE
249
+ npm run test:debug -- SMOKE
250
250
 
251
251
  # Run tests in headed mode (see browser UI)
252
252
  npm run test:headed
253
253
 
254
- # Run tests with specific browser
255
- npm run test:browser -- --browser firefox
254
+ # Run tests in headed mode with a specific tag
255
+ npm run test:headed -- SMOKE
256
+
257
+ # Run tests with specific browser (set BROWSER=chromium|firefox|webkit in .env)
258
+ npm run test:browser
259
+
260
+ # Run tests with specific browser and tag
261
+ npm run test:browser:tag -- SMOKE
262
+
263
+ # Run tests with video recording enabled for failed cases (set VIDEO=on-failure in .env)
264
+ npm run test:video
256
265
 
257
- # Run tests with video recording enabled for failed cases
258
- npm test -- --video on-failure
266
+ # Run tests with video recording and a specific tag
267
+ npm run test:video -- SMOKE
259
268
 
260
269
  # Generate HTML report
261
270
  npm run report
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ const program = new commander_1.Command();
12
12
  program
13
13
  .name("playwright-generator")
14
14
  .description("Generate Playwright test cases from natural language using LLM")
15
- .version("1.0.22");
15
+ .version("1.0.24");
16
16
  // Init command
17
17
  program
18
18
  .command("init [projectPath]")
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAIA,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAob1E"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAIA,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqU1E"}
@@ -39,6 +39,7 @@ BASE_URL=http://localhost:3000
39
39
  # Execution Configuration
40
40
  TIMEOUT=30000
41
41
  RETRIES=1
42
+ VIDEO=retain-on-failure
42
43
  `;
43
44
  const targetEnvPath = path_1.default.join(projectRoot, ".env.example");
44
45
  await fs_extra_1.default.writeFile(targetEnvPath, envExampleContent);
@@ -62,7 +63,7 @@ export default defineConfig({
62
63
  baseURL: process.env.BASE_URL || 'http://localhost:3000',
63
64
  trace: 'on-first-retry',
64
65
  screenshot: 'only-on-failure',
65
- video: 'retain-on-failure',
66
+ video: (process.env.VIDEO || 'retain-on-failure') as 'off' | 'on' | 'retain-on-failure' | 'on-first-retry',
66
67
  },
67
68
 
68
69
  projects: [
@@ -78,7 +79,7 @@ export default defineConfig({
78
79
  name: 'webkit',
79
80
  use: { ...devices['Desktop Safari'] },
80
81
  },
81
- ],
82
+ ].filter(p => !process.env.BROWSER || p.name === (process.env.BROWSER || 'chromium')),
82
83
  });
83
84
  `;
84
85
  await fs_extra_1.default.writeFile(path_1.default.join(projectRoot, "playwright.config.ts"), playwrightConfig);
@@ -90,13 +91,13 @@ export default defineConfig({
90
91
  description: "Playwright tests generated by @zhiweiliu/playwright-generator",
91
92
  scripts: {
92
93
  test: "playwright test",
93
- "test:tag": "playwright test --grep",
94
94
  "test:case": "playwright test --grep",
95
- "test:debug": "playwright test --debug",
96
- "test:headed": "playwright test --headed",
97
- "test:browser": "playwright test --project",
95
+ "test:debug": "playwright test --debug --grep",
96
+ "test:headed": "playwright test --headed --grep",
97
+ "test:browser": "playwright test",
98
+ "test:browser:tag": "playwright test --grep",
99
+ "test:video": "playwright test --grep",
98
100
  report: "playwright show-report",
99
- server: 'echo "Add your server startup command here"',
100
101
  },
101
102
  devDependencies: {
102
103
  "@playwright/test": "^1.40.0",
@@ -125,113 +126,6 @@ export default defineConfig({
125
126
  };
126
127
  await fs_extra_1.default.writeFile(path_1.default.join(projectRoot, "tsconfig.json"), JSON.stringify(tsconfig, null, 2));
127
128
  console.log(chalk_1.default.green("✓ Created tsconfig.json"));
128
- // Create example test case
129
- const exampleTestCase = `# SauceDemo Sample Test Cases
130
-
131
- This file contains sample natural language test cases for the SauceDemo e-commerce website (https://saucedemo.com). These test cases demonstrate comprehensive testing scenarios with detailed step-by-step descriptions.
132
-
133
- ## Test Case: Complete Purchase Flow
134
-
135
- [TC-0001] [SMOKE] [PURCHASE] [END-TO-END]
136
- Complete e-commerce purchase flow from login to order confirmation
137
-
138
- Given the user navigates to the SauceDemo login page at https://saucedemo.com
139
- When the user enters "standard_user" as the username
140
- And the user enters "secret_sauce" as the password
141
- And the user clicks the "Login" button
142
- Then the user should be redirected to the products page
143
- And the page title should contain "Products"
144
-
145
- When the user clicks on the "Sauce Labs Backpack" product
146
- Then the product details page should open
147
- And the product name should be "Sauce Labs Backpack"
148
- And the product price should be displayed
149
-
150
- When the user clicks the "Add to Cart" button
151
- Then the cart icon should show "1" item
152
- And the "Add to Cart" button should change to "Remove"
153
-
154
- When the user clicks the cart icon in the top right
155
- Then the cart page should open
156
- And the "Sauce Labs Backpack" should be listed in the cart
157
- And the quantity should be 1
158
- And the price should match the product page
159
-
160
- When the user clicks the "Checkout" button
161
- Then the checkout information page should open
162
-
163
- When the user enters "John" as the first name
164
- And the user enters "Doe" as the last name
165
- And the user enters "12345" as the zip code
166
- And the user clicks the "Continue" button
167
- Then the checkout overview page should open
168
- And the item total should be calculated correctly
169
- And the tax should be applied
170
- And the total amount should be displayed
171
-
172
- When the user clicks the "Finish" button
173
- Then the order confirmation page should open
174
- And a success message "Thank you for your order!" should be displayed
175
- And the order number should be shown
176
-
177
- ## Test Case: Product Browsing and Cart Management
178
-
179
- [TC-0002] [REGRESSION] [BROWSING] [CART]
180
- Browse products, sort items, and manage cart contents
181
-
182
- Given the user is logged in to SauceDemo with valid credentials
183
- When the user is on the products page
184
- Then all products should be displayed in a grid layout
185
- And each product should show name, price, and "Add to Cart" button
186
-
187
- When the user clicks the sort dropdown
188
- Then sorting options should be displayed: Name (A to Z), Name (Z to A), Price (low to high), Price (high to low)
189
-
190
- When the user selects "Name (A to Z)" from the sort dropdown
191
- Then products should be sorted alphabetically by name in ascending order
192
- And the first product should be "Sauce Labs Backpack"
193
-
194
- When the user selects "Name (Z to A)" from the sort dropdown
195
- Then products should be sorted alphabetically by name in descending order
196
- And the first product should be "Test.allTheThings() T-Shirt (Red)"
197
-
198
- When the user selects "Price (low to high)" from the sort dropdown
199
- Then products should be sorted by price in ascending order
200
- And the first product should be the cheapest item
201
-
202
- When the user selects "Price (high to low)" from the sort dropdown
203
- Then products should be sorted by price in descending order
204
- And the first product should be the most expensive item
205
-
206
- When the user clicks "Add to Cart" on the first product in the sorted list
207
- Then the cart icon should update to show "1"
208
- And that product's button should show "Remove"
209
-
210
- When the user clicks "Add to Cart" on the second product in the sorted list
211
- Then the cart icon should update to show "2"
212
- And both products' buttons should show "Remove"
213
-
214
- When the user clicks the cart icon
215
- Then the cart page should open
216
- And both selected products should be listed
217
- And the quantities should be 1 for each
218
- And the total price should be the sum of both items
219
-
220
- When the user clicks "Remove" next to the first product
221
- Then that product should be removed from the cart
222
- And the cart should show only the second product
223
- And the cart icon should show "1"
224
-
225
- When the user clicks "Continue Shopping"
226
- Then the user should return to the products page
227
- And the cart icon should still show "1"
228
-
229
- When the user clicks the cart icon again
230
- Then the cart should still contain the remaining product
231
- And the user can proceed with checkout if desired
232
- `;
233
- await fs_extra_1.default.writeFile(path_1.default.join(projectRoot, "tests", "example.test.md"), exampleTestCase);
234
- console.log(chalk_1.default.green("✓ Created example test case"));
235
129
  // Create sample test cases
236
130
  const saucedemoSampleContent = `# SauceDemo Sample Test Cases
237
131
 
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;AAIA,8CAobC;AAxbD,gDAAwB;AACxB,wDAA0B;AAC1B,kDAA0B;AAEnB,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IACzD,MAAM,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE9C,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CACR,sDAAsD,WAAW,KAAK,CACvE,CACF,CAAC;QAEF,6BAA6B;QAC7B,MAAM,WAAW,GAAG;YAClB,OAAO;YACP,WAAW;YACX,cAAc;YACd,OAAO;YACP,mBAAmB;YACnB,mBAAmB;SACpB,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YAC5C,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,+BAA+B;QAC/B,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;CAa7B,CAAC;QACE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAC7D,MAAM,kBAAE,CAAC,SAAS,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;QAErD,uCAAuC;QACvC,MAAM,OAAO,GAAG,cAA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C,6BAA6B,CAAC,EAAE,KAAK,CAAC,CAAC;QAC/D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -57,7 +57,7 @@ class ClaudeProvider extends provider_1.LLMProvider {
57
57
  }
58
58
  async generateTestCode(prompt) {
59
59
  try {
60
- const systemPrompt = this.buildPrompt(prompt.testCase);
60
+ const systemPrompt = this.buildPrompt(prompt);
61
61
  const response = await axios_1.default.post(this.baseUrl, {
62
62
  model: "claude-haiku-4-5-20251001",
63
63
  max_tokens: 2000,
@@ -1 +1 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/llm/claude.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yCAAmE;AAEnE,MAAa,cAAe,SAAQ,sBAAW;IAI7C,YAAY,MAAc;QACxB,KAAK,EAAE,CAAC;QAHF,YAAO,GAAG,uCAAuC,CAAC;QAIxD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,IAAI,CAAC,OAAO,EACZ;gBACE,KAAK,EAAE,2BAA2B;gBAClC,UAAU,EAAE,GAAG;gBACf,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE,MAAM;qBAChB;iBACF;aACF,EACD;gBACE,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI,CAAC,MAAM;oBACxB,mBAAmB,EAAE,YAAY;oBACjC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,OAA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,IAAI,EAAE;gBAChG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;YAElB,IACE,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG;gBAC9B,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,KAAK,iBAAiB,EACtD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,4DAA4D;oBAC1D,+DAA+D;oBAC/D,uGAAuG;oBACvG,2EAA2E,CAC9E,CAAC;YACJ,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,YAAY,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAzHD,wCAyHC"}
@@ -33,7 +33,7 @@ class CopilotProvider extends provider_1.LLMProvider {
33
33
  }
34
34
  async generateTestCode(prompt) {
35
35
  try {
36
- const systemPrompt = this.buildPrompt(prompt.testCase);
36
+ const systemPrompt = this.buildPrompt(prompt);
37
37
  const response = await axios_1.default.post(this.baseUrl, {
38
38
  prompt: systemPrompt,
39
39
  max_tokens: 2000,
@@ -1 +1 @@
1
- {"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/llm/copilot.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yCAAmE;AAEnE,MAAa,eAAgB,SAAQ,sBAAW;IAI9C,YAAY,MAAc;QACxB,KAAK,EAAE,CAAC;QAHF,YAAO,GAAG,wDAAwD,CAAC;QAIzE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,IAAI,CAAC,OAAO,EACZ,EAAE,MAAM,EAAE,MAAM,EAAE,EAClB;gBACE,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU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,EAAE,IAAI;gBAChB,WAAW,EAAE,GAAG;aACjB,EACD;gBACE,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;oBACtC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,OAAO,EAAE,KAAK;aACf,CACF,CAAC;YAEF,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;YAE7D,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;YACjD,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,KAAK,EAAE,SAAS;gBAChB,UAAU,EAAE,MAAM,CAAC,UAAU;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,yCAAyC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAClG,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAtED,0CAsEC"}
@@ -12,6 +12,6 @@ export interface GeneratedCode {
12
12
  export declare abstract class LLMProvider {
13
13
  abstract generateTestCode(prompt: LLMPrompt): Promise<GeneratedCode>;
14
14
  abstract validateConnection(): Promise<boolean>;
15
- protected buildPrompt(testCaseContent: string): string;
15
+ protected buildPrompt(prompt: LLMPrompt): string;
16
16
  }
17
17
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/llm/provider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,8BAAsB,WAAW;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IACpE,QAAQ,CAAC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAE/C,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;CAkBvD"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/llm/provider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,8BAAsB,WAAW;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IACpE,QAAQ,CAAC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAE/C,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;CAoBjD"}
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LLMProvider = void 0;
4
4
  class LLMProvider {
5
- buildPrompt(testCaseContent) {
5
+ buildPrompt(prompt) {
6
+ const tagString = prompt.tags.map(t => `[${t}]`).join(' ');
6
7
  return `You are an expert Playwright test automation engineer.
7
8
  Generate Playwright TypeScript test code based on the following natural language test case.
8
9
  The generated code should:
@@ -11,12 +12,13 @@ The generated code should:
11
12
  - Handle element waits automatically (Playwright auto-waits)
12
13
  - Be readable and maintainable
13
14
  - Include comments explaining complex steps
15
+ - The test title MUST start with the tags in this exact format: '${tagString} <description>'
14
16
 
15
17
  Natural language test case:
16
- ${testCaseContent}
18
+ ${prompt.testCase}
17
19
 
18
20
  Generate ONLY the test function code, without explanations. Use this format:
19
- test('Test Description', async ({ page }) => {
21
+ test('${tagString} Test Description', async ({ page }) => {
20
22
  // Your test code here
21
23
  });`;
22
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/llm/provider.ts"],"names":[],"mappings":";;;AAaA,MAAsB,WAAW;IAIrB,WAAW,CAAC,eAAuB;QAC3C,OAAO;;;;;;;;;;EAUT,eAAe;;;;;IAKb,CAAC;IACH,CAAC;CACF;AAtBD,kCAsBC"}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/llm/provider.ts"],"names":[],"mappings":";;;AAaA,MAAsB,WAAW;IAIrB,WAAW,CAAC,MAAiB;QACrC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3D,OAAO;;;;;;;;mEAQwD,SAAS;;;EAG1E,MAAM,CAAC,QAAQ;;;QAGT,SAAS;;IAEb,CAAC;IACH,CAAC;CACF;AAxBD,kCAwBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhiweiliu/playwright-generator",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Generate Playwright test cases from natural language using LLM",
5
5
  "main": "dist/index.js",
6
6
  "bin": {