Compare commits

...

60 Commits

Author SHA1 Message Date
ce8ae68362 fix
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-17 14:04:12 +01:00
db74826cc4 fix
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-17 12:54:37 +01:00
d2ff45e09e remove jasmine-ts
Some checks failed
continuous-integration/drone/push Build is failing
2022-03-17 12:54:23 +01:00
b7d0827f5e update
Some checks failed
continuous-integration/drone/push Build is failing
2021-05-24 15:14:59 +02:00
1c375d8d55 remove temporary fix
Some checks failed
continuous-integration/drone/push Build is failing
2021-01-15 13:50:31 +01:00
85d10032d9 fix stryker config
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-05 08:11:58 +01:00
cdb3558184 mutate all js or ts files
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-04 13:58:20 +01:00
d5b018f2e4 remove deprecated settings
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-21 07:48:26 +02:00
18303c7197 bump version
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-04 18:04:21 +02:00
0bec27954e add standard stryker config
Some checks failed
continuous-integration/drone/push Build is failing
2020-10-04 18:03:24 +02:00
648d9aac43 fix for ci
Some checks failed
continuous-integration/drone/push Build is failing
2020-10-03 16:05:05 +02:00
68074c9f02 accept ts files
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-03 14:55:18 +02:00
80e0207021 fix
All checks were successful
continuous-integration/drone/push Build is passing
2020-09-24 12:06:51 +02:00
6c102547d8 simplify ts test script
Some checks failed
continuous-integration/drone/push Build is failing
2020-09-24 12:06:37 +02:00
0fa904bed2 switch to jasmine
All checks were successful
continuous-integration/drone/push Build is passing
2020-09-24 07:41:23 +02:00
b5364f05e1 update-scanner: automatic update
Some checks failed
continuous-integration/drone/push Build is failing
eslint: 7.7.0 ==> 7.8.1 minor
2020-09-07 13:11:15 +02:00
fe0ec6a077 update-scanner: automatic update
Some checks failed
continuous-integration/drone/push Build is failing
eslint: 7.6.0 ==> 7.7.0 minor
2020-08-19 08:03:39 +02:00
48d46b5f0b fix
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-04 13:49:44 +02:00
681a0874e2 adapt new ci script
Some checks failed
continuous-integration/drone/push Build is failing
2020-08-04 13:47:41 +02:00
32d4902f6c push version 1.3
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-04 13:41:44 +02:00
e533f73d31 adapt to node build image
Some checks failed
continuous-integration/drone/push Build is failing
2020-08-04 12:46:16 +02:00
cc5e2c429b update-scanner: automatic update
Some checks failed
continuous-integration/drone/push Build is failing
eslint: 7.5.0 ==> 7.6.0 minor
2020-08-04 12:33:50 +02:00
d93392db02 update-scanner: automatic update
All checks were successful
continuous-integration/drone/push Build is passing
@sapphirecode/eslint-config: 2.1.15 ==> 2.1.16 minor
2020-07-19 14:46:37 +02:00
45dabc112f update-scanner: automatic update
All checks were successful
continuous-integration/drone/push Build is passing
eslint: 7.4.0 ==> 7.5.0 minor
2020-07-19 11:50:45 +02:00
ef4aefd3e9 require keywords
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-19 11:13:17 +02:00
0955d18339 fix
All checks were successful
continuous-integration/drone/push Build is passing
2020-07-19 11:07:12 +02:00
d8a0139ce4 fix
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-19 10:53:26 +02:00
f89082563a require repository and issue tracker url
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-19 10:52:15 +02:00
01dc0b4d4a require author object format 2020-07-19 10:46:12 +02:00
1c4224adf6 require changelog 2020-07-19 10:36:45 +02:00
28fae0cf69 update-scanner: automatic update
All checks were successful
continuous-integration/drone/push Build is passing
@sapphirecode/eslint-config: 2.1.13 ==> 2.1.15 minor
eslint: 7.3.1 ==> 7.4.0 minor
2020-07-10 12:11:08 +02:00
e8189ffe11 fix
All checks were successful
continuous-integration/drone/push Build is passing
2020-07-09 21:41:11 +02:00
c08137241c fix
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-09 21:39:02 +02:00
d1becabe18 use npm token
All checks were successful
continuous-integration/drone/push Build is passing
2020-07-09 21:35:32 +02:00
d3434ab10b use deployment image
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2020-07-09 21:29:47 +02:00
c0b5976b77 fix
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-09 21:16:23 +02:00
4798aeba0e adapt to drone
Some checks failed
continuous-integration/drone/push Build is failing
2020-07-09 21:13:57 +02:00
40698083b7 update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.12 ==> 2.1.13 minor
2020-07-01 09:09:54 +02:00
3deca2424b update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.10 ==> 2.1.12 minor
eslint: 7.3.0 ==> 7.3.1 minor
2020-06-24 12:29:47 +02:00
3307c2913f update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.9 ==> 2.1.10 minor
eslint: 7.2.0 ==> 7.3.0 minor
2020-06-22 07:59:52 +02:00
2022bc0884 update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.8 ==> 2.1.9 minor
eslint: 7.1.0 ==> 7.2.0 minor
2020-06-11 20:06:42 +02:00
76315d5cd2 fix 2020-06-04 11:01:43 +02:00
e2688f7a0c update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.7 ==> 2.1.8 minor
2020-06-02 08:28:44 +02:00
e8e8cc1a5c update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.6 ==> 2.1.7 minor
eslint: 7.0.0 ==> 7.1.0 minor
2020-05-23 17:55:07 +02:00
8b6e3b1df2 allow build on modules without changelog 2020-05-23 17:46:43 +02:00
2c15e4df49 fix 2020-05-23 17:44:09 +02:00
61da0a40c5 fix 2020-05-23 17:42:25 +02:00
b7b93c807c fix 2020-05-23 17:40:34 +02:00
938c4c0383 require up to date readme 2020-05-23 17:36:36 +02:00
98cf38343c update-scanner: automatic update
@sapphirecode/eslint-config: 2.1.3 ==> 2.1.6 minor
2020-05-17 19:15:27 +02:00
d73f5c860d fix 2020-05-17 19:00:53 +02:00
6cd279c970 remove broken package quality badge 2020-05-15 13:09:47 +02:00
7c7ede2f68 fix 2020-05-15 13:07:39 +02:00
d6a9b3689c fix 2020-05-15 13:02:11 +02:00
9cb9c4e8d7 auto update jenkins.js 2020-05-15 12:56:20 +02:00
67abb12c33 add jenkins.run 2020-05-15 12:51:09 +02:00
da04a5175d formatting 2020-05-15 12:26:51 +02:00
cca9c21cb7 fix 2020-05-13 21:30:49 +02:00
23a1cc5742 add keyword 2020-05-13 21:26:59 +02:00
6a110e32d1 update 2020-05-13 21:24:38 +02:00
17 changed files with 639 additions and 657 deletions

14
.drone.yml Normal file
View File

@ -0,0 +1,14 @@
kind: pipeline
name: default
steps:
- name: setup
image: registry:5000/node-build
commands:
- yarn
- curl https://git.scode.ovh/Timo/standard/raw/branch/master/ci.js > ci.js
- name: build
image: registry:5000/node-build
commands:
- node ci.js

View File

@ -1,24 +1,22 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Standard which is released under MIT.
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@sapphirecode.ovh>, May 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
'use strict';
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
es6: true,
node: true
},
extends: [
'@sapphirecode'
],
extends: [ '@sapphirecode' ],
globals: {
Atomics: 'readonly',
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
}
}
parserOptions: { ecmaVersion: 2018 }
};

View File

@ -2,7 +2,7 @@
"has_license": true,
"license": "MIT",
"author": "Timo Hocker",
"company": "SapphireCode",
"company": "Sapphirecode",
"email": "timo@scode.ovh",
"software": "Standard"
"software": "standard"
}

28
CHANGELOG.md Normal file
View File

@ -0,0 +1,28 @@
# Changelog
## 1.5.x
add standard stryker config file
## 1.4.x
switching projects from ava to jasmine test framework
## 1.3.x
using custom image to simplify node module deployment
## 1.2.x
adapt to drone.io deployment
## 1.1.x
Require up to date changelog file in jenkins build
## 1.0.x
Initial release
- standard files for jenkins ci
- standard scripts

23
Jenkinsfile vendored
View File

@ -1,23 +0,0 @@
pipeline {
agent any
environment {
VERSION = VersionNumber([
versionNumberString:
'${BUILDS_ALL_TIME}',
versionPrefix: '1.0.',
worstResultForIncrement: 'SUCCESS'
])
}
stages {
stage('Building') {
steps {
script {
currentBuild.displayName = env.VERSION
}
sh 'yarn ci ${VERSION}'
}
}
}
}

View File

@ -1,13 +1,9 @@
# @sapphirecode/standard
[![Package quality](https://packagequality.com/badge/%40sapphirecode%2Fstandard)](https://packagequality.com/#?package=%40sapphirecode%2Fstandard)
version: 1.0.x
version: 1.5.x
standard files and scripts for sapphirecode modules
@sapphirecode/standard contains standard files and scripts used in sapphirecode modules
## License
MIT © Timo Hocker <timo@sapphirecode.ovh>
MIT © Timo Hocker <timo@scode.ovh>

View File

@ -1,57 +0,0 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@sapphirecode.ovh>, May 2020
*/
'use strict';
module.exports = `/* eslint-disable */
'use strict';
const fs = require ('fs');
const child_process = require ('child_process');
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
[
,, pkg.version
] = process.argv;
fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2));
child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' });
if (typeof pkg.description === 'undefined' || pkg.description === '') {
console.log ('description undefined');
process.exit (1);
}
if (typeof pkg.repository === 'undefined') {
console.log ('repository undefined');
process.exit (1);
}
function major (version) {
return version.replace (/\\.[0-9x]+$/ui, '');
}
if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8');
const version = (/version: ([0-9x.]+)/ui).exec (readme);
if (
version === null
|| major (version[1]) !== major (pkg.version)
) {
console.log ('readme version does not match package version');
process.exit (1);
}
else { child_process.execSync ('yarn publish --access public'); }
}
else {
console.log ('readme does not exist');
process.exit (1);
}
`;

View File

@ -1,33 +0,0 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@sapphirecode.ovh>, May 2020
*/
'use strict';
module.exports = `pipeline {
agent any
environment {
VERSION = VersionNumber([
versionNumberString:
'\${BUILDS_ALL_TIME}',
versionPrefix: '1.0.',
worstResultForIncrement: 'SUCCESS'
])
}
stages {
stage('Building') {
steps {
script {
currentBuild.displayName = env.VERSION
}
sh 'yarn ci \${VERSION}'
}
}
}
}
`;

24
assets/drone.js Normal file
View File

@ -0,0 +1,24 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
'use strict';
module.exports = `kind: pipeline
name: default
steps:
- name: setup
image: registry:5000/node-build
commands:
- yarn
- curl https://git.scode.ovh/Timo/standard/raw/branch/master/ci.js > ci.js
- name: build
image: registry:5000/node-build
commands:
- node ci.js
`;

14
assets/index.js Normal file
View File

@ -0,0 +1,14 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, September 2020
*/
'use strict';
const drone = require ('./drone');
const jasmine = require ('./jasmine');
const stryker = require ('./stryker');
module.exports = { drone, jasmine, stryker };

24
assets/jasmine.js Normal file
View File

@ -0,0 +1,24 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, September 2020
*/
'use strict';
module.exports = `
{
"spec_dir": "test",
"spec_files": [
"spec/*.js",
"spec/*.ts"
],
"helpers": [
"helpers/*.js",
"helpers/*.ts"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
`;

32
assets/stryker.js Normal file
View File

@ -0,0 +1,32 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, October 2020
*/
'use strict';
module.exports = `'use strict';
/**
* @type {import('@stryker-mutator/api/core').StrykerOptions}
*/
module.exports = {
packageManager: 'yarn',
reporters: [
'clear-text',
'progress'
],
testRunner: 'jasmine',
jasmineConfigFile: 'jasmine.json',
coverageAnalysis: 'perTest',
mutate: [
'**/*.js',
'**/*.ts',
'!**/test/**/*',
'!**/spec/**/*',
'!stryker.conf.js'
]
};
`;

104
ci.js Normal file
View File

@ -0,0 +1,104 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
/* eslint-disable */
'use strict';
const authors = [
JSON.stringify ({ name: 'Timo Hocker', email: 'timo@scode.ovh' })
];
const fs = require ('fs');
const child_process = require ('child_process');
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' });
let ok = true;
if (typeof pkg.description === 'undefined' || pkg.description === '') {
console.log ('description undefined');
ok = false;
}
if (typeof pkg.repository === 'object') {
if (pkg.repository.type !== 'git') {
console.log ('repository is not of type git');
ok = false;
}
if (!(/^https:\/\/.+\.git/iu).test (pkg.repository.url))
console.log ('repo url is not https.git');
}
else {
console.log ('repository undefined');
ok = false;
}
if (!(/^https:\/\/.+/iu).test (pkg.bugs)) {
console.log ('issue tracker url not defined');
ok = false;
}
if (typeof pkg.author === 'object') {
if (!authors.includes (JSON.stringify (pkg.author))) {
console.log ('author is none of the registered');
ok = false;
}
}
else {
console.log ('author not in object format');
ok = false;
}
if (!Array.isArray(pkg.keywords) || pkg.keywords.length < 1) {
console.log ('keywords empty');
ok = false;
}
function major (version) {
return version.replace (/\.[0-9x]+$/ui, '');
}
if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8');
const version = (/version: ([0-9x.]+)/ui).exec (readme);
if (
version === null
|| major (version[1]) !== major (pkg.version)
) {
console.log ('readme version does not match package version');
ok = false;
}
}
else {
console.log ('readme does not exist');
ok = false;
}
if (fs.existsSync ('CHANGELOG.md')) {
const changelog = fs.readFileSync ('CHANGELOG.md', 'utf-8');
const cl_version = (/^## ([0-9x.]+)/mu).exec (changelog);
if (
cl_version === null
|| major (cl_version[1]) !== major (pkg.version)
) {
console.log ('changelog is not up to date');
ok = false;
}
}
else {
console.log ('changelog does not exist');
ok = false;
}
if (ok)
child_process.execSync ('yarn publish --access public');
else
process.exit (1);

View File

@ -1,23 +1,22 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Standard which is released under MIT.
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of standard which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@sapphirecode.ovh>, May 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
'use strict';
const jenkins = require ('./asset_jenkins');
const jenkinsfile = require ('./asset_jenkinsfile');
const files = { jenkins, jenkinsfile };
const files = require ('./assets');
const scripts = {
lint: 'eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs',
test: {
common: 'nyc ava',
ts: 'tsc && nyc ava',
no: 'echo "no test"'
common: 'nyc jasmine --config="jasmine.json"',
ts: 'nyc jasmine --config="jasmine.json"',
ts_pre: 'tsc',
ts_post: 'tsc --build --clean',
no: 'echo "no test"'
},
compile: {
common: 'tsc --allowJs --declaration --emitDeclarationOnly index.js',

View File

@ -1,47 +0,0 @@
/* eslint-disable */
'use strict';
const fs = require ('fs');
const child_process = require ('child_process');
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
[
,, pkg.version
] = process.argv;
fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2));
child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' });
if (typeof pkg.description === 'undefined' || pkg.description === '') {
console.log ('description undefined');
process.exit (1);
}
if (typeof pkg.repository === 'undefined') {
console.log ('repository undefined');
process.exit (1);
}
function major (version) {
return version.replace (/\.[0-9x]+$/ui, '');
}
if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8');
const version = (/version: ([0-9x.]+)/ui).exec (readme);
if (
version === null
|| major (version[1]) !== major (pkg.version)
) {
console.log ('readme version does not match package version');
process.exit (1);
}
else { child_process.execSync ('yarn publish --access public'); }
}
else {
console.log ('readme does not exist');
process.exit (1);
}

View File

@ -1,27 +1,35 @@
{
"name": "@sapphirecode/standard",
"version": "1.0.0",
"version": "1.5.5",
"main": "index.js",
"author": "Timo Hocker <timo@sapphirecode.ovh>",
"author": {
"name": "Timo Hocker",
"email": "timo@scode.ovh"
},
"description": "standard files and scripts for sapphirecode modules",
"repository": {
"type": "git",
"url": "https://git.scode.ovh/timo/standard.git"
},
"bugs": "https://redmine.scode.ovh/projects/standard",
"keywords": [
"standard"
],
"license": "MIT",
"devDependencies": {
"@sapphirecode/eslint-config": "^2.0.15",
"eslint": "^6.8.0"
"@sapphirecode/eslint-config": "^2.1.3",
"eslint": "^7.0.0"
},
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs",
"test": "echo \"no test\"",
"compile": "tsc --allowJs --declaration --emitDeclarationOnly index.js",
"ci": "yarn && node jenkins.js"
"compile": "tsc --allowJs --declaration --emitDeclarationOnly index.js"
},
"files": [
"LICENSE",
"*.js",
"*.d.ts"
"*.d.ts",
"assets/*.js",
"assets/*.d.ts"
]
}

819
yarn.lock

File diff suppressed because it is too large Load Diff