Skip to content

Commit

Permalink
update bun script
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsusac committed May 4, 2024
1 parent cbd3f88 commit eb6d59b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 16 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/data.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Update Data

on:
workflow_dispatch:
schedule:
# Every hour
- cron: '0 * * * *'
push:
paths:
- 'data/**'
- '.github/workflows/data.yml'
- 'scrape/**'
workflow_dispatch:
schedule:
# Every hour
- cron: "0 * * * *"
push:
paths:
- "data/**"
- ".github/workflows/data.yml"
- "scrape/**"

permissions:
contents: write

jobs:
data:
name: Check the repos
Expand All @@ -23,14 +23,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- run: |
git config --global user.name "Update Data"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "Update Data"
git config --global user.email "alfonsusac@gmail.com"
- run: bun scrape/images.ts

15 changes: 15 additions & 0 deletions scrape/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# scrape

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.7. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
Binary file added scrape/bun.lockb
Binary file not shown.
7 changes: 6 additions & 1 deletion scrape/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"devDependencies": {
"@types/bun": "latest",
"@types/node": "latest"
},
"module": "index.ts",
"type": "module",
"peerDependencies": {
"typescript": "^5.0.0"
}
}
}
31 changes: 31 additions & 0 deletions scrape/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false

},
"include": [
"../types/**/*.ts",
],
}

0 comments on commit eb6d59b

Please sign in to comment.