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

Get SDK version reliably #480

Merged
merged 4 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
"lint:ci": "npm run lint:fix -- --quiet",
"lint:prettier": "prettier --write '**/*.{ts,js}'",
"lint:prettier:check": "prettier --check '**/*.{ts,js}'",
"export-version": "node -p \"'export const SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"prebuild": "npm run export-version",
"build": "rm -rf lib && npm run build-esm && npm run build-cjs",
"build-esm": "tsc -p tsconfig.esm.json",
"build-cjs": "tsc -p tsconfig.cjs.json",
"prepare": "npm run build",
"build:docs": "typedoc --out docs"
"build:docs": "typedoc --out docs",
"version": "npm run export-version && git add src/version.ts"
},
"keywords": [
"email",
Expand Down
4 changes: 1 addition & 3 deletions src/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import {
NylasSdkTimeoutError,
} from './models/error';
import { objKeysToCamelCase, objKeysToSnakeCase } from './utils';
const PACKAGE_JSON = require('package.json').default;

const SDK_VERSION = PACKAGE_JSON.version;
import { SDK_VERSION } from './version';

/**
* Options for a request to the Nylas API
Expand Down
3 changes: 2 additions & 1 deletion src/models/events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ListQueryParams } from './listQueryParams';
import { NylasListResponse } from './response';
import { Subset } from '../utils';

/**
Expand Down Expand Up @@ -260,7 +261,7 @@ export interface ListEventQueryParams extends ListQueryParams {
limit?: number;
/**
* An identifier that specifies which page of data to return.
* This value should be taken from the {@link ListResponse.nextCursor} response field.
* This value should be taken from the {@link NylasListResponse.nextCursor} response field.
*/
pageToken?: string;
}
Expand Down
1 change: 1 addition & 0 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SDK_VERSION = "7.0.0-beta.1";
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"typedocOptions": {
"entryPointStrategy": "expand",
"entryPoints": ["./src"],
"exclude": ["src/version.ts"],
"out": "docs",
"plugin": ["typedoc-plugin-rename-defaults"],
"excludeExternals": true,
Expand Down
Loading