Skip to content

Commit

Permalink
improve package struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jan 17, 2024
1 parent becaecf commit fc6b587
Show file tree
Hide file tree
Showing 13 changed files with 585 additions and 804 deletions.
22 changes: 12 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/* eslint-env node */
module.exports = {
env: {
browser: true,
es2021: true
browser: true,
es2021: true,
},
extends: [
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ["./tsconfig.eslint.json"],
ecmaVersion: "latest",
sourceType: "module"
project: ['./tsconfig.json'],
ecmaVersion: 'latest',
sourceType: 'module',
},
root: true,
}
}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'npm test && publish'

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- run: npm install -g pnpm
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: |
pnpm install
pnpm lint
pnpm test
pnpm build
6 changes: 2 additions & 4 deletions .github/workflows/main.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: 'npm test && publish'

on:
push:
# branches:
# - main
tags:
- 'v*'

Expand All @@ -16,8 +14,8 @@ jobs:

steps:
- run: npm install -g pnpm
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ storage
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
debug
debug
dist
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Yiwen AI
Copyright (c) 2024 Yiwen AI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# xid-ts

[![CI](https://github.com/yiwen-ai/xid-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/yiwen-ai/xid-ts/actions/workflows/ci.yml)
[![NPM version](http://img.shields.io/npm/v/xid-ts.svg)](https://www.npmjs.com/package/xid-ts)
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/yiwen-ai/xid-ts/main/LICENSE)

Globally unique sortable id generator. A Typescript port of https://github.com/rs/xid.

The binary representation is compatible with the Mongo DB 12-byte [ObjectId][object-id].
Expand Down
22 changes: 0 additions & 22 deletions dist/index.d.ts

This file was deleted.

172 changes: 0 additions & 172 deletions dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

Loading

0 comments on commit fc6b587

Please sign in to comment.