Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
soofstad committed Sep 29, 2022
0 parents commit fa8ba5b
Show file tree
Hide file tree
Showing 179 changed files with 21,721 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.config.js
*.config.base.js
*.test.tsx
/packages/plugins/simpos-ui/src/*
/packages/plugins/simos-ui/src/*
/packages/plugins/marmo-ui/src/*
/packages/home/src/plugins.js
/packages/plugins/form/src/test-utils.tsx
dist
34 changes: 34 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"settings": {
"react": {
"version": "17.0.2"
}
},
"env": {
"node": true,
"browser": true,
"es6": true
},
"extends": [
"prettier",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"react/display-name": "off",
"@typescript-eslint/ban-ts-comment": "off",
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-inferrable-types": "off"
}
}
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Declare files that will always have LF line endings on checkout
* text=auto eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Bug Report
about: Report something that is broken or not working as intended
title: ''
labels: 'type: :bug bug'
assignees: ''
---

#### Expected Behaviour

#### Actual Behaviour

#### Steps to Reproduce
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/code-maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Code Maintenance
about: Project cleanup, improve documentation, refactor code
title: ''
labels: 'type: :wrench: maintenance'
assignees: ''

---

#### Describe Problem

#### Suggest Changes

#### Provide Examples
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature Request
about: Suggest an idea for a new feature or enhancement to existing features
title: ''
labels: 'type: :bulb: feature request'
assignees: ''
---

#### Describe Problem

#### Suggest Solution

#### Additional Details
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## What does this pull request change?

## Why is this pull request needed?

## Issues related to this change

70 changes: 70 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '34 19 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
11 changes: 11 additions & 0 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
workflow_dispatch:
push:
branches-ignore:
- master
tags-ignore:
- v*

jobs:
tests:
uses: ./.github/workflows/tests.yaml
13 changes: 13 additions & 0 deletions .github/workflows/on-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
workflow_dispatch:
push:
tags:
- v*

jobs:
tests:
uses: ./.github/workflows/tests.yaml

publish:
needs: tests
uses: ./.github/workflows/publish.yaml
20 changes: 20 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs
on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: cd src && tsc
- run: cd src && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
34 changes: 34 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
# Workflow dispatch is used for manual triggers
workflow_dispatch:
# Workflow call is used for called from another workflow
workflow_call:

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Install Precommit
run: pip install pre-commit
- name: Run prettier formatting
run: pre-commit run prettier --all-files

tests:
strategy:
matrix:
package: [blueprint, default-pdf, default-preview, dmt-core, job, mermaid, yaml-view]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3

# TODO: Cache yarn install

- name: "Web Tests"
run: |
cd packages/${{ matrix.package }}
yarn install
yarn tsc
yarn test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.idea
.vscode
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
exclude: ^.*\.(lock)$||^docs\/
- id: mixed-line-ending
exclude: ^.*\.(lock)$||^docs\/
- id: detect-private-key

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
files: ^.*\.(ts|tsx|js|css|html|json)$
args: ['--config=.prettierrc.js', '--ignore-path=.prettierignore']

- repo: local
hooks:
- id: eslint
name: ESlint
entry: sh -c "npm run lint:fix"
language: system
pass_filenames: false
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/gen/*

build
coverage
node_modules
dist
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// prettier.config.js or .prettierrc.js
// default config
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: false,
singleQuote: true,
}
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM node:16-alpine AS base

ARG AUTH_ENABLED=0
ARG REDIRECT_URI=http://localhost/
# Azure AD requires a scope.
ARG AUTH_SCOPE=""
ARG CLIENT_ID=""
ARG TENANT_ID=""
ENV REACT_APP_AUTH_SCOPE=$AUTH_SCOPE
ENV REACT_APP_AUTH=$AUTH_ENABLED
ENV REACT_APP_AUTH_CLIENT_ID=$CLIENT_ID
ENV REACT_APP_AUTH_TENANT=$TENANT_ID
ENV REACT_APP_TOKEN_ENDPOINT=https://login.microsoftonline.com/${REACT_APP_AUTH_TENANT}/oauth2/v2.0/token
ENV REACT_APP_AUTH_ENDPOINT=https://login.microsoftonline.com/${REACT_APP_AUTH_TENANT}/oauth2/v2.0/authorize
ENV REACT_APP_LOGOUT_ENDPOINT=https://login.microsoftonline.com/${REACT_APP_AUTH_TENANT}/oauth2/logout
ENV REACT_APP_AUTH_REDIRECT_URI=$REDIRECT_URI

WORKDIR /code/
COPY jest.config.base.js package.json yarn.lock jest.config.js tsconfig.json .eslintignore .eslintrc.json ./
COPY --chown=1000 web/packages ./packages
RUN yarn install --ignore-scripts --frozen-lockfile --link-duplicates

FROM base AS development
CMD ["yarn", "start"]

FROM base AS prod
RUN npm install -g serve
RUN yarn build
WORKDIR /code/packages/home
EXPOSE 3000
CMD ["serve", "--single", "build", "--listen", "3000"]
USER 1000
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Equinor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit fa8ba5b

Please sign in to comment.