Skip to content

Commit cb8370f

Browse files
authored
Merge pull request #2 from tropy/structure-update
Structure update
2 parents 622b2bb + be99e01 commit cb8370f

22 files changed

+621
-413
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[*]
2+
end_of_line = lf
3+
insert_final_newline = true
4+
5+
[*.{js,json,scss,yml}]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true

.eslintrc.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
root: true
2+
3+
extends:
4+
- 'eslint:recommended'
5+
6+
parserOptions:
7+
ecmaVersion: 2022
8+
sourceType: module
9+
requireConfigFile: false
10+
11+
env:
12+
es2020: true
13+
node: true
14+
browser: true
15+
16+
rules:
17+
array-bracket-spacing: 2
18+
block-spacing: 2
19+
brace-style: [2, '1tbs', { allowSingleLine: true }]
20+
comma-dangle: 2
21+
comma-spacing: 2
22+
comma-style: 2
23+
complexity: [1, 16]
24+
dot-location: [2, 'property']
25+
eqeqeq: [2, 'smart']
26+
indent: [0, 2, { SwitchCase: 1 }]
27+
indent-legacy: [2, 2, { SwitchCase: 1 }]
28+
key-spacing: [1, { beforeColon: false, afterColon: true }]
29+
keyword-spacing: 2
30+
max-depth: [1, 6]
31+
max-len: [1, 80, 2, { ignoreComments: true, ignoreUrls: true, ignorePattern: "[`'\"\/],?$" }]
32+
max-nested-callbacks: [1, 4]
33+
no-caller: 2
34+
no-constant-condition: [2, { checkLoops: false }]
35+
no-eval: 2
36+
no-implied-eval: 2
37+
no-mixed-spaces-and-tabs: 2
38+
no-multi-str: 2
39+
no-shadow:
40+
[2, { allow: ['done', 'reject', 'resolve', 'conn', 'cb', 'err', 'error'] }]
41+
no-spaced-func: 2
42+
no-trailing-spaces: 2
43+
no-unexpected-multiline: 2
44+
no-unneeded-ternary: 2
45+
no-unreachable: 2
46+
no-useless-concat: 2
47+
no-unsafe-finally: 0
48+
object-curly-spacing: [2, 'always']
49+
operator-linebreak: [2, 'after']
50+
quote-props: [2, 'consistent-as-needed']
51+
quotes: [2, 'single', 'avoid-escape']
52+
radix: 2
53+
require-atomic-updates: 0
54+
semi-spacing: 0
55+
semi: [2, 'never']
56+
space-before-blocks: 2
57+
space-before-function-paren: [2, { anonymous: 'always', named: 'never' }]
58+
space-infix-ops: 2
59+
space-unary-ops: 2
60+
space-in-parens: 2
61+
wrap-regex: 2

.github/workflows/ci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 16
21+
22+
- name: Install dependencies
23+
run: npm install --no-progress --no-package-lock
24+
25+
- name: Lint
26+
run: npm run lint
27+
28+
- name: Test
29+
run: xvfb-run npm run test

.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*.*
6+
7+
env:
8+
PLUGIN_NAME: tropy-plugin-iiif
9+
10+
jobs:
11+
create-release:
12+
name: Create release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: 16
23+
24+
- name: Install dependencies and build
25+
run: |
26+
npm install
27+
npm run build
28+
29+
- name: Generate version name
30+
id: version
31+
run: echo "::set-output name=version::${{ env.PLUGIN_NAME }}-${{github.ref_name}}"
32+
33+
- name: Create zip file
34+
run: |
35+
mkdir ${{ steps.version.outputs.version }}
36+
cp index.js package.json icon.svg third-party-licenses.txt ${{ steps.version.outputs.version }}
37+
zip -r ${{ steps.version.outputs.version }}.zip ${{ steps.version.outputs.version }}
38+
39+
- name: Create release and upload zip file
40+
uses: ncipollo/release-action@v1
41+
with:
42+
artifacts: ${{ steps.version.outputs.version }}.zip
43+
prerelease: true
44+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules
22
package-lock.json
3+
4+
index.js
5+
third-party-licenses.txt

.mocharc.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
color: true
2+
recursive: true
3+
reporter: dot
4+
renderer: true
5+
require:
6+
- test/support/fixtures.js

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.15.0

0 commit comments

Comments
 (0)