@koalarx/scrapping 2.0.0 → 2.0.3
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/@types/browser-config.d.ts +8 -0
- package/@types/browser-config.js +2 -0
- package/@types/dom-options.d.ts +4 -0
- package/@types/dom-options.js +2 -0
- package/@types/get-datatable-options.d.ts +9 -0
- package/@types/get-datatable-options.js +2 -0
- package/Browser.d.ts +11 -0
- package/Browser.js +65 -0
- package/Dom.d.ts +21 -0
- package/Dom.js +103 -0
- package/Frame.d.ts +5 -0
- package/Frame.js +10 -0
- package/Page.d.ts +8 -0
- package/Page.js +43 -0
- package/README.md +4 -4
- package/constants/args.d.ts +2 -0
- package/constants/args.js +42 -0
- package/package.json +7 -3
- package/.github/workflows/npm-publish.yml +0 -32
- package/.prettierrc.json +0 -9
- package/.vscode/launch.json +0 -13
- package/.vscode/mcp.json +0 -10
- package/.vscode/settings.json +0 -151
- package/.vscode/tasks.json +0 -17
- package/LICENSE +0 -21
- package/bun.lock +0 -749
- package/bunfig.toml +0 -7
- package/eslint.config.mts +0 -83
- package/lib/core/@types/browser-config.ts +0 -8
- package/lib/core/@types/dom-options.ts +0 -4
- package/lib/core/@types/get-datatable-options.ts +0 -9
- package/lib/core/Browser.ts +0 -81
- package/lib/core/Dom.ts +0 -144
- package/lib/core/Frame.ts +0 -8
- package/lib/core/Page.ts +0 -56
- package/lib/core/constants/args.ts +0 -40
- package/lib/test/download-file.spec.ts +0 -18
- package/lib/test/frame-interaction.spec.ts +0 -22
- package/lib/test/get-datatable-with-paginator.spec.ts +0 -31
- package/lib/test/search-wikipidea.spec.ts +0 -18
- package/lib/test/setup.ts +0 -14
- package/lib/test/vars.ts +0 -7
- package/scripts/README.md +0 -209
- package/scripts/create-version-tag.ps1 +0 -83
- package/scripts/create-version-tag.sh +0 -91
- package/scripts/hooks/post-commit +0 -118
- package/scripts/hooks/post-commit-windows.bat +0 -80
- package/scripts/hooks/post-commit.bat +0 -15
- package/scripts/hooks/post-commit.ps1 +0 -101
- package/scripts/hooks/post-merge +0 -66
- package/scripts/hooks/pre-commit +0 -82
- package/scripts/hooks/pre-commit-windows.bat +0 -68
- package/scripts/hooks/pre-commit.bat +0 -15
- package/scripts/setup-hooks.bat +0 -107
- package/scripts/setup-hooks.ps1 +0 -69
- package/scripts/setup-hooks.sh +0 -44
- package/scripts/test-linux-support.sh +0 -171
- package/scripts/version-dialog.ps1 +0 -137
- package/scripts/version-dialog.sh +0 -139
- package/tsconfig.build.json +0 -31
- package/tsconfig.json +0 -40
package/Browser.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BrowserConfig } from './@types/browser-config';
|
|
2
|
+
import { Page } from './Page';
|
|
3
|
+
export declare class Browser {
|
|
4
|
+
private config;
|
|
5
|
+
private _browser?;
|
|
6
|
+
private _page?;
|
|
7
|
+
constructor(config: BrowserConfig);
|
|
8
|
+
get page(): Page;
|
|
9
|
+
init(): Promise<this>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
}
|
package/Browser.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Browser = void 0;
|
|
4
|
+
const puppeteer_1 = require("puppeteer");
|
|
5
|
+
const args_1 = require("./constants/args");
|
|
6
|
+
const Page_1 = require("./Page");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
class Browser {
|
|
9
|
+
config;
|
|
10
|
+
_browser;
|
|
11
|
+
_page;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
get page() {
|
|
16
|
+
if (!this._page) {
|
|
17
|
+
throw new Error('DOM is not lauched. Certificate you call init method.');
|
|
18
|
+
}
|
|
19
|
+
return this._page;
|
|
20
|
+
}
|
|
21
|
+
async init() {
|
|
22
|
+
const { headless, proxy, minimalist, slowMo } = this.config;
|
|
23
|
+
const downloadPath = this.config.downloadFolderPath ?? './downloads';
|
|
24
|
+
if (!(0, node_fs_1.existsSync)(downloadPath)) {
|
|
25
|
+
(0, node_fs_1.mkdirSync)(downloadPath);
|
|
26
|
+
}
|
|
27
|
+
const args = args_1.BROWSER_ARGS.concat(proxy ? [`--proxy-server=${proxy}`] : []).concat(headless ? [] : ['--start-maximized']);
|
|
28
|
+
const browser = await puppeteer_1.default.launch({
|
|
29
|
+
args,
|
|
30
|
+
headless,
|
|
31
|
+
defaultViewport: null,
|
|
32
|
+
slowMo,
|
|
33
|
+
downloadBehavior: {
|
|
34
|
+
policy: 'allow',
|
|
35
|
+
downloadPath,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const page = await browser.pages().then((pages) => pages[0]);
|
|
39
|
+
if (minimalist) {
|
|
40
|
+
page.removeAllListeners('request');
|
|
41
|
+
await page.setRequestInterception(true);
|
|
42
|
+
page.on('request', (req) => {
|
|
43
|
+
if (req.resourceType() === 'stylesheet' ||
|
|
44
|
+
req.resourceType() === 'font' ||
|
|
45
|
+
req.resourceType() === 'image') {
|
|
46
|
+
req.abort();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
req.continue();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
this._browser = browser;
|
|
54
|
+
this._page = new Page_1.Page(page);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
async close() {
|
|
58
|
+
if (!this._browser) {
|
|
59
|
+
throw new Error('Browser is not lauched. Certificate you call init method.');
|
|
60
|
+
}
|
|
61
|
+
await this._page.close();
|
|
62
|
+
await this._browser.close();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Browser = Browser;
|
package/Dom.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KeyInput, Page } from 'puppeteer';
|
|
2
|
+
import { Frame as PuppeteerFrame } from 'puppeteer';
|
|
3
|
+
import type { DOMOptions } from './@types/dom-options';
|
|
4
|
+
import type { GetDatatableOptions } from './@types/get-datatable-options';
|
|
5
|
+
export declare class DOM {
|
|
6
|
+
private readonly _page;
|
|
7
|
+
private readonly _options?;
|
|
8
|
+
constructor(_page: Page | PuppeteerFrame, _options?: DOMOptions);
|
|
9
|
+
protected get page(): Page;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
screenshot(): Promise<void>;
|
|
12
|
+
pressKey(key: KeyInput, combine?: KeyInput): Promise<void>;
|
|
13
|
+
goTo(url: string): Promise<void>;
|
|
14
|
+
fill(selector: string, value: string): Promise<void>;
|
|
15
|
+
click(selector: string): Promise<void>;
|
|
16
|
+
focus(selector: string): Promise<void>;
|
|
17
|
+
content(selector: string): Promise<string[]>;
|
|
18
|
+
getDatatable<T = any>(selector: string, options?: GetDatatableOptions): Promise<T[]>;
|
|
19
|
+
waitNavigation(): Promise<void>;
|
|
20
|
+
getDownloadedFiles(): Promise<Buffer<ArrayBufferLike>[]>;
|
|
21
|
+
}
|
package/Dom.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOM = void 0;
|
|
4
|
+
const utils_1 = require("@koalarx/utils");
|
|
5
|
+
const html_table_to_json_1 = require("html-table-to-json");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const puppeteer_1 = require("puppeteer");
|
|
9
|
+
class DOM {
|
|
10
|
+
_page;
|
|
11
|
+
_options;
|
|
12
|
+
constructor(_page, _options) {
|
|
13
|
+
this._page = _page;
|
|
14
|
+
this._options = _options;
|
|
15
|
+
}
|
|
16
|
+
get page() {
|
|
17
|
+
return this._page instanceof puppeteer_1.Frame ? this._page.page() : this._page;
|
|
18
|
+
}
|
|
19
|
+
async close() {
|
|
20
|
+
await this.page.close();
|
|
21
|
+
}
|
|
22
|
+
async screenshot() {
|
|
23
|
+
const folderPath = this._options?.screenshotFolderPath ?? './screenshots';
|
|
24
|
+
if (!(0, node_fs_1.existsSync)(folderPath)) {
|
|
25
|
+
(0, node_fs_1.mkdirSync)(folderPath);
|
|
26
|
+
}
|
|
27
|
+
const screenshotPath = node_path_1.default.join(folderPath, `${new utils_1.KlDate().format('ddMMyyyyHHmmss')}.jpg`);
|
|
28
|
+
await this.page.screenshot({ path: screenshotPath });
|
|
29
|
+
}
|
|
30
|
+
async pressKey(key, combine) {
|
|
31
|
+
if (combine) {
|
|
32
|
+
await this.page.keyboard.down(combine);
|
|
33
|
+
}
|
|
34
|
+
await this.page.keyboard.press(key);
|
|
35
|
+
}
|
|
36
|
+
async goTo(url) {
|
|
37
|
+
await this._page.goto(url, { waitUntil: 'networkidle2' });
|
|
38
|
+
}
|
|
39
|
+
async fill(selector, value) {
|
|
40
|
+
await this._page.locator(selector).scroll();
|
|
41
|
+
await this._page.focus(selector);
|
|
42
|
+
await this._page.locator(selector).fill(value);
|
|
43
|
+
}
|
|
44
|
+
async click(selector) {
|
|
45
|
+
await this._page.locator(selector).scroll();
|
|
46
|
+
await this._page.click(selector);
|
|
47
|
+
}
|
|
48
|
+
async focus(selector) {
|
|
49
|
+
await this._page.locator(selector).scroll();
|
|
50
|
+
await this._page.focus(selector);
|
|
51
|
+
}
|
|
52
|
+
async content(selector) {
|
|
53
|
+
await this._page.locator(selector).scroll();
|
|
54
|
+
return this._page.$$eval(selector, (elements) => {
|
|
55
|
+
return elements.map((el) => el.innerText.trim());
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async getDatatable(selector, options) {
|
|
59
|
+
const table = await this._page.$eval(selector, (table) => table.outerHTML);
|
|
60
|
+
const tableData = html_table_to_json_1.default.parse(table).results[0];
|
|
61
|
+
const result = tableData.map((row) => {
|
|
62
|
+
const rowData = {};
|
|
63
|
+
Object.keys(row).forEach((key) => {
|
|
64
|
+
const value = row[key];
|
|
65
|
+
const numberValue = Number(value);
|
|
66
|
+
rowData[(0, utils_1.toCamelCase)(key)] = isNaN(numberValue) ? value : numberValue;
|
|
67
|
+
});
|
|
68
|
+
return rowData;
|
|
69
|
+
});
|
|
70
|
+
if (options?.withPagination) {
|
|
71
|
+
const nextButtonSelector = options.withPagination.nextButtonSelector;
|
|
72
|
+
const nextButton = await this._page.$(nextButtonSelector);
|
|
73
|
+
if (nextButton &&
|
|
74
|
+
!(await nextButton.evaluate((btn) => btn.classList.contains('disabled') || btn.hasAttribute('disabled')))) {
|
|
75
|
+
await nextButton.click();
|
|
76
|
+
const nextPageData = await this.getDatatable(selector, options);
|
|
77
|
+
result.push(...nextPageData);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
async waitNavigation() {
|
|
83
|
+
await this._page
|
|
84
|
+
.waitForNavigation({ waitUntil: 'domcontentloaded', timeout: 5000 })
|
|
85
|
+
.catch(() => null);
|
|
86
|
+
}
|
|
87
|
+
async getDownloadedFiles() {
|
|
88
|
+
const downloadPath = this._options?.downloadFolderPath ?? './downloads';
|
|
89
|
+
if ((0, node_fs_1.existsSync)(downloadPath)) {
|
|
90
|
+
let contentDir = [];
|
|
91
|
+
do {
|
|
92
|
+
await (0, utils_1.delay)(1000);
|
|
93
|
+
contentDir = (0, node_fs_1.readdirSync)(downloadPath);
|
|
94
|
+
} while (contentDir.filter((filepath) => filepath.indexOf('.crdownload') >= 0)
|
|
95
|
+
.length > 0);
|
|
96
|
+
const files = [];
|
|
97
|
+
contentDir.forEach((filepath) => files.push((0, node_fs_1.readFileSync)(`${downloadPath}/${filepath}`)));
|
|
98
|
+
return files;
|
|
99
|
+
}
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.DOM = DOM;
|
package/Frame.d.ts
ADDED
package/Frame.js
ADDED
package/Page.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Page as PuppeteerPage } from 'puppeteer';
|
|
2
|
+
import { DOM } from './Dom';
|
|
3
|
+
import { Frame } from './Frame';
|
|
4
|
+
export declare class Page extends DOM {
|
|
5
|
+
constructor(page: PuppeteerPage);
|
|
6
|
+
getFrameByURL(url: string): Promise<Frame>;
|
|
7
|
+
getFrameByName(name: string): Promise<Frame>;
|
|
8
|
+
}
|
package/Page.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Page = void 0;
|
|
4
|
+
const Dom_1 = require("./Dom");
|
|
5
|
+
const Frame_1 = require("./Frame");
|
|
6
|
+
class Page extends Dom_1.DOM {
|
|
7
|
+
constructor(page) {
|
|
8
|
+
super(page);
|
|
9
|
+
}
|
|
10
|
+
async getFrameByURL(url) {
|
|
11
|
+
const frames = this.page.frames();
|
|
12
|
+
const frame = frames.find((frame) => frame.url() === url);
|
|
13
|
+
if (!frame) {
|
|
14
|
+
throw new Error(`Frame with URL "${url}" not found`);
|
|
15
|
+
}
|
|
16
|
+
return new Frame_1.Frame(frame);
|
|
17
|
+
}
|
|
18
|
+
async getFrameByName(name) {
|
|
19
|
+
const frames = this.page.frames();
|
|
20
|
+
let frame;
|
|
21
|
+
for (const f of frames) {
|
|
22
|
+
const frameElement = await f.frameElement();
|
|
23
|
+
if (!frameElement) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const frameName = await frameElement.evaluate((el) => el.getAttribute('name'));
|
|
27
|
+
if (frameName === name) {
|
|
28
|
+
frame = f;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
const frameId = await frameElement.evaluate((el) => el.getAttribute('id'));
|
|
32
|
+
if (frameId === name) {
|
|
33
|
+
frame = f;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (!frame) {
|
|
38
|
+
throw new Error(`Frame with name "${name}" not found`);
|
|
39
|
+
}
|
|
40
|
+
return new Frame_1.Frame(frame);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Page = Page;
|
package/README.md
CHANGED
|
@@ -128,7 +128,7 @@ const dados = await page.getDatatable<DadosTabela>('#example', {
|
|
|
128
128
|
// Extrai todas as páginas automaticamente!
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
📝 **Exemplo prático:** Ver [get-datatable.spec.ts](lib/test/get-datatable.spec.ts)
|
|
131
|
+
📝 **Exemplo prático:** Ver [get-datatable-with-paginator.spec.ts](https://github.com/igordrangel/koala-scrapping/blob/main/lib/test/get-datatable-with-paginator.spec.ts)
|
|
132
132
|
|
|
133
133
|
### Download de Arquivos
|
|
134
134
|
|
|
@@ -141,7 +141,7 @@ const arquivos = await page.getDownloadedFiles()
|
|
|
141
141
|
console.log(arquivos[0]) // Buffer do arquivo
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
📝 **Exemplo prático:** Ver [download-file.spec.ts](lib/test/download-file.spec.ts)
|
|
144
|
+
📝 **Exemplo prático:** Ver [download-file.spec.ts](https://github.com/igordrangel/koala-scrapping/blob/main/lib/test/download-file.spec.ts)
|
|
145
145
|
|
|
146
146
|
### Interação com Frames e iFrames
|
|
147
147
|
|
|
@@ -181,7 +181,7 @@ const conteudo = await frame.content('#resultado p')
|
|
|
181
181
|
console.log(conteudo)
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
📝 **Exemplo prático:** Ver [frame-interaction.spec.ts](lib/test/frame-interaction.spec.ts)
|
|
184
|
+
📝 **Exemplo prático:** Ver [frame-interaction.spec.ts](https://github.com/igordrangel/koala-scrapping/blob/main/lib/test/frame-interaction.spec.ts)
|
|
185
185
|
|
|
186
186
|
### Web Scraping Completo
|
|
187
187
|
|
|
@@ -210,7 +210,7 @@ const conteudo = await page.content('#mw-content-text p')
|
|
|
210
210
|
console.log(conteudo) // Array com paragrafos
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
📝 **Exemplo prático:** Ver [search-wikipidea.spec.ts](lib/test/search-wikipidea.spec.ts)
|
|
213
|
+
📝 **Exemplo prático:** Ver [search-wikipidea.spec.ts](https://github.com/igordrangel/koala-scrapping/blob/main/lib/test/search-wikipidea.spec.ts)
|
|
214
214
|
|
|
215
215
|
## Configuração Avançada
|
|
216
216
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BROWSER_ARGS = void 0;
|
|
4
|
+
const utils_1 = require("@koalarx/utils");
|
|
5
|
+
exports.BROWSER_ARGS = new utils_1.KlArray([
|
|
6
|
+
'--autoplay-policy=user-gesture-required',
|
|
7
|
+
'--disable-background-networking',
|
|
8
|
+
'--disable-background-timer-throttling',
|
|
9
|
+
'--disable-backgrounding-occluded-windows',
|
|
10
|
+
'--disable-breakpad',
|
|
11
|
+
'--disable-client-side-phishing-detection',
|
|
12
|
+
'--disable-component-update',
|
|
13
|
+
'--disable-default-apps',
|
|
14
|
+
'--disable-dev-shm-usage',
|
|
15
|
+
'--disable-domain-reliability',
|
|
16
|
+
'--disable-features=AudioServiceOutOfProcess',
|
|
17
|
+
'--disable-hang-monitor',
|
|
18
|
+
'--disable-ipc-flooding-protection',
|
|
19
|
+
'--disable-notifications',
|
|
20
|
+
'--disable-offer-store-unmasked-wallet-cards',
|
|
21
|
+
'--disable-popup-blocking',
|
|
22
|
+
'--disable-print-preview',
|
|
23
|
+
'--disable-prompt-on-repost',
|
|
24
|
+
'--disable-renderer-backgrounding',
|
|
25
|
+
'--disable-setuid-sandbox',
|
|
26
|
+
'--disable-speech-api',
|
|
27
|
+
'--disable-sync',
|
|
28
|
+
'--hide-scrollbars',
|
|
29
|
+
'--ignore-gpu-blacklist',
|
|
30
|
+
'--metrics-recording-only',
|
|
31
|
+
'--mute-audio',
|
|
32
|
+
'--no-default-browser-check',
|
|
33
|
+
'--no-first-run',
|
|
34
|
+
'--no-pings',
|
|
35
|
+
'--no-sandbox',
|
|
36
|
+
'--no-zygote',
|
|
37
|
+
'--password-store=basic',
|
|
38
|
+
'--use-gl=swiftshader',
|
|
39
|
+
'--use-mock-keychain',
|
|
40
|
+
'--disable-setuid-sandbox',
|
|
41
|
+
'-wait-for-browser',
|
|
42
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.
|
|
2
|
+
"version": "2.0.3",
|
|
3
3
|
"name": "@koalarx/scrapping",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "tsc -p tsconfig.build.json && cp README.md package.json dist"
|
|
6
|
+
"build": "tsc -p tsconfig.build.json && cp README.md package.json dist",
|
|
7
|
+
"prepare:hotfix": "bun pm version patch --no-git-tag-version",
|
|
8
|
+
"prepare:feature": "bun pm version minor --no-git-tag-version",
|
|
9
|
+
"prepare:release": "bun pm version major --no-git-tag-version",
|
|
10
|
+
"prepare:only-tag": "echo 'Creating tag without version bump'"
|
|
7
11
|
},
|
|
8
12
|
"devDependencies": {
|
|
9
13
|
"@eslint/js": "^10.0.1",
|
|
@@ -24,4 +28,4 @@
|
|
|
24
28
|
"html-table-to-json": "^1.0.0",
|
|
25
29
|
"puppeteer": "^24.37.2"
|
|
26
30
|
}
|
|
27
|
-
}
|
|
31
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: NPM PUBLISH
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
name: "npm publish library"
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- name: 🚚 Get latest code
|
|
11
|
-
uses: actions/checkout@v3
|
|
12
|
-
with:
|
|
13
|
-
ref: main
|
|
14
|
-
|
|
15
|
-
- name: Setup Bun
|
|
16
|
-
uses: oven-sh/setup-bun@v1
|
|
17
|
-
with:
|
|
18
|
-
bun-version: latest
|
|
19
|
-
|
|
20
|
-
- name: 🔨 Install Dependencies
|
|
21
|
-
run: bun ci
|
|
22
|
-
|
|
23
|
-
- name: 🔨 Build Project
|
|
24
|
-
run: bun run build
|
|
25
|
-
|
|
26
|
-
- name: 🔑 Configure NPM
|
|
27
|
-
run: npm config set "//registry.npmjs.org/:_authToken" "${{ secrets.NPM_TOKEN }}"
|
|
28
|
-
|
|
29
|
-
- name: 📚 Publish @koalarx/nest
|
|
30
|
-
run: npm publish
|
|
31
|
-
env:
|
|
32
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.prettierrc.json
DELETED
package/.vscode/launch.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"type": "bun",
|
|
6
|
-
"request": "launch",
|
|
7
|
-
"name": "Debug Bun File",
|
|
8
|
-
"program": "${file}", // This runs the currently active file
|
|
9
|
-
"cwd": "${workspaceFolder}",
|
|
10
|
-
"stopOnEntry": false // Set to true to pause on the first line
|
|
11
|
-
},
|
|
12
|
-
]
|
|
13
|
-
}
|
package/.vscode/mcp.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"material-icon-theme.activeIconPack": "nest",
|
|
3
|
-
"editor.fontFamily": "Fira Code",
|
|
4
|
-
"editor.fontSize": 15,
|
|
5
|
-
"editor.fontLigatures": true,
|
|
6
|
-
"emmet.syntaxProfiles": {
|
|
7
|
-
"javascript": "jsx"
|
|
8
|
-
},
|
|
9
|
-
"workbench.startupEditor": "newUntitledFile",
|
|
10
|
-
"javascript.suggest.autoImports": true,
|
|
11
|
-
"javascript.updateImportsOnFileMove.enabled": "always",
|
|
12
|
-
"editor.rulers": [80, 120],
|
|
13
|
-
"extensions.ignoreRecommendations": true,
|
|
14
|
-
"typescript.tsserver.log": "off",
|
|
15
|
-
"files.associations": {
|
|
16
|
-
".sequelizerc": "javascript",
|
|
17
|
-
".stylelintrc": "json",
|
|
18
|
-
"*.tsx": "typescriptreact",
|
|
19
|
-
".env.*": "dotenv",
|
|
20
|
-
".prettierrc": "json"
|
|
21
|
-
},
|
|
22
|
-
"editor.parameterHints.enabled": false,
|
|
23
|
-
"editor.renderLineHighlight": "gutter",
|
|
24
|
-
"editor.lineHeight": 26,
|
|
25
|
-
"editor.suggestSelection": "first",
|
|
26
|
-
"explorer.confirmDelete": false,
|
|
27
|
-
"gitlens.codeLens.recentChange.enabled": false,
|
|
28
|
-
"terminal.integrated.showExitAlert": false,
|
|
29
|
-
"[prisma]": {
|
|
30
|
-
"editor.formatOnSave": true
|
|
31
|
-
},
|
|
32
|
-
"typescript.suggest.autoImports": true,
|
|
33
|
-
"terminal.integrated.env.osx": {
|
|
34
|
-
"FIG_NEW_SESSION": "1"
|
|
35
|
-
},
|
|
36
|
-
"workbench.editor.labelFormat": "short",
|
|
37
|
-
"editor.acceptSuggestionOnCommitCharacter": false,
|
|
38
|
-
"explorer.compactFolders": false,
|
|
39
|
-
"git.enableSmartCommit": true,
|
|
40
|
-
"editor.accessibilitySupport": "off",
|
|
41
|
-
"explorer.confirmDragAndDrop": false,
|
|
42
|
-
"terminal.integrated.fontSize": 14,
|
|
43
|
-
"editor.semanticHighlighting.enabled": false,
|
|
44
|
-
"breadcrumbs.enabled": true,
|
|
45
|
-
"gitlens.codeLens.authors.enabled": false,
|
|
46
|
-
"editor.tabSize": 2,
|
|
47
|
-
"files.exclude": {
|
|
48
|
-
"**/CVS": true,
|
|
49
|
-
"**/.DS_Store": true,
|
|
50
|
-
"**/.hg": true,
|
|
51
|
-
"**/.svn": true,
|
|
52
|
-
"**/.git": true
|
|
53
|
-
},
|
|
54
|
-
"gitlens.codeLens.enabled": false,
|
|
55
|
-
"workbench.iconTheme": "material-icon-theme",
|
|
56
|
-
"material-icon-theme.languages.associations": {
|
|
57
|
-
"dotenv": "tune"
|
|
58
|
-
},
|
|
59
|
-
"material-icon-theme.files.associations": {
|
|
60
|
-
"vitest.config.e2e.ts": "vitest",
|
|
61
|
-
"*.e2e-spec.ts": "test-js",
|
|
62
|
-
"*.dto.ts": "diff",
|
|
63
|
-
"*.handler.ts": "esbuild",
|
|
64
|
-
"*.request.ts": "log",
|
|
65
|
-
"*.schema.ts": "scheme",
|
|
66
|
-
"*.response.ts": "conduct",
|
|
67
|
-
"*.validator.ts": "commitlint"
|
|
68
|
-
},
|
|
69
|
-
"material-icon-theme.folders.associations": {
|
|
70
|
-
"adapters": "contract",
|
|
71
|
-
"grpc": "pipe",
|
|
72
|
-
"kube": "kubernetes",
|
|
73
|
-
"main": "lib",
|
|
74
|
-
"websockets": "pipe",
|
|
75
|
-
"implementations": "core",
|
|
76
|
-
"protos": "pipe",
|
|
77
|
-
"entities": "class",
|
|
78
|
-
"kafka": "pipe",
|
|
79
|
-
"use-cases": "functions",
|
|
80
|
-
"migrations": "tools",
|
|
81
|
-
"schemas": "class",
|
|
82
|
-
"useCases": "functions",
|
|
83
|
-
"eslint-config": "tools",
|
|
84
|
-
"typeorm": "database",
|
|
85
|
-
"_shared": "shared",
|
|
86
|
-
"mappers": "meta",
|
|
87
|
-
"fakes": "mock",
|
|
88
|
-
"modules": "components",
|
|
89
|
-
"subscribers": "messages",
|
|
90
|
-
"domain": "class",
|
|
91
|
-
"protocols": "contract",
|
|
92
|
-
"infra": "app",
|
|
93
|
-
"view-models": "views",
|
|
94
|
-
"presentation": "template",
|
|
95
|
-
"dtos": "typescript",
|
|
96
|
-
"http": "container",
|
|
97
|
-
"providers": "include",
|
|
98
|
-
"factories": "class",
|
|
99
|
-
"repositories": "mappings",
|
|
100
|
-
"filters": "pipe"
|
|
101
|
-
},
|
|
102
|
-
"[javascript]": {
|
|
103
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
104
|
-
"editor.formatOnSave": true,
|
|
105
|
-
"editor.codeActionsOnSave": {
|
|
106
|
-
"source.fixAll.eslint": "explicit"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"[typescript]": {
|
|
110
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
111
|
-
"editor.formatOnSave": true,
|
|
112
|
-
"editor.codeActionsOnSave": {
|
|
113
|
-
"source.fixAll.eslint": "explicit"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"prettier.documentSelectors": ["**/*.ts", "**/*.tsx", "**/*.js"],
|
|
117
|
-
"terminal.integrated.defaultProfile.windows": "Command Prompt",
|
|
118
|
-
"git.confirmSync": false,
|
|
119
|
-
"files.eol": "\n",
|
|
120
|
-
"workbench.productIconTheme": "Default",
|
|
121
|
-
"npm.scriptExplorerAction": "run",
|
|
122
|
-
"npm.packageManager": "npm",
|
|
123
|
-
"editor.wordWrap": "on",
|
|
124
|
-
"editor.wrappingIndent": "indent",
|
|
125
|
-
"chat.mcp.serverSampling": {
|
|
126
|
-
"globo-seguros-api/.vscode/mcp.json: koala-nest-docs": {
|
|
127
|
-
"allowedModels": [
|
|
128
|
-
"copilot/claude-sonnet-4.5",
|
|
129
|
-
"copilot/auto",
|
|
130
|
-
"copilot/claude-haiku-4.5",
|
|
131
|
-
"copilot/claude-opus-4.5",
|
|
132
|
-
"copilot/claude-sonnet-4",
|
|
133
|
-
"copilot/gemini-2.5-pro",
|
|
134
|
-
"copilot/gemini-3-flash-preview",
|
|
135
|
-
"copilot/gemini-3-pro-preview",
|
|
136
|
-
"copilot/gpt-4.1",
|
|
137
|
-
"copilot/gpt-4o",
|
|
138
|
-
"copilot/gpt-5",
|
|
139
|
-
"copilot/gpt-5-mini",
|
|
140
|
-
"copilot/gpt-5-codex",
|
|
141
|
-
"copilot/gpt-5.1",
|
|
142
|
-
"copilot/gpt-5.1-codex",
|
|
143
|
-
"copilot/gpt-5.1-codex-max",
|
|
144
|
-
"copilot/gpt-5.1-codex-mini",
|
|
145
|
-
"copilot/gpt-5.2",
|
|
146
|
-
"copilot/gpt-5.2-codex",
|
|
147
|
-
"copilot/grok-code-fast-1"
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
package/.vscode/tasks.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"label": "bun: start:debug",
|
|
6
|
-
"type": "shell",
|
|
7
|
-
"command": "bun",
|
|
8
|
-
"args": ["run", "start:debug"],
|
|
9
|
-
"group": {
|
|
10
|
-
"kind": "build",
|
|
11
|
-
"isDefault": true
|
|
12
|
-
},
|
|
13
|
-
"problemMatcher": [],
|
|
14
|
-
"isBackground": true
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|