Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 3229a7f

Browse files
committed
chores
1 parent 2584a58 commit 3229a7f

File tree

9 files changed

+48
-139
lines changed

9 files changed

+48
-139
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828
run: npm exec -c ./scripts/build.sh
2929

3030
- name: 'Check if code follows JSR rules for packages'
31-
# tree will be dirty because fetch-github-folder.ts will have bumped inlined version numbers
32-
run: npx jsr publish --dry-run --allow-dirty
31+
run: npx jsr publish --dry-run
3332

3433
- name: 'Check if code passes tests'
3534
run: npm run test-once
@@ -48,7 +47,7 @@ jobs:
4847
uses: stefanzweifel/git-auto-commit-action@v5
4948
with:
5049
commit_author: 'nikelborm <[email protected]>'
51-
file_pattern: 'deno.json package-lock.json fetch-github-folder.ts'
50+
file_pattern: 'deno.json package-lock.json'
5251
commit_message: Auto-updated NPM package files
5352

5453
- name: 'Publish to JSR'

.github/workflows/update_license_year.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
1515

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
> This project currently is not stable, but I'm actively working on writing tests and handling edge cases, such as support for Git-LFS and other.
4747
> Check out the `dev` branch to see the latest updates! 😉 (except that I currently don't care and just push to main)
4848
49-
## What This Project Does
49+
## What this library+CLI does?
5050

51-
This project allows you to download any folder inside a repo on github.
51+
It allows you to download any folder or a file from a repo on github.
5252

5353
## Requirements
5454

deno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json",
33
"name": "@nikelborm/fetch-github-folder",
4-
"version": "0.1.22",
4+
"version": "0.1.23",
55
"license": "MIT",
66
"exports": {
77
".": "./index.ts",
@@ -13,6 +13,7 @@
1313
"include": [
1414
".github/FUNDING.yml",
1515
"template.env",
16+
"fetch-github-folder.ts",
1617
"src/**/*.ts",
1718
"index.ts",
1819
"errors.ts",

fetch-github-folder.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env node
22

3-
import { CliConfig } from '@effect/cli';
3+
import { CliConfig, Span } from '@effect/cli';
44
import { make, run } from '@effect/cli/Command';
55
import { layer as NodeFileSystemLayer } from '@effect/platform-node-shared/NodeFileSystem';
66
import { layer as NodePathLayer } from '@effect/platform-node-shared/NodePath';
77
import { runMain } from '@effect/platform-node-shared/NodeRuntime';
88
import { layer as NodeTerminalLayer } from '@effect/platform-node-shared/NodeTerminal';
99
import { provide } from 'effect/Effect';
1010
import { pipe } from 'effect/Function';
11+
import pkg from './package.json' with { type: 'json' };
1112
import {
1213
destinationPathCLIOptionBackedByEnv,
1314
downloadEntityFromRepo,
@@ -18,14 +19,8 @@ import {
1819
repoOwnerCLIOptionBackedByEnv,
1920
} from './src/index.ts';
2021

21-
// Those values updated automatically. If you edit names of constants or
22-
// move them to a different file, update ./scripts/build.sh
23-
const PACKAGE_VERSION = '0.1.22';
24-
// TODO: read from ./package.json
25-
const PACKAGE_NAME = 'fetch-github-folder';
26-
2722
const appCommand = make(
28-
PACKAGE_NAME,
23+
pkg.name,
2924
{
3025
repo: {
3126
owner: repoOwnerCLIOptionBackedByEnv,
@@ -40,9 +35,9 @@ const appCommand = make(
4035
);
4136

4237
const cli = run(appCommand, {
43-
// those values will be filled automatically from package.json
44-
name: PACKAGE_NAME,
45-
version: PACKAGE_VERSION,
38+
name: pkg.name,
39+
version: pkg.version,
40+
summary: Span.text(pkg.description),
4641
});
4742

4843
pipe(

package-lock.json

Lines changed: 34 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fetch-github-folder",
3-
"version": "0.1.22",
3+
"version": "0.1.23",
44
"type": "module",
55
"description": "Download any directory at any depth from any repo on GitHub on any git ref",
66
"license": "MIT",

scripts/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ command -v rollup >/dev/null 2>&1 || {
1515
}
1616

1717
rimraf dist gh-page/bundled_deps
18-
sed -i "s/\(const PACKAGE_VERSION\).*/\1 = '$(jq -r '.version' package.json)';/" ./fetch-github-folder.ts
19-
sed -i "s/\(const PACKAGE_NAME\).*/\1 = '$(jq -r '.name' package.json)';/" ./fetch-github-folder.ts
2018
tsc
2119
mkdir -p ./dist/minified
2220
rollup -c ./rollup.config.js

scripts/generate_docs.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ cd tmp
1212

1313
grep -vEi 'errors.js|cli.js' index.ts >tmp.ts && mv tmp.ts index.ts
1414

15-
find src index.ts cli.ts errors.ts -type f -exec sed -i "s/.js';/.ts';/g" {} +
16-
1715
ln -sf ../node_modules node_modules
1816

1917
deno doc --html --name=fetch-github-folder --output=docs index.ts cli.ts errors.ts

0 commit comments

Comments
 (0)