Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(release): npm publish package #1

Merged
merged 22 commits into from
Dec 5, 2023
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
5 changes: 5 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ rules:

parserOptions:
project: "./tsconfig.json"

ignorePatterns:
- jest.config.js
- "dist/"
- "examples/"
18 changes: 13 additions & 5 deletions .github/workflows/ci.yaml → .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CICD

on:
push:
Expand All @@ -10,6 +10,7 @@ on:

permissions:
contents: read
id-token: write

jobs:
ci:
Expand All @@ -18,17 +19,24 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"

registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install -g npm
npm version prerelease --no-git-tag-version --preid $GITHUB_SHA
npm publish --access public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules/
out/
dist/
.next/
mydb.sqlite
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
dist
coverage
examples
README.md
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div align="center">

[![ci](https://github.com/resonatehq/resonate-sdk-ts/actions/workflows/ci.yaml/badge.svg)](https://github.com/resonatehq/resonate-sdk-ts/actions/workflows/ci.yaml)
[![cicd](https://github.com/resonatehq/resonate-sdk-ts/actions/workflows/cicd.yaml/badge.svg)](https://github.com/resonatehq/resonate-sdk-ts/actions/workflows/cicd.yaml)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

</div>
Expand Down
3 changes: 3 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Resonate, Context } from "./resonate";

export { Resonate, Context };
1,221 changes: 506 additions & 715 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{
"name": "resonate-sdk-ts",
"name": "@resonatehq/sdk",
"version": "0.0.0",
"description": "Resonate TypeScript SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/resonatehq/resonate-sdk-ts.git"
},
"publishConfig": {
"provenance": true
},
"scripts": {
"test": "jest",
"build": "tsc --build tsconfig.build.json",
"lint": "prettier . --check && eslint .",
"prettier": "prettier . --write",
"debug": "node --inspect-brk ./node_modules/.bin/jest -i"
},
"files": [
"dist"
],
"devDependencies": {
"@jest/globals": "^29.7.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["test/**/*"]
}
15 changes: 10 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down Expand Up @@ -99,5 +99,10 @@
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
},
"include": [
"lib/**/*",
"test/**/*"
]
}