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/byods loader package #3875

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"./packages/@webex/*",
"./packages/webex",
"./packages/calling",
"./packages/byods",
"./packages/config/*",
"./packages/legacy/*",
"./packages/tools/*"
Expand Down
126 changes: 126 additions & 0 deletions packages/byods/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Webstorm
.idea

# Other
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*


# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
coverage
junit.xml

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

docs/temp
*.xml

samples/index.min.js

# End of https://www.toptal.com/developers/gitignore/api/node
3 changes: 3 additions & 0 deletions packages/byods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BYoDS SDK

This is the readme placeholder for the Bring Your own Data Source (BYoDS) SDK.
13 changes: 13 additions & 0 deletions packages/byods/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-typescript"
],
}
47 changes: 47 additions & 0 deletions packages/byods/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import config from '@webex/jest-config-legacy';

const jestConfig = {
rootDir: './',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'node',
testMatch: ['<rootDir>/test/unit/spec/**/*.ts'],
transformIgnorePatterns: [],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
testResultsProcessor: 'jest-junit',
// Clear mocks in between tests by default
clearMocks: true,
// TODO: Set this to true once we have the source code and their corresponding test files added
collectCoverage: false,
coverageThreshold: {
global: {
lines: 85,
functions: 85,
branches: 85,
statements: 85,
},
},
coverageDirectory: 'coverage',
coverageReporters: ['clover', 'json', 'lcov'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'coverage/junit',
outputName: 'coverage-junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
},
],
[
'jest-html-reporters',
{
publicPath: './coverage',
filename: 'jest-report.html',
openReport: false,
},
],
],
};

export default {...config, ...jestConfig};
10 changes: 10 additions & 0 deletions packages/byods/jest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'jest';

declare global {
namespace jest {
/* eslint-disable-next-line no-unused-vars */
interface Matchers<R> {
toBeCalledOnceWith(received?: any, ...expected: any[]): CustomMatcherResult;
}
}
}
12 changes: 12 additions & 0 deletions packages/byods/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
expect.extend({
toBeCalledOnceWith(received, ...expected) {
try {
expect(received).toBeCalledTimes(1);
expect(received).toBeCalledWith(...expected);
} catch (error) {
return {message: () => error, pass: false};
}

return {pass: true};
},
});
124 changes: 124 additions & 0 deletions packages/byods/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"name": "@webex/byods",
"files": [
"dist"
],
"contributors": [],
"main": "dist/module/index.js",
"module": "dist/module/index.js",
"types": "dist/types/index.d.ts",
"license": "MIT",
"author": "[email protected]",
"repository": {
"type": "git",
"url": "https://github.com/webex/webex-js-sdk.git",
"directory": "packages/byods"
},
"engines": {
"node": ">=20.x"
},
"scripts": {
"build:docs": "typedoc --out ../../docs/byods",
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts && yarn build",
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types",
"deploy:npm": "yarn npm publish",
"docs": "typedoc --emit none",
"fix:lint": "eslint 'src/**/*.ts' --fix",
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"prebuild": "rimraf dist",
"test": "yarn test:style && yarn test:unit",
"test:style": "eslint 'src/**/*.ts'",
"test:unit": "webex-legacy-tools test --unit --runner jest"
},
"devDependencies": {
"@babel/preset-typescript": "7.16.7",
"@commitlint/cli": "15.0.0",
"@commitlint/config-conventional": "15.0.0",
"@rollup/plugin-commonjs": "22.0.2",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.1.3",
"@types/chai": "4.2.21",
"@types/jest": "27.4.1",
"@types/mocha": "9.0.0",
"@types/node": "16.11.9",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"@web/dev-server": "0.4.5",
"@webex/jest-config-legacy": "workspace:*",
"@webex/legacy-tools": "workspace:*",
"chai": "4.3.4",
"cspell": "5.19.2",
"esbuild": "^0.17.19",
"eslint": "^8.24.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-typescript": "2.4.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jsdoc": "38.0.4",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-tsdoc": "0.2.14",
"jest": "27.5.1",
"jest-junit": "13.0.0",
"karma": "6.4.3",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.0.3",
"karma-firefox-launcher": "2.1.1",
"karma-junit-reporter": "2.0.1",
"karma-mocha": "2.0.1",
"karma-mocha-reporter": "2.2.5",
"karma-safari-launcher": "1.0.0",
"karma-sauce-launcher": "4.3.6",
"karma-typescript": "5.5.3",
"karma-typescript-es6-transform": "5.5.3",
"mocha": "10.6.0",
"prettier": "2.5.1",
"puppeteer": "22.13.0",
"rimraf": "3.0.2",
"rollup": "2.68.0",
"rollup-plugin-polyfill-node": "0.8.0",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.31.2",
"sinon": "12.0.1",
"ts-jest": "27.1.4",
"typed-emitter": "2.1.0",
"typedoc": "0.23.26",
"typescript": "4.9.5"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"scope-case": [
2,
"always",
[
"lower-case",
"pascal-case"
]
],
"body-max-line-length": [
0,
"always",
400
],
"footer-max-line-length": [
0,
"always",
400
]
}
},
"gh-pages-deploy": {
"staticpath": "docs",
"noprompt": true
},
"dependencies": {
"@types/node-fetch": "2.6.11",
"jose": "5.8.0",
"node-fetch": "3.3.2"
},
"type": "module"
}
Loading
Loading