Skip to content

Commit 8584795

Browse files
committed
fix lint errors
1 parent 1468c17 commit 8584795

20 files changed

+31593
-28364
lines changed

.eslintrc.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaVersion": 12,
13+
"sourceType": "module"
14+
},
15+
"plugins": [
16+
"@typescript-eslint"
17+
],
18+
"rules": {
19+
"@typescript-eslint/no-var-requires": 1,
20+
"no-prototype-builtins": 0
21+
}
22+
}

Jenkinsfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ webappPipeline {
1212
}
1313
buildType = { (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('release/')) ? 'MAINLINE' : 'FEATURE' }
1414
publishPackage = { 'prod' }
15-
testJob = 'spigot-tests-webrtcsdk'
15+
testJob = null
1616

1717
buildStep = {
1818
sh('''
1919
export CDN_URL="$(npx cdn --ecosystem pc --name $APP_NAME --build $BUILD_ID --version $VERSION)"
2020
echo "CDN_URL $CDN_URL"
21-
npm ci && npm test && npm run build
22-
npm run build:sample
21+
npm ci && npm run lint && npm test && npm run build
22+
cd demo-app && npm ci && npm run build
2323
''')
2424
}
2525

copy-version.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const fs = require('fs');
2+
const version = require('./package.json').version;
3+
4+
if (!version) {
5+
console.error('No version was found in "./package.json"');
6+
process.exit(1);
7+
}
8+
9+
fs.writeFileSync('dist/package.json', JSON.stringify({ version }, null, 2));

create-manifest.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs');
4+
5+
const buildDate = new Date();
6+
7+
const manifest = {
8+
name: process.env.APP_NAME,
9+
version: process.env.VERSION,
10+
build: process.env.BUILD_ID,
11+
buildDate: buildDate.toISOString(),
12+
indexFiles: []
13+
};
14+
15+
/* read top level softphone-vendor-headsets file variations */
16+
const files = fs.readdirSync('dist/');
17+
files.forEach(file => {
18+
/* skip directories and non-js files */
19+
if (
20+
fs.lstatSync('dist/' + file).isDirectory()
21+
) {
22+
return;
23+
}
24+
25+
manifest.indexFiles.push({ file });
26+
});
27+
28+
try {
29+
const files = fs.readdirSync('demo-app/dist');
30+
files.forEach(file => {
31+
if (fs.lstatSync('demo-app/dist/' + file).isDirectory()) {
32+
const dirFiles = fs.readdirSync('demo-app/dist/' + file);
33+
dirFiles.forEach(dirFile => {
34+
if (fs.lstatSync('demo-app/dist/' + file + '/' + dirFile).isDirectory()) {
35+
return;
36+
}
37+
manifest.indexFiles.push({
38+
file: '/demo-app/dist/' + file + '/' + dirFile
39+
});
40+
});
41+
return;
42+
}
43+
manifest.indexFiles.push({
44+
file: '/demo-app/dist/' + file
45+
});
46+
});
47+
} catch (e) {
48+
// demo dir (examples don't exist)
49+
}
50+
51+
fs.writeFileSync('./dist/manifest.json', JSON.stringify(manifest, null, 2), { encoding: 'utf8' });

0 commit comments

Comments
 (0)