Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build
on:
push:
branches: [master]
pull_request:

jobs:
build:
name: "build"
runs-on: ubuntu-latest
strategy:
matrix:
deno-version: [2.0.0]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: yarn install --frozen-lockfile

- name: run prettier checker
run: yarn run prettier:check

- name: run tests
run: yarn run test

- name: check publish
run: yarn run publish:check
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish
on:
push:
tags:
- "*"

jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
deno-version: [2.0.0]

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set Versions
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = context.ref.substring(10).replace('v', '')
core.setOutput('tag', tag)
console.log(tag)

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: yarn install --frozen-lockfile

- name: run prettier checker
run: yarn run prettier:check

- name: run tests
run: yarn run test

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Add version to package.json
uses: jaywcjlove/github-action-package@main
with:
path: "./deno.json"
data: |
{
"version": "${{ steps.set_version.outputs.tag }}"
}

- name: Publish package
run: yarn run publish
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.idea
.vite
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
14 changes: 14 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@oh/core",
"version": "0.0.0",
"exports": "./index.ts",
"imports": {},
"tasks": {
"test:watch": "deno test --watch=./src"
},
"publish": {
"include": ["index.ts", "src/**/*.ts", "README.md", "LICENSE"],
"exclude": ["src/**/__tests__"]
},
"nodeModulesDir": "auto"
}
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/main.ts";
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"scripts": {
"deps": "deno run -A index.ts",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"prettier:check": "prettier -c ./",
"prettier:write": "prettier --write .",
"publish": "npx jsr publish --allow-dirty",
"publish:check": "npx jsr publish --allow-dirty --dry-run"
},
"devDependencies": {
"jsr": "^0.13.2",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"prettier": "3.3.3"
},
"jest": {
"testRegex": ".test.ts",
"verbose": true,
"coverageReporters": [
"json",
"html"
]
},
"packageManager": "yarn@1.22.22"
}
1 change: 1 addition & 0 deletions src/consts/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions src/enums/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./enums/main.ts";
export * from "./types/main.ts";
export * from "./utils/main.ts";
export * from "./consts/main.ts";
1 change: 1 addition & 0 deletions src/types/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions src/utils/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
15 changes: 15 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "ES2022",
"target": "ES2022",
"esModuleInterop": true,
"sourceMap": false,
"noUnusedLocals": true,
"lib": ["ES2022", "dom"],
"baseUrl": "./src/",
"rootDir": "./src",
"allowImportingTsExtensions": true,
"resolveJsonModule": true
}
}
Loading
Loading