-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from Relewise/feat/integrations
feat: integrations package
- Loading branch information
Showing
21 changed files
with
9,958 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
'es6': true, | ||
}, | ||
rules: { | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
indent: ['error', 4], | ||
quotes: ['error', 'single'], | ||
semi: ['error', 'always'], | ||
'no-extra-semi': 0, | ||
'comma-dangle': ['error', 'always-multiline'], // Reasoning behind using dangling commas -> https://github.com/airbnb/javascript#commas--dangling | ||
'no-useless-constructor': 'off', | ||
'standard/no-callback-literal': 'off', | ||
eqeqeq: ['error', 'smart'], | ||
'no-return-assign': 'off', | ||
'prefer-promise-reject-errors': 'off', | ||
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], | ||
'space-before-function-paren': ['error', 'never'], | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
'ecmaVersion': 'latest', | ||
'sourceType': 'module', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# production | ||
build | ||
dist | ||
docs | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local environment | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
swagger.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# REMEMBER TO KEEP THIS IN SYNC WITH .gitignore AS NPM IGNORES .gitignore IF ITS AVAILABLE | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local environment | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# source files | ||
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Relewise Integrations | ||
|
||
This is the official Relewise TS/JS SDK for updating your entities. | ||
|
||
For usage documentation go to our [GitHub repository](https://github.com/Relewise/relewise-sdk-javascript). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"projectFolder": ".", | ||
"mainEntryPointFilePath": "<projectFolder>/build/index.d.ts", | ||
"bundledPackages": [], | ||
"compiler": { | ||
"tsconfigFilePath": "<projectFolder>/tsconfig.json", | ||
"overrideTsconfig": { | ||
"compilerOptions": { | ||
"outDir": "build" | ||
} | ||
} | ||
}, | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "<projectFolder>/dist/index.d.ts" | ||
}, | ||
"apiReport": { | ||
"enabled": false | ||
}, | ||
"docModel": { | ||
"enabled": false | ||
}, | ||
"tsdocMetadata": { | ||
"enabled": false | ||
}, | ||
"messages": { | ||
"compilerMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"extractorMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
## Usage | ||
|
||
The following tasks are available for `npm run`: | ||
|
||
- `dev`: Run Rollup in watch mode to detect changes to files during development | ||
- `build`: Run Rollup to build a production release distributable | ||
- `build:types`: Run Microsoft API Extractor to rollup a types declaration (`d.ts`) file | ||
- `docs`: Run TypeDoc for TSDoc generated documentation in the "*docs/*" folder | ||
- `clean`: Remove all build artifacts | ||
|
||
## Development | ||
|
||
**From the lib project**, issue the `npm link` (or `yarn link`) command: | ||
|
||
``` | ||
npm link | ||
``` | ||
|
||
Start Rollup in watch mode: | ||
|
||
``` | ||
npm run dev | ||
``` | ||
|
||
**From the app project**: | ||
|
||
Link to the lib project using the `npm link @relewise/integrations` (or `yarn link @relewise/integrations`) command | ||
|
||
Now, run your app via `npm start`. | ||
|
||
## Development Cleanup | ||
|
||
Once development completes, `unlink` both your library and test app projects. | ||
|
||
**From the app project**, unlink the library using `npm unlink @relewise/integrations` (or `yarn unlink @relewise/integrations`) command: | ||
|
||
**From the lib project**, issue the `npm unlink` (or `yarn unlink`) command: | ||
|
||
``` | ||
npm unlink | ||
``` | ||
|
||
## Release Publishing | ||
|
||
Update your `package.json` to next version number, and remember to tag a release. | ||
|
||
Once ready to submit your package to the NPM Registry, execute the following tasks via `npm` (or `yarn`): | ||
|
||
- `npm run clean` — Assure a clean build | ||
- `npm run gen-api` — Generate the typescript API interfaces | ||
- `npm run build` — Build the package | ||
- `npm run build:types` — Build API Extractor d.ts declaration | ||
|
||
Assure the proper npm login: | ||
|
||
``` | ||
npm login | ||
``` | ||
|
||
Submit your package to the registry: | ||
|
||
``` | ||
npm publish --access public | ||
``` | ||
|
||
## Testing | ||
|
||
### Integrations | ||
|
||
To run integrations tests, run the following command with parameters. | ||
|
||
DATASET_ID - This is the Relewise Dataset Id | ||
|
||
API_KEY - This is the Relewise API Key | ||
|
||
SERVER_URL - This is an optional parameter for changing the API url. e.g. https://localhost:5000 for development | ||
|
||
|
||
npm run integration-test --DATASET_ID=... --API_KEY=... --SERVER_URL=https://api.relewise.com | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
declare global { | ||
namespace NodeJS { | ||
interface ProcessEnv { | ||
NODE_ENV: 'development' | 'production'; | ||
PORT?: string; | ||
npm_config_API_KEY: string; | ||
npm_config_DATASET_ID: string; | ||
npm_config_SERVER_URL?: string; | ||
} | ||
} | ||
} | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
extensionsToTreatAsEsm: ['.ts'], | ||
moduleDirectories: ['node_modules'], | ||
transform: { | ||
'^.+\\.[tj]s$': 'ts-jest', | ||
}, | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(@relewise)/)', | ||
'../lib/dist/cjs/relewise-integrations.js', | ||
], | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: { | ||
allowJs: true, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.