Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b0de993210 |
|||
|
1fc25e2ce4 |
|||
|
68e06299a4 |
|||
|
35e7a14d1d |
|||
|
fe9f396b34 |
6 changed files with 1279 additions and 652 deletions
|
|
@ -1,41 +0,0 @@
|
|||
name: Publish to Forgejo npm Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: native
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.FORGEJO_NPM_TOKEN }}
|
||||
REGISTRY_URL: https://git.mizuki.guru/api/packages/imnyang/npm/
|
||||
SCOPE: imnyang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Configure npm auth for Forgejo registry
|
||||
run: |
|
||||
REGISTRY_HOST="${REGISTRY_URL#https://}"
|
||||
REGISTRY_HOST="${REGISTRY_HOST#http://}"
|
||||
{
|
||||
echo "@${SCOPE}:registry=${REGISTRY_URL}"
|
||||
echo "//${REGISTRY_HOST}:_authToken=${NODE_AUTH_TOKEN}"
|
||||
echo "always-auth=true"
|
||||
} > "$HOME/.npmrc"
|
||||
|
||||
- name: Install, build, and publish in Nix shell
|
||||
run: |
|
||||
source /etc/bashrc
|
||||
nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nixpkgs#nodejs_24 -c sh -lc '
|
||||
export COREPACK_HOME="$PWD/.corepack"
|
||||
export XDG_CACHE_HOME="$PWD/.cache"
|
||||
mkdir -p "$COREPACK_HOME" "$XDG_CACHE_HOME"
|
||||
corepack prepare pnpm@10.28.0
|
||||
corepack pnpm install --frozen-lockfile
|
||||
corepack pnpm build
|
||||
corepack pnpm publish --no-git-checks --registry "$REGISTRY_URL"
|
||||
'
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
cache: 'pnpm'
|
||||
- name: Clear auth token for OIDC
|
||||
run: echo "NODE_AUTH_TOKEN=" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
|
|
|
|||
19
README.md
19
README.md
|
|
@ -12,24 +12,11 @@
|
|||
## 설치
|
||||
|
||||
```bash
|
||||
npm install @imnyang/comcigan.ts # npm
|
||||
yarn add @imnyang/comcigan.ts # yarn
|
||||
pnpm add @imnyang/comcigan.ts # pnpm
|
||||
bun add @imnyang/comcigan.ts
|
||||
npm install comcigan.ts # npm
|
||||
yarn add comcigan.ts # yarn
|
||||
pnpm add comcigan.ts # pnpm
|
||||
```
|
||||
|
||||
## Forgejo 레지스트리에서 설치하기
|
||||
|
||||
이 패키지를 Forgejo 레지스트리에서 설치할 때는 설치하는 프로젝트(consumer) 쪽 설정이 필요합니다.
|
||||
|
||||
프로젝트 루트의 `.npmrc`에 아래를 추가하세요.
|
||||
|
||||
```ini
|
||||
@imnyang:registry=https://git.mizuki.guru/api/packages/imnyang/npm/
|
||||
```
|
||||
|
||||
패키지가 비공식(private)인 경우에는 인증 토큰도 필요합니다.
|
||||
|
||||
## 사용 예시
|
||||
|
||||
```typescript
|
||||
|
|
|
|||
35
package.json
35
package.json
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@imnyang/comcigan.ts",
|
||||
"version": "0.3.1",
|
||||
"version": "0.2.0",
|
||||
"description": "A Comcigan parser written in TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
@ -9,40 +9,29 @@
|
|||
"url": "git+https://github.com/imnyang/comcigan.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rm -rf dist && node ./node_modules/typescript/bin/tsc",
|
||||
"build": "rimraf dist && tsc",
|
||||
"lint": "biome check",
|
||||
"release": "semantic-release",
|
||||
"prepack": "npm run build",
|
||||
"prepack": "pnpm build",
|
||||
"test": "node -r ts-node/register --test tests/*.test.ts"
|
||||
},
|
||||
"keywords": [
|
||||
"comcigan",
|
||||
"parser",
|
||||
"typescript",
|
||||
"school",
|
||||
"korean"
|
||||
],
|
||||
"keywords": ["comcigan", "parser", "typescript", "school", "korean"],
|
||||
"author": "imnyang <me@imnya.ng>",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"registry": "https://git.mizuki.guru/api/packages/imnyang/npm/"
|
||||
},
|
||||
"packageManager": "pnpm@10.28.0",
|
||||
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@types/node": "^20.19.28",
|
||||
"rimraf": "^5.0.10",
|
||||
"semantic-release": "^24.2.9",
|
||||
"@biomejs/biome": "^1.8.3",
|
||||
"@types/node": "^20.14.9",
|
||||
"rimraf": "^5.0.7",
|
||||
"semantic-release": "^24.0.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.9.3"
|
||||
"typescript": "^5.5.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"iconv-lite": "^0.6.3",
|
||||
"undici": "^6.23.0"
|
||||
"undici": "^6.20.1"
|
||||
},
|
||||
"release": {
|
||||
"branches": [
|
||||
"release"
|
||||
]
|
||||
"branches": ["release"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1840
pnpm-lock.yaml
generated
1840
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -62,9 +62,9 @@ export default class Comcigan {
|
|||
const now = data[`자료${dayCode}`] as number[][][][]
|
||||
|
||||
const getSubject = (code?: number) =>
|
||||
code ? subjects[(code / 10 ** (teachersLen + 1)) | 0] : ''
|
||||
code ? subjects[(code / 10 ** (teachersLen + 1)) | 0] : '없음'
|
||||
const getTeacher = (code?: number) =>
|
||||
code ? teachers[code % 10 ** teachersLen] : ''
|
||||
code ? teachers[code % 10 ** teachersLen] : '없음'
|
||||
|
||||
return mergeMap(now.slice(1), original.slice(1), (gNow, gOrigin) =>
|
||||
mergeMap(gNow.slice(1), gOrigin.slice(1), (cNow, cOrigin) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue