Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
colll78 committed Sep 2, 2023
0 parents commit bcd4c69
Show file tree
Hide file tree
Showing 21 changed files with 4,038 additions and 0 deletions.
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# How to create github packages

https://docs.github.com/en/packages/quickstart

# Use tsup to bundle typescript

https://tsup.egoist.dev/

# How to release

https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release

# Installation

## Create `.npmrc` file, replace TOKEN with your personal access token.

```
@anastasia-labs:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=TOKEN
```

## Install package

```
npm install @anastasia-labs/linear-vesting-offchain
```

or

```
pnpm install @anastasia-labs/linear-vesting-offchain
```

## References

- Add GitHub Packages

- https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package

- Authenticate with personal access token
- https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token

# Semantic versioning

https://semver.org/

# Workflow to create a new Github package release

Here's a step-by-step guide to create a new Github package release:

- Update the code.
- Commit the changes.
- Push the changes to the develop branch Github repository.
- Check if the Continuous Integration (CI) passes. If it does, proceed to the next step. If not, address the issues before proceeding further.
- Bump the library version based on the extent of the changes made. Here are the three options to do so:
- For a small bug fix, run:
```
pnpm version patch
```
- For adding new functionality in a backward-compatible way, run:
```
pnpm version minor
```
- For making breaking changes to the code, run:
```
pnpm version major
```
- After bumping the version, go to the Github project's releases page
- Create a new tag with the bumped version number.
- To create a new npm package in the github organization, make sure the Node.js package CI succeeds.
- If the CI Action fails, remove the release, tag, and commit the new changes. Then, push the changes and draft a new release.

# Test framework

https://github.com/vitest-dev/vitest

# Local Build

In the main directory

```
pnpm run build
```

# Installing sdk pacakage in local test folder

```
cd test
pnpm run test
```
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
description = "A Nix-flake-based Node.js development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:

flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(self: super: {
nodejs = super.nodejs-18_x;
pnpm = super.nodePackages.pnpm;
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [ nodejs pnpm ];

shellHook = ''
echo "node `${pkgs.nodejs}/bin/node --version`"
'';
};
}
);
}
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@anastasia-labs/linear-vesting-offchain",
"version": "0.0.10",
"description": "https://docs.github.com/en/packages/quickstart",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"files": [
"dist"
],
"scripts": {
"test": "",
"build": "tsup src/index.ts --minify --format esm,cjs --dts --clean",
"lint": "eslint",
"repack": "pnpm run build && pnpm pack",
"ts-node": "ts-node"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@sinclair/typebox": "^0.25.13",
"@types/node": "^20.4.9",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"ts-node": "^10.9.1",
"tsup": "^6.7.0",
"typescript": "^5.1.3"
},
"directories": {
"test": "test"
},
"dependencies": {
"@anastasia-labs/lucid-cardano-fork": "^0.10.7"
}
}
Loading

0 comments on commit bcd4c69

Please sign in to comment.