Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

test: add workflow to test TS support (#1079)

Martin Adámek34f119cee953
diff --git a/.github/workflows/check-ts-support.yml b/.github/workflows/check-ts-support.yml
new file mode 100644
index 000000000..088e5de82
--- /dev/null
+++ b/.github/workflows/check-ts-support.yml
@@ -0,0 +1,28 @@
+# This workflow runs for every PR or push to master, verifying the TS typings allow successful compilation.
+
+name: Check TS support
+
+on:
+ pull_request:
+ push:
+ branches: [ master ]
+
+jobs:
+ check:
+ name: Check TS support
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v1
+ with:
+ node-version: 14
+ registry-url: https://registry.npmjs.org/
+ - name: Check TS support
+ run: |
+ npm install # install SDK deps
+ yarn link # link the local version of SDK
+ cd ts-check # go to the TS skeleton project directory
+ yarn # install its deps
+ yarn link apify # link local SDK version to the skeleton project
+ tsc -p tsconfig.json # build the TS project
+ node dist/index.js # run the built project
diff --git a/.gitignore b/.gitignore
index b16e17eab..4b8165815 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
build
+dist
build-docs
node_modules
*.log
diff --git a/ts-check/package.json b/ts-check/package.json
new file mode 100644
index 000000000..49b0161fb
--- /dev/null
+++ b/ts-check/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "ts-check",
+ "version": "1.0.0",
+ "main": "index.js",
+ "license": "MIT",
+ "devDependencies": {
+ "typescript": "^4.3.4"
+ }
+}
diff --git a/ts-check/src/index.ts b/ts-check/src/index.ts
new file mode 100644
index 000000000..202e5ea75
--- /dev/null
+++ b/ts-check/src/index.ts
@@ -0,0 +1,6 @@
+import { Apify } from 'apify';
+
+const sdk = new Apify();
+sdk.main(async () => {
+ // just to see we can actually build such skeleton project...
+}).then();
diff --git a/ts-check/tsconfig.json b/ts-check/tsconfig.json
new file mode 100644
index 000000000..30da93175
--- /dev/null
+++ b/ts-check/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "target": "es2018",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "strict": true,
+ "noImplicitAny": false,
+ "strictNullChecks": false,
+ "allowSyntheticDefaultImports": true,
+ "rootDir": "src",
+ "outDir": "dist"
+ }
+}
+