Skip to content

Commit c84da55

Browse files
feat: initial commit
0 parents  commit c84da55

24 files changed

Lines changed: 3436 additions & 0 deletions
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: 🐛 Bug Report
2+
description: Report a bug or unexpected behavior
3+
title: '[Bug]: '
4+
labels: ['bug', 'needs-triage']
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to report a bug! Please fill out the information below to help fix it.
10+
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Description
15+
description: A clear and concise description of the bug
16+
placeholder: What happened?
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduction
22+
attributes:
23+
label: Steps to Reproduce
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
id: code
29+
attributes:
30+
label: Code Example
31+
description: Minimal code to reproduce the issue
32+
render: typescript
33+
placeholder: |
34+
import { request } from 'node-wreq';
35+
36+
const response = await request({
37+
url: 'https://example.com',
38+
browser: 'chrome_131'
39+
});
40+
validations:
41+
required: false
42+
43+
- type: textarea
44+
id: error
45+
attributes:
46+
label: Error Message/Stack Trace
47+
description: Full error message and stack trace if applicable
48+
render: shell
49+
placeholder: Paste error message here...
50+
validations:
51+
required: false
52+
53+
- type: input
54+
id: version
55+
attributes:
56+
label: node-wreq Version
57+
description: What version of node-wreq are you using?
58+
placeholder: e.g., 0.1.0
59+
validations:
60+
required: true
61+
62+
- type: input
63+
id: node-version
64+
attributes:
65+
label: Node.js Version
66+
description: Output of `node --version`
67+
placeholder: e.g., v20.11.0
68+
validations:
69+
required: true
70+
71+
- type: dropdown
72+
id: os
73+
attributes:
74+
label: Operating System
75+
description: What OS are you using?
76+
options:
77+
- macOS (Intel)
78+
- macOS (Apple Silicon)
79+
- Linux (x64)
80+
- Linux (ARM64)
81+
- Windows (x64)
82+
- Other
83+
validations:
84+
required: true
85+
86+
- type: dropdown
87+
id: installation
88+
attributes:
89+
label: Installation Method
90+
description: How did you install node-wreq?
91+
options:
92+
- npm
93+
- yarn
94+
- pnpm
95+
- Built from source
96+
validations:
97+
required: true
98+
99+
- type: textarea
100+
id: additional
101+
attributes:
102+
label: Additional Context
103+
description: Any other context about the problem
104+
placeholder: |
105+
- Using proxy?
106+
- Specific website having issues?
107+
- Network environment details?
108+
validations:
109+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 📚 Documentation
4+
url: https://github.com/will-work-for-meal/node-wreq#readme
5+
about: Read the documentation and guides
6+
- name: 💬 Discussions
7+
url: https://github.com/will-work-for-meal/node-wreq/discussions
8+
about: Ask questions and discuss ideas with the community

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 📝 Description
2+
3+
<!-- Provide a clear and concise description of your changes -->
4+
5+
## 🔗 Related Issue
6+
7+
<!-- Link to the related issue (if applicable) -->
8+
Closes #<!-- issue number -->
9+
10+
## 🎯 Type of Change
11+
12+
<!-- Mark the relevant option with an "x" -->
13+
14+
- [ ] 🐛 Bug fix
15+
- [ ] ✨ New feature
16+
- [ ] 📚 Documentation update
17+
- [ ] 🔧 Build/CI configuration

.github/workflows/build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build Native Modules
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
settings:
16+
- host: macos-latest
17+
target: x86_64-apple-darwin
18+
build: npm run build:rust -- --target x86_64-apple-darwin
19+
- host: macos-latest
20+
target: aarch64-apple-darwin
21+
build: npm run build:rust -- --target aarch64-apple-darwin
22+
- host: ubuntu-latest
23+
target: x86_64-unknown-linux-gnu
24+
build: npm run build:rust -- --target x86_64-unknown-linux-gnu
25+
- host: ubuntu-latest
26+
target: aarch64-unknown-linux-gnu
27+
build: npm run build:rust -- --target aarch64-unknown-linux-gnu
28+
- host: windows-latest
29+
target: x86_64-pc-windows-msvc
30+
build: npm run build:rust -- --target x86_64-pc-windows-msvc
31+
32+
name: Build - ${{ matrix.settings.target }}
33+
runs-on: ${{ matrix.settings.host }}
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
43+
- name: Install Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
targets: ${{ matrix.settings.target }}
47+
48+
- name: Install dependencies
49+
run: npm install
50+
51+
- name: Build native module
52+
run: ${{ matrix.settings.build }}
53+
54+
- name: Upload artifacts
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: bindings-${{ matrix.settings.target }}
58+
path: rust/*.node
59+
if-no-files-found: error
60+
61+
publish:
62+
name: Publish to npm
63+
runs-on: ubuntu-latest
64+
needs: build
65+
if: github.event_name == 'release'
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 20
74+
registry-url: 'https://registry.npmjs.org'
75+
76+
- name: Install dependencies
77+
run: npm install
78+
79+
- name: Download all artifacts
80+
uses: actions/download-artifact@v4
81+
with:
82+
path: artifacts
83+
84+
- name: Move artifacts to rust directory
85+
shell: bash
86+
run: |
87+
mkdir -p rust
88+
# Copy all .node files from artifacts to rust/
89+
find artifacts -name "*.node" -exec cp {} rust/ \;
90+
echo "Collected binaries:"
91+
ls -la rust/*.node
92+
93+
- name: Build TypeScript
94+
run: npm run build:ts
95+
96+
- name: Publish
97+
run: npm publish --access public
98+
env:
99+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
node-version: [22]
16+
17+
name: Test on Node ${{ matrix.node-version }} - ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
30+
- name: Install Rust
31+
uses: dtolnay/rust-toolchain@stable
32+
33+
- name: Cache Rust dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
rust/target/
42+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-cargo-
45+
46+
- name: Install dependencies
47+
run: npm install
48+
49+
- name: Build Rust module
50+
run: npm run build:rust
51+
52+
- name: Build TypeScript
53+
run: npm run build:ts
54+
55+
- name: Run tests
56+
run: npm test
57+
58+
lint:
59+
name: Lint
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: 20
70+
cache: 'npm'
71+
72+
- name: Install dependencies
73+
run: npm install
74+
75+
- name: Check TypeScript types
76+
run: npx tsc --noEmit
77+
78+
- name: Check code formatting
79+
run: npm run format:check

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Dependencies
2+
node_modules/
3+
package-lock.json
4+
yarn.lock
5+
6+
# Build outputs
7+
dist/
8+
rust/target/
9+
rust/index.node
10+
*.node
11+
12+
# TypeScript
13+
*.tsbuildinfo
14+
15+
# IDE
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
*~
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Logs
27+
*.log
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
32+
# Agents
33+
.claude/

.npmignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Source files
2+
src/
3+
rust/src/
4+
5+
# Config files
6+
tsconfig.json
7+
.github/
8+
.claude/
9+
10+
# Development files
11+
*.md
12+
!README.md
13+
14+
# Tests
15+
*.test.ts
16+
*.test.js
17+
test.ts
18+
19+
# Build artifacts that aren't needed
20+
rust/Cargo.lock

.prettierignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
node_modules
3+
package-lock.json
4+
yarn.lock
5+
pnpm-lock.yaml
6+
7+
# Build output
8+
dist
9+
rust/target
10+
*.node
11+
12+
# Cache
13+
.cache
14+
*.log
15+
16+
# IDE
17+
.vscode
18+
.idea
19+
20+
# Misc
21+
coverage
22+
.DS_Store

0 commit comments

Comments
 (0)