Skip to content

Commit

Permalink
NPM Publishing (#2)
Browse files Browse the repository at this point in the history
* Update actions, description, package.json

* Set up pacakge types, exports

* Finalizing package stuff
  • Loading branch information
pm0u authored Jan 12, 2024
1 parent a4203a2 commit 160aeca
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 20
- run: npm ci
- run: npm test
7 changes: 3 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { Client } = require('./lib/client');
const { Token } = require('./lib/token');

module.exports = { Client, Token }
export { Client } from "./lib/client";
export { Token } from "./lib/token";
export * from "./types";
24 changes: 16 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
{
"name": "strava-oauth2",
"version": "1.1.0",
"name": "strava-api",
"version": "0.1",
"description": "A simple Node.JS OAuth2 client for connecting your app to the Strava API",
"main": "index.js",
"main": "./dist/index.js",
"engines": {
"node": ">=20"
},
"exports": {
"./types": "./dist/types/index.d.ts",
".": {
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"scripts": {
"test": "jest"
"test": "jest",
"build": "tsc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tobyDickinson/strava-oauth2.git"
"url": "git+https://github.com/pm0u/strava-api.git"
},
"keywords": [
"Strava",
"OAuth2",
"Client"
],
"author": "Toby Dickinson Williams",
"author": "Paul P Mourer",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/tobyDickinson/strava-oauth2/issues"
"url": "https://github.com/pm0u/strava-api/issues"
},
"homepage": "https://github.com/tobyDickinson/strava-oauth2#readme",
"homepage": "https://github.com/pm0u/strava-api#readme",
"dependencies": {
"axios": "^1.6.5",
"url": "^0.11.0"
Expand Down
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
"lib": ["es2023"],
"module": "node16",
"target": "es2022",

"declaration": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node16",
"typeRoots": ["./node_modules/@types"],
"types": ["jest", "node"]
"types": ["jest", "node"],
"outDir": "./dist"
},
"exclude": ["node_modules"],
"include": ["./**/*.ts"]
"include": ["./lib/**/*.ts", "./index.ts", "./types/**/*.ts"]
}
5 changes: 5 additions & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const b = "b";

export * from "./config";
export * from "./scope";
export * from "./token";

0 comments on commit 160aeca

Please sign in to comment.