From 8c9f70af0024462105260539796928fa1b7c5de0 Mon Sep 17 00:00:00 2001 From: Jerome Simeon Date: Thu, 3 Oct 2019 11:17:59 -0400 Subject: [PATCH] fix(build) linter/licensecheck/jsdoc works again Signed-off-by: Jerome Simeon --- .eslintrc.yml | 7 +++---- HEADER | 11 ++++++++++ HEADER.md | 2 ++ package.json | 7 +------ scripts/depcheck.js | 29 -------------------------- scripts/manualrelease.sh | 44 ---------------------------------------- scripts/pkgbump.js | 27 ------------------------ scripts/pkgcheck.js | 42 -------------------------------------- scripts/pkgset.js | 29 -------------------------- scripts/pkgstamp.js | 32 ----------------------------- 10 files changed, 17 insertions(+), 213 deletions(-) create mode 100644 HEADER create mode 100644 HEADER.md delete mode 100755 scripts/depcheck.js delete mode 100755 scripts/manualrelease.sh delete mode 100755 scripts/pkgbump.js delete mode 100755 scripts/pkgcheck.js delete mode 100644 scripts/pkgset.js delete mode 100644 scripts/pkgstamp.js diff --git a/.eslintrc.yml b/.eslintrc.yml index 6ef5e947..2e4cdbd6 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -5,14 +5,13 @@ env: extends: 'eslint:recommended' parserOptions: ecmaVersion: 8 - sourceType: - - script + sourceType: 'script' rules: indent: - error - 4 linebreak-style: - - error + - warn - unix quotes: - error @@ -32,7 +31,7 @@ rules: dot-notation: error no-tabs: error no-trailing-spaces: error - no-use-before-define: error + # no-use-before-define: error no-useless-call: error no-with: error operator-linebreak: error diff --git a/HEADER b/HEADER new file mode 100644 index 00000000..c90765b4 --- /dev/null +++ b/HEADER @@ -0,0 +1,11 @@ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/HEADER.md b/HEADER.md new file mode 100644 index 00000000..0b2e1ff6 --- /dev/null +++ b/HEADER.md @@ -0,0 +1,2 @@ +## License +Accord Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Accord Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/. \ No newline at end of file diff --git a/package.json b/package.json index 4e2aa2d0..e7d53e52 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,7 @@ "test": "nyc mocha --recursive -t 10000", "test:watch": "nyc mocha --watch --recursive -t 10000", "mocha": "mocha --recursive -t 10000", - "nyc": "nyc mocha --recursive -t 10000", - "pkgcheck": "node ./scripts/pkgcheck.js", - "pkgstamp": "node ./scripts/pkgstamp.js", - "pkgbump": "node ./scripts/pkgbump.js && node ./scripts/pkgcheck.js --fix", - "pkgset": "node ./scripts/pkgset.js", - "depcheck": "node ./scripts/depcheck.js" + "nyc": "nyc mocha --recursive -t 10000" }, "repository": { "type": "git", diff --git a/scripts/depcheck.js b/scripts/depcheck.js deleted file mode 100755 index 7887b92f..00000000 --- a/scripts/depcheck.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const colors = require('colors'); -const fs = require('fs'); -const path = require('path'); - -const packages = {}; - -const npmDirectory = path.resolve('.'); - -const masterPackageFile = path.resolve(npmDirectory, 'package.json'); -const masterPackage = require(masterPackageFile); -packages['package.json'] = masterPackage; - diff --git a/scripts/manualrelease.sh b/scripts/manualrelease.sh deleted file mode 100755 index 64653467..00000000 --- a/scripts/manualrelease.sh +++ /dev/null @@ -1,44 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This script assumes that -# - the remote origin is set to a fork of the repo -# - the remote upstream is set to the original repo - -# Exit on first error, print all commands. -set -ev -set -o pipefail - -# Make sure we have the latest code from origin/master on our fork -git fetch --all --prune -git checkout master -git merge --ff-only upstream/master -git pull origin master - -# Increase the version number -npm run pkgbump -TARGET_VERSION=$( jq -r '.version' package.json ) -git add package.json -git commit -m "chore(release): Bump Concerto Tools source version" -s - -# Publish each package to NPM registry. Generate changelog and update package.json files -npm publish --tag="${TARGET_VERSION}" 2>&1 - -# Fix DCO sign-off -git commit --amend -s --no-edit -git push -f origin master - -# Merge into upstream/master -echo "Publish of ${TARGET_VERSION} successful." -echo "Now open a pull request to merge origin/master into upstream/master." diff --git a/scripts/pkgbump.js b/scripts/pkgbump.js deleted file mode 100755 index 979b3baa..00000000 --- a/scripts/pkgbump.js +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const semver = require('semver'); - -const npmDirectory = path.resolve('.'); -const npmConfigFile = path.resolve(npmDirectory, 'package.json'); -const npmConfig = require(npmConfigFile); -const targetVersion = semver.inc(npmConfig.version, 'patch'); -npmConfig.version = targetVersion; -fs.writeFileSync(npmConfigFile, JSON.stringify(npmConfig, null, 2), 'utf8'); \ No newline at end of file diff --git a/scripts/pkgcheck.js b/scripts/pkgcheck.js deleted file mode 100755 index fc446361..00000000 --- a/scripts/pkgcheck.js +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const child_process = require('child_process'); -const colors = require('colors'); -const fs = require('fs'); -const path = require('path'); -const semver = require('semver') - -const packages = {}; -const fix = (process.argv.indexOf('--fix') !== -1); - -const npmDirectory = path.resolve('.'); -const npmConfigFile = path.resolve(npmDirectory, 'package.json'); -const npmConfig = require(npmConfigFile); -const targetVersion = npmConfig.version; -const targetDependency = `${targetVersion}`; -packages['package.json'] = npmConfig; - -if (!semver.valid(targetVersion)) { - console.error(`Error: the version "${targetVersion}" in "${npmConfigFile}" is invalid!`); - process.exit(1); -} - -const masterPackageFile = path.resolve(npmDirectory, 'package.json'); -const masterPackage = require(masterPackageFile); -packages['package.json'] = masterPackage; - diff --git a/scripts/pkgset.js b/scripts/pkgset.js deleted file mode 100644 index 069120f8..00000000 --- a/scripts/pkgset.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const semver = require('semver') - -const npmDirectory = path.resolve('.'); -const npmConfigFile = path.resolve(npmDirectory, 'package.json'); -const npmConfig = require(npmConfigFile); -npmConfig.version.replace(/-.*/, ''); -const targetVersion = semver.clean(process.argv[2]); -npmConfig.version = targetVersion; -fs.writeFileSync(npmConfigFile, JSON.stringify(npmConfig, null, 2), 'utf8'); - diff --git a/scripts/pkgstamp.js b/scripts/pkgstamp.js deleted file mode 100644 index 8b8a409d..00000000 --- a/scripts/pkgstamp.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const moment = require('moment-mini'); -const path = require('path'); -const semver = require('semver'); - -const timestamp = moment().format('YYYYMMDDHHmmss'); - -const npmDirectory = path.resolve('.'); -const npmConfigFile = path.resolve(npmDirectory, 'package.json'); -const npmConfig = require(npmConfigFile); -npmConfig.version.replace(/-.*/, ''); -const targetVersion = semver.inc(npmConfig.version, 'patch') + '-' + timestamp; -npmConfig.version = targetVersion; -fs.writeFileSync(npmConfigFile, JSON.stringify(npmConfig, null, 2), 'utf8'); -