Skip to content

Commit cf87904

Browse files
committed
initial commit
0 parents  commit cf87904

221 files changed

Lines changed: 78606 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
# editorconfig-tools is unable to ignore longs strings or urls
11+
max_line_length = null
12+
quote_type = single

.eslintrc.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2020": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"@apify/eslint-config-ts"
10+
],
11+
"parserOptions": {
12+
"project": "./tsconfig.eslint.json",
13+
"ecmaVersion": 2020
14+
},
15+
"plugins": [
16+
"@typescript-eslint"
17+
],
18+
"ignorePatterns": [
19+
"node_modules",
20+
"dist",
21+
"coverage",
22+
"**/*.js",
23+
"**/*.d.ts"
24+
],
25+
"rules": {
26+
"no-void": 0,
27+
"no-console": "error",
28+
"@typescript-eslint/array-type": "error",
29+
"@typescript-eslint/no-floating-promises": "error",
30+
"@typescript-eslint/ban-ts-comment": 0,
31+
"@typescript-eslint/no-unused-vars": "off",
32+
"@typescript-eslint/no-empty-interface": "off",
33+
"@typescript-eslint/no-explicit-any": "off",
34+
"@typescript-eslint/no-empty-function": "off",
35+
"import/no-extraneous-dependencies": "off",
36+
"@typescript-eslint/member-delimiter-style": ["error", {
37+
"multiline": { "delimiter": "semi", "requireLast": true },
38+
"singleline": { "delimiter": "semi", "requireLast": false }
39+
}]
40+
}
41+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Add an example of code that produces the problem you're reporting.
15+
We should be able to copy your code, run it and get the same result.
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**System information:**
21+
- OS: [e.g. MacOS]
22+
- Node.js version [e.g. 14.7]
23+
- Apify SDK version [e.g. 0.20.4]
24+
25+
**Additional context**
26+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: For new things and improvements that are not bugs.
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature**
11+
A clear and concise description of what feature you're requesting.
12+
13+
**Motivation**
14+
Why would you like to have this feature in the SDK. How would you use it? How would it help you?
15+
16+
**Constraints**
17+
Are there any requirements or limits to the feature that need to be satisfied?

.github/ISSUE_TEMPLATE/question.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Question
3+
about: When you need help with something.
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
Please submit new issues for new feature requests and bug reports only.
11+
For questions please join Apify Discord. You could get help from Apify team members and the community there.
12+
13+
- [Discord](https://discord.gg/jyEM2PRvMU)
14+
15+
Please also make sure that you visit all the relevant information sources and use search there.
16+
17+
- [SDK Documentation](https://sdk.apify.com)
18+
- [Our Stack Overflow](https://stackoverflow.com/tags/apify/)
19+
- [Apify Platform Docs](https://docs.apify.com)
20+
- [Apify Help](https://help.apify.com)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check PR title
2+
3+
on:
4+
pull_request_target:
5+
types: [ opened, edited, synchronize ]
6+
7+
jobs:
8+
check_pr_title:
9+
name: 'Check PR title'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: amannn/action-semantic-pull-request@v4.2.0
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Use Node.js 16
15+
uses: actions/setup-node@v2-beta
16+
with:
17+
node-version: 16
18+
19+
- name: Set git identity
20+
run: |
21+
git config --global user.name "Martin Adámek"
22+
git config --global user.email "martin@apify.com"
23+
24+
# - name: Cache node_modules
25+
# uses: actions/cache@v2
26+
# with:
27+
# path: '**/node_modules'
28+
# key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
29+
30+
- name: Build & deploy docs
31+
run: |
32+
# install project deps
33+
npm install --force
34+
# go to website dir
35+
cd website
36+
# install website deps
37+
npm install --force
38+
# build and deploy the docs
39+
npm run deploy
40+
env:
41+
GIT_USER: "B4nan:${{ secrets.GH_TOKEN }}"
42+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Check & Release
2+
3+
on:
4+
# Push to master will deploy a dev version
5+
push:
6+
branches: [ master, renovate/** ]
7+
# PR to master branch will skip deployment
8+
pull_request:
9+
branches: [ master ]
10+
# A release via GitHub releases will deploy the latest version
11+
release:
12+
types: [ published ]
13+
14+
jobs:
15+
# NPM install is done in a separate job and cached to speed up the following jobs.
16+
build_and_test:
17+
name: Build & Test
18+
if: (!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:'))
19+
runs-on: ${{ matrix.os }}
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
# tests on windows are extremely unstable
25+
# os: [ ubuntu-latest, windows-2019 ]
26+
os: [ ubuntu-latest ]
27+
node-version: [ 16, 18 ]
28+
29+
steps:
30+
- name: Cancel Workflow Action
31+
uses: styfle/cancel-workflow-action@0.9.1
32+
with:
33+
access_token: ${{ github.token }}
34+
35+
- name: Checkout repository
36+
uses: actions/checkout@v3
37+
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
cache: 'npm'
43+
cache-dependency-path: 'package-lock.json'
44+
45+
- uses: microsoft/playwright-github-action@v1
46+
47+
- name: Turbo cache
48+
id: turbo-cache
49+
uses: actions/cache@v2
50+
with:
51+
path: .turbo
52+
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
53+
restore-keys: |
54+
turbo-${{ github.job }}-${{ github.ref_name }}-
55+
56+
- name: Install Dependencies
57+
run: npm ci
58+
59+
- name: Build
60+
run: npm run ci:build
61+
62+
- name: Tests
63+
run: npm test
64+
65+
lint:
66+
name: Lint
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v3
72+
73+
- name: Use Node.js 16
74+
uses: actions/setup-node@v3
75+
with:
76+
node-version: 16
77+
cache: 'npm'
78+
cache-dependency-path: 'package-lock.json'
79+
80+
- name: Turbo cache
81+
id: turbo-cache
82+
uses: actions/cache@v2
83+
with:
84+
path: .turbo
85+
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
86+
restore-keys: |
87+
turbo-${{ github.job }}-${{ github.ref_name }}-
88+
89+
- name: Install Dependencies
90+
run: npm ci
91+
92+
- name: ESLint
93+
run: npm run lint
94+
95+
publish:
96+
name: Publish
97+
if: (github.ref == 'refs/heads/master' || github.event_name == 'release') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:')
98+
runs-on: ubuntu-latest
99+
needs: [ lint, build_and_test ]
100+
steps:
101+
- name: Checkout Source code
102+
uses: actions/checkout@v3
103+
104+
- name: Use Node.js 16
105+
uses: actions/setup-node@v3
106+
with:
107+
node-version: 16
108+
cache: 'npm'
109+
cache-dependency-path: 'package-lock.json'
110+
111+
- name: Turbo cache
112+
id: turbo-cache
113+
uses: actions/cache@v2
114+
with:
115+
path: .turbo
116+
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
117+
restore-keys: |
118+
turbo-${{ github.job }}-${{ github.ref_name }}-
119+
120+
- name: Install Dependencies
121+
run: npm ci
122+
123+
- name: Check for changes
124+
id: changed_packages
125+
run: |
126+
echo "::set-output name=changed_packages::$(node ./node_modules/.bin/lerna changed -p | wc -l | xargs)"
127+
128+
- name: Check for changes 2
129+
if: steps.changed_packages.outputs.changed_packages == '0'
130+
run: |
131+
echo "no changes detected by lerna"
132+
133+
- name: Build
134+
if: steps.changed_packages.outputs.changed_packages != '0'
135+
run: npm run build
136+
137+
- name: Set Release Tag
138+
run: echo "RELEASE_TAG=$(if [ ${{ github.event_name }} = release ]; then echo latest; else echo next; fi)" >> $GITHUB_ENV
139+
140+
- name: Release dev version for testing
141+
if: env.RELEASE_TAG == 'next' && steps.changed_packages.outputs.changed_packages != '0'
142+
run: |
143+
git config --global user.name 'Apify Release Bot'
144+
git config --global user.email 'noreply@apify.com'
145+
npx turbo run copy --force -- -- --canary --preid=beta
146+
git commit -am 'chore: bump canary versions [skip ci]'
147+
148+
echo "access=public" >> .npmrc
149+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
150+
npm run publish:next -- --yes --no-verify-access
151+
env:
152+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
153+
GIT_USER: "noreply@apify.com:${{ secrets.GH_TOKEN }}"
154+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
build
2+
dist
3+
build-docs
4+
node_modules
5+
*.log
6+
*.pid
7+
*.seed
8+
.DS_Store
9+
lib
10+
coverage
11+
.nyc_output
12+
logs
13+
pids
14+
.idea
15+
.vscode
16+
yarn.lock
17+
tmp
18+
jsconfig.json
19+
types
20+
docs/api
21+
docs/typedefs
22+
.history
23+
.docusaurus
24+
tsconfig.tsbuildinfo
25+
apify_storage
26+
crawlee_storage
27+
.turbo

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Keep empty .npmignore file here so that /build is not ignored by "npm publish"
2+
# as it is in .gitignore file. Yes, this happened in older versions of NPM.
3+
# See https://docs.npmjs.com/misc/developers for info.

0 commit comments

Comments
 (0)