at-builder 1.2.5 → 1.2.6
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/.eslintrc +2 -1
- package/package.json +2 -2
- package/plopfile.js +0 -3
- package/puppeteer.js +4 -8
package/.eslintrc
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "at-builder",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"main": "bin/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"atb": "bin/index.js"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:atb:dev": "tsc -w",
|
|
11
11
|
"atb:build:prod": "cross-env NODE_ENV=production webpack",
|
|
12
12
|
"atb:build:dev": "webpack -- -w",
|
|
13
|
-
"atb:build:dev:puppeteer": "webpack -- -w & npm run puppeteer",
|
|
13
|
+
"atb:build:dev:puppeteer": "webpack -- -w & npm run atb:puppeteer",
|
|
14
14
|
"atb:puppeteer": "node puppeteer.js $b",
|
|
15
15
|
"atb:plop:new:activity": "plop page",
|
|
16
16
|
"atb:build:deploy": "node lib/at-deploy.js"
|
package/plopfile.js
CHANGED
package/puppeteer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
1
2
|
import dotenv from 'dotenv';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import puppeteer from 'puppeteer';
|
|
4
5
|
import fs from 'fs';
|
|
5
6
|
import chokidar from 'chokidar';
|
|
6
|
-
|
|
7
|
+
const executionPath = process.env.executionPath || process.cwd();
|
|
7
8
|
dotenv.config({ path: path.join(executionPath, ".env") });
|
|
8
|
-
//const watchConfig = "./../watch-config.json";
|
|
9
9
|
|
|
10
10
|
let watchConfig = '';
|
|
11
11
|
try {
|
|
@@ -43,18 +43,13 @@ const watcher = chokidar.watch("file", {
|
|
|
43
43
|
await this.page.$eval('#pwd', el => el.value = '');
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async autoFillLoginDetails() {
|
|
47
|
-
await this.page.$eval('#email', el => el.value = '');
|
|
48
|
-
await this.page.$eval('#pwd', el => el.value = '');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
46
|
async openTab() {
|
|
52
47
|
this.page = await this.browser.pages();
|
|
53
48
|
this.page = this.page[0];
|
|
54
49
|
this.page.setDefaultTimeout(3e8);
|
|
55
50
|
// await this.page.setViewport({ width: 1792, height: 768 });
|
|
56
51
|
await this.page.setViewport({ width: 1920, height: 1080 });
|
|
57
|
-
await this.page.goto(process.env.PUPPETEER_LANDING_PAGE);
|
|
52
|
+
await this.page.goto(process.env.PUPPETEER_LANDING_PAGE || "https://www.google.com");
|
|
58
53
|
|
|
59
54
|
// inject script
|
|
60
55
|
this.injectCodeSnippet();
|
|
@@ -69,6 +64,7 @@ const watcher = chokidar.watch("file", {
|
|
|
69
64
|
|
|
70
65
|
await this.page.reload();
|
|
71
66
|
this.injectCodeSnippet();
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
68
|
} catch (error) {
|
|
73
69
|
|
|
74
70
|
}
|