Skip to content

Commit

Permalink
Merge pull request #5 from datavisyn/release-1.0.0
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
Anita Steiner authored Sep 8, 2022
2 parents 7cc3e93 + cdd55a9 commit 0d8f3fe
Show file tree
Hide file tree
Showing 118 changed files with 23,670 additions and 5 deletions.
86 changes: 86 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
version: 2.1

executors:
node-executor:
working_directory: ~/visyn
docker:
- image: circleci/node:16-buster

jobs:
build:
executor: node-executor
steps:
- checkout
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: Install npm dependencies
command: npm install
- save_cache:
key: deps-{{ .Branch }}-{{ checksum "package.json" }}
paths: ./node_modules
- run:
name: Show installed npm dependencies
command: npm list --depth=1 || true
- run:
name: Run linting
command: npm run lint
- run:
name: Run test
command: npm run test
- persist_to_workspace:
root: ~/visyn
paths: .
publish:
executor: node-executor
steps:
- attach_workspace:
at: ~/visyn
- run:
name: Authentication
command: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Publish package
command: npm publish
workflows:
version: 2.1
# build-nightly:
# triggers:
# - schedule:
# cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
# filters:
# branches:
# only:
# - develop
# jobs:
# - build
build-branches-only:
jobs:
- build:
filters:
tags:
ignore: /.*/
build-publish-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- publish:
context:
- org-public
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
plugins: ['prettier'],
env: {
browser: true,
commonjs: true,
es2021: true,
},
extends: ['airbnb-base'],
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
'max-len': 'off',
},
overrides: [
{
files: ['tests/**/*.test.js'],
env: {
jest: true,
},
},
],
};
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @datavisyn/core

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 🐛Bug Report
about: Create a bug report to help us improve
title: ""
labels: ["type: bug"]
assignees: ""

---

### Environment

* Release number or git hash:
* Browser:
* Deployed / Local:
---

### Steps to reproduce the bug

1. Open a list of ... / Search ...
2. Do something else

### Observed Behavior

> Please provide a short description of the actual behavior you observed
> If applicable, add screenshots to help explain your problem.
> - Any unexpected output or action (or lack of expected output or action)
> - Web browser console errors (including tracebacks)
> - Server errors (relevant messages and tracebacks)
> - Static or animated images showing the UI behavior
### Expected Behavior

> Please provide a short description which behavior you expected from your steps
Thanks for taking the time to fill out this bug report 🤗
Make sure there aren't any open/closed issues for this topic 😃
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: ✨Feature Request
about: Request a new feature or enhancement
title: ""
labels: ["type: feature"]
---

## Short description

Please provide a short description which summarizes the idea behind this feature request and why this is useful.

## User stories

* As a *user*, I want to ... so that ...


Please make sure this feature request hasn't been already submitted by someone by looking through other open/closed issues 😃
45 changes: 45 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Closes *list issues numbers here*

### Developer Checklist (Definition of Done)

**Issue**

- [ ] All acceptance criteria from the issue are met
- [ ] Tested in latest Chrome/Firefox

**UI/UX/Vis**

- [ ] Requires UI/UX/Vis review
- [ ] Reviewer(s) are notified (_tag assignees_)
- [ ] Review has occurred (_link to notes_)
- [ ] Feedback is included in this PR
- [ ] Reviewer(s) approve of concept and design

**Code**

- [ ] Branch is up-to-date with the branch to be merged with, i.e., develop
- [ ] Code is cleaned up and formatted
- [ ] Unit tests are written (frontend/backend if applicable)
- [ ] Integration tests are written (if applicable)

**PR**

- [ ] Descriptive title for this pull request is provided (will be used for release notes later)
- [ ] Reviewer and assignees are defined
- [ ] Add type label (e.g., *bug*, *feature*) to this pull request
- [ ] Add release label (e.g., `release: minor`) to this PR following [semver](https://semver.org/)
- [ ] The PR is connected to the corresponding issue (via `Closes #...`)
- [ ] [Summary of changes](#summary-of-changes) is written


### Summary of changes

-

### Screenshots


### Additional notes for the reviewer(s)

-
Thanks for creating this pull request 🤗
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: build

on: [push, workflow_dispatch]

jobs:
build:
uses: datavisyn/github-workflows/.github/workflows/build-node.yml@node16
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: release

on: workflow_dispatch

jobs:
release:
uses: datavisyn/github-workflows/.github/workflows/release-source.yml@main
secrets: inherit
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
package-lock.json

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
endOfLine: 'auto',
singleQuote: true,
trailingComma: 'all',
printWidth: 160,
};
783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.2.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-3.2.2.cjs
nodeLinker: node-modules
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2016, davavisyn GmbH
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 changes: 47 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
visyn_scripts
=====================
[![Target Discovery Platform][tdp-image-client]][tdp-url] [![Target Discovery Platform][tdp-image-server]][tdp-url] [![NPM version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url]
[![NPM version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url]

This package includes scripts and configuration files used by [datavisyn](https://datavisyn.io/) repositories. Collecting everything in a single installable repository unifies configurations across many repositories, thus reducing the maintenance overhead.

## Usage

Install visyn_scripts via npm: `npm i --save-dev git+ssh://[email protected]/datavisyn/visyn_scripts.git#develop`

Add visyn_scripts to your package.json scripts, i.e. add `"compile": "visyn_scripts compile"` and execute it with `npm run compile`, or alternatively directly execute it with `npx visyn_scripts compile`.

## Scripts

The main purpose of visyn_scripts are the unified scripts:

### build
Builds a workspace using webpack.

### compile
Builds a repository using typescript.

### copy
Copies assets, styles, and static files to the dist folder.

### docs
Generates docs of a repository using typedoc.

### lint
Lints a repository using ESLint.

### test
Tests a repository using Jest.

## Configurations

visyn_scripts also includes default configurations for ESLint, Prettier, Typescript, ...
To integrate them in an existing repository, simply switch to `.js` configurations and reexport the configurations found in visyn_scripts. This way, any editor will look for a `.prettierrc.js` in the repository, and will find one exporting the common configuration.

```javascript
module.exports = require('visyn_scripts/config/prettierrc.template');
```

## FAQ

...


***
Expand All @@ -15,7 +57,7 @@ This repository is part of the **Target Discovery Platform** (TDP). For tutorial
[tdp-image-client]: https://img.shields.io/badge/Target%20Discovery%20Platform-Client%20Plugin-F47D20.svg
[tdp-image-server]: https://img.shields.io/badge/Target%20Discovery%20Platform-Server%20Plugin-10ACDF.svg
[tdp-url]: http://datavisyn.io
[npm-image]: https://badge.fury.io/js/tdp_core.svg
[npm-url]: https://npmjs.org/package/tdp_core
[circleci-image]: https://circleci.com/gh/datavisyn/tdp_core.svg?style=shield
[circleci-url]: https://circleci.com/gh/datavisyn/tdp_core
[npm-image]: https://badge.fury.io/js/visyn_scripts.svg
[npm-url]: https://npmjs.org/package/visyn_scripts
[circleci-image]: https://circleci.com/gh/datavisyn/visyn_scripts.svg?style=shield
[circleci-url]: https://circleci.com/gh/datavisyn/visyn_scripts
15 changes: 15 additions & 0 deletions bin/commands/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { resolve } = require('path');
const { call } = require('./utils');

module.exports = {
command: 'build [strings...]',
describe: 'Build a workspace using webpack',
handler: (args) => {
const configPath = resolve(__dirname, '../../config/webpack.config.js');
call('webpack', `--config ${configPath} ${(args.strings || []).join(' ')}`, {
env: {
NODE_OPTIONS: '--max-old-space-size=4096',
},
});
},
};
9 changes: 9 additions & 0 deletions bin/commands/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { call } = require('./utils');

module.exports = {
command: 'clean [strings...]',
describe: 'Clean files and folders using rimraf',
handler: (args) => {
call('rimraf', (args.strings || []).join(' '));
},
};
9 changes: 9 additions & 0 deletions bin/commands/compile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { call } = require('./utils');

module.exports = {
command: 'compile [strings...]',
describe: 'Build a repository using typescript',
handler: (args) => {
call('tsc', `${(args.strings || []).join(' ')}`);
},
};
13 changes: 13 additions & 0 deletions bin/commands/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { call } = require('./utils');

module.exports = {
command: 'copy',
describe: 'Copy assets, styles, and static files to the dist folder',
handler: () => {
call('shx', "--verbose cp -r src/assets/. dist/assets/ || echo 'no assets copied'");
call('shx', "--verbose cp -R src/template/. dist/template/ || echo 'no template copied'");
call('shx', "--verbose cp -R src/templates/. dist/templates/ || echo 'no templates copied'");
call('shx', "--verbose cp -R src/scss/. dist/scss/ || echo 'no scss files copied'");
call('shx', '--verbose cp "src/*.{txt,html,ejs,json}" dist/ || echo \'no file copied\'');
},
};
Loading

0 comments on commit 0d8f3fe

Please sign in to comment.