Skip to content

Commit

Permalink
Merge pull request #47 from w3nl/feature/phase2
Browse files Browse the repository at this point in the history
Remove Jest
  • Loading branch information
w3nl committed Jul 15, 2022
2 parents 6c80a20 + 9b48dee commit ef97047
Show file tree
Hide file tree
Showing 23 changed files with 4,266 additions and 16,887 deletions.
128 changes: 26 additions & 102 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,104 +1,28 @@
{
"extends": "eslint:recommended",
"env": { "es6": true, "node": true, "jquery": true, "browser": true },
"globals": { "Modernizr": false, "W2Form": false, "describe": false, "it": false , "expect": false, "exec": false},
"rules":
{
"no-console": "warn",
"no-cond-assign": "error",
"curly": ["error", "all"],
"no-multi-spaces": "error",
"no-param-reassign": "error",
"no-return-assign": "error",
"no-useless-escape": "error",
"vars-on-top": "error",
"array-bracket-spacing": ["error", "never"],
"block-spacing": "error",
"brace-style": ["error", "1tbs"],
"camelcase": "error",
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", { "before": false, "after": true }],
"eol-last": ["error", "always"],
"func-call-spacing": ["error", "never"],
"indent": ["error", 4],
"jsx-quotes": ["error", "prefer-double"],
"key-spacing": ["error", { "align": "value" }],
"line-comment-position": ["error", { "position": "above" }],
"linebreak-style": ["error", "unix"],
"max-depth": ["error", 10],
"max-len": ["error", 120],
"max-nested-callbacks": ["error", 3],
"max-statements-per-line": ["error", { "max": 1 }],
"new-cap": "error",
"newline-after-var": ["error", "always"],
"newline-before-return": "error",
"newline-per-chained-call":
["error", { "ignoreChainWithDepth": 3 }],
"no-inline-comments": "error",
"no-mixed-operators": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": "error",
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-undef": "error",
"no-underscore-dangle": "error",
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used" }],
"no-whitespace-before-property": "error",
"object-curly-newline": ["error", { "minProperties": 1 }],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"one-var-declaration-per-line": ["error", "always"],
"one-var": ["error", "never"],
"operator-assignment": ["error", "always"],
"padded-blocks": ["error", "never"],
"quotes": ["error", "single"],
"semi-spacing": "error",
"semi": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": ["error", "always"],
"unicode-bom": "error",
"wrap-regex": "error",
"require-jsdoc":
[
"error",
{
"require":
{
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
},
},
],
"valid-jsdoc":
[
"error",
{
"prefer":
{
"arg": "param",
"argument": "param",
"class": "constructor",
"return": "return",
"virtual": "abstract",
},
"preferType":
{
"Boolean": "boolean",
"Number": "number",
"Object": "object",
"String": "string",
},
"requireReturn": false,
"matchDescription": ".+",
"requireParamDescription": false,
"requireReturnDescription": false,
},
],
},
"parserOptions": { "sourceType": "module" },
"extends": [
"@hckrnews/eslint-config"
],
"plugins": [
"import"
],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"js": "always"
}
],
"consistent-return": "warn",
"eqeqeq": "warn"
},
"env": {
"es6": true,
"node": true,
"jquery": false,
"browser": true
},
"parserOptions": {
"sourceType": "module"
},
}
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# These are supported funding model platforms

github: [w3nl]
patreon: w3news
buymeacoffee: https://www.buymeacoffee.com/hckrnews
22 changes: 22 additions & 0 deletions .github/workflows/cpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Copy Paste Detector

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm cpd
run: |
npm ci
npm run cpd
env:
CI: true
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Lint

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm lint
run: |
npm ci
npm run lint
env:
CI: true
25 changes: 7 additions & 18 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,15 @@ on:
types: [created]

jobs:
build:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34 changes: 34 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: SonarCloud

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 18
cache: 'npm'
- name: Install LibreOffice
run: sudo apt install libreoffice
- name: Install imagemagick
run: sudo apt install imagemagick ghostscript
- name: Change ImageMagick policy to allow pdf->png conversion.
run: sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
- name: npm install, lint, and test
run: |
npm ci
npm run lint:report
npm test
env:
CI: true
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
17 changes: 6 additions & 11 deletions .github/workflows/nodejs.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: Node Test

on: [push]

Expand All @@ -9,29 +9,24 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 17.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install LibreOffice
run: sudo apt install libreoffice
- name: Install imagemagick
run: sudo apt install imagemagick ghostscript
- name: Change ImageMagick policy to allow pdf->png conversion.
run: sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
- name: npm install, build, and test
- name: npm test
run: |
npm ci
npm run lint
npm test
npm run build --if-present
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Vulnerability Check

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm vulnerabilities
run: |
npm ci
npm run vulnerabilities
env:
CI: true
14 changes: 14 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"threshold": 0,
"reporters": [
"json",
"console"
],
"ignore": [
"**/__snapshots__/**",
"**/__tests__/**",
"**/__fixtures__/**"
],
"absolute": true,
"gitignore": true
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.5.0
38 changes: 38 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"all": true,
"include": [
"src/**/*.js"
],
"exclude": [
"**/*.test.js"
],
"reporter": [
"text",
"text-summary",
"lcov",
"clover"
],
"check-coverage": true,
"watermarks": {
"lines": [
70,
90
],
"functions": [
70,
90
],
"branches": [
70,
90
],
"statements": [
70,
90
]
},
"branches": 70,
"lines": 90,
"functions": 90,
"statements": 90
}
12 changes: 0 additions & 12 deletions babel.config.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions example/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var {
import {
Ppt2PngConverter
} = require('../dist/converter.js');
var glob = require('glob');
} from '../src/converter.js';
import glob from 'glob';

// options is optional
glob('test/*.ppt*', {}, function(error, files) {
Expand Down
Loading

0 comments on commit ef97047

Please sign in to comment.