Skip to content

Commit

Permalink
Merge pull request #219 from Open-MBEE/develop
Browse files Browse the repository at this point in the history
5.0.0
  • Loading branch information
dlamoris authored Sep 18, 2023
2 parents c978d46 + 3d269e3 commit 4cff4b0
Show file tree
Hide file tree
Showing 1,028 changed files with 117,998 additions and 56,411 deletions.
7 changes: 7 additions & 0 deletions .00_migration_regex/migration_regex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Bundle Builders
src/mms-directives/directives/charts/([a-zA-Z.0-9]*)\.ts
import "./$1";

#Fat Arrow conversion
function\(([a-zA-Z,]*)\)
($1) =>
75 changes: 75 additions & 0 deletions .00_migration_regex/regex.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Step 1
(var|const|let)? ?(\$?scope\.)?([a-zA-Z]*) (= )?function? ?(\([A-Za-z, \?]*\))( =>)?
public $2$3

function? ?([a-zA-Z]*) ?(\([A-Za-z, \?]*\))( =>)?
^([^\S\r\n])[\s\t]*function ([_a-zA-Z]*) ?(\([A-Za-z, \?]*\))
public $1$2

Step 2
([a-zA-Z]*)Service\.(?!provider|factory|service)
this.\l$1Svc.

(this\.)?((\$interval|\$http|\$window|\$q|\$timeout|\$uibModal|\$state|\$localStorage|autosaveSvc|growl|hotkeys|rootScopeSvc|eventSvc|edit)(\.|\())
this.$2

function ?(\([0-9a-zA-Z_ ,:]*\))
$1 =>


public $2$3
Region\.prototype\.([a-zA-Z]*) = (\([a-z,]*\)) =>
(width|right|left|top|bottom|height)
([a-zA-Z]*)Service\.(?!provider|factory|service)
function ?(\([a-zA-Z_ ,]*\))

//Services in constructors
([a-zA-Z]*)Service(,?)
private \l$1Svc: $1Service$2

//Angular providers in constructors
(\$)?([a-zA-Z]{2,20})(,?)
private $1$2: angular.I\u$2Service

//Constructor to static $inject
\s*(public|private) (\$)?([a-zA-Z]{2,20}|\$q): [A-Z<>a-z\.]*(,?)\n?
'$2$3'$4

//then convert back to Service formal names
'([a-zA-Z]*)Svc'
'\u$1Service'

//Bindings
([A-Za-z]{2,15}),
$1: "<",\n

: '?"?[@<\?>a-zA-Z]{1,15}'?"?,?
;


this\.(editing|editable|edit|keepMode|editValue)

private ([a-zA-Z]{0,20}) ?:? ?([a-zA-Z$]*)


//Change existing prototypes to instances for callback
( )(public|private)? ([_a-zA-Z]{2,50})(\<[A-Z,]*\>)?(\([\n_A-Za-z:=>\(\), \$\?]*\))(: [| A-Z_a-z]*)? \{
$1$2 $3 = $4$5 => {

For refactoring
((import \{)(, )?(.*)(\} from "@ve-utils/mms-api-client")(;)?\n)?((import \{)(.*), ?(AuthService|CacheService|ElementService|HttpService|PermissionsService|ProjectService|URLService|ViewService)(\n)?(, )?(.*)?(, )?(\} from "@ve-utils/services"))
import \{$4, $10\} from "@ve-utils/mms-api-client";\n$8$9$11$12$14


myStr
angular.module('veDirectives')['_invokeQueue'].forEach(function(value){
var tag = value[2][0].replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
console.log(value[1] + ": " + tag);
});

//Module Exports
import ("[A-Za-z./]*";)
export * from $1


(\(|: |, )bootstrap.(?!box|gradient|reset|\$link-|\$breadcrumb-|\$popover-|\$padding-|\$cursor-|\$jumbotron-|\$carousel-|\$badge-|\$close-|\$label-|\$line-|\$input-|\$thumbnail-|\$screen-|\$dropdown-|\$navbar-|\$grid-|\$panel|-\$well|\$alert-|\$progress-|\$list|\$border-|\$zindex|\$icon|\$bootstrap|\$caret|\$font|\$line|\$tooltip|\$btn)(\$)?
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.11.2-browsers
- image: cimg/node:20.1.0-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -25,11 +25,11 @@ jobs:
# fallback to using the latest cache if no exact match is found
- openmbee-ve-

- run: npm install
- run: yarn install

- save_cache:
paths:
- node_modules
key: openmbee-ve-{{ checksum "package.json" }}

- run: ./node_modules/grunt/bin/grunt #--ARTIFACTORY_URL=https://oss.jfrog.org --ARTIFACTORY_USER=$ARTIFACTORY_USER --ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD --SNAPSHOT_REPO=oss-snapshot-local --RELEASE_REPO=oss-release-local --GROUP_ID=org.openmbee deploy
- run: VE_ENV=example yarn test
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
Dockerfile
*

!yarn.lock
!webpack.config.ts
!package.json
!src/
!config/
!tsconfig.json
!lib
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/lib/**/*.js
src/ve-extensions/present-plots/*
src/ve-extensions/ts-diagram/*
119 changes: 119 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"root": true,
"extends": ["eslint:recommended"],
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"overrides": [
{
"files": ["**/*.ts"],
"settings": {
"import/extensions": [".js", ".ts"],
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"typescript": {
"alwaysCheckTypes": true,
"project": "./tsconfig.json",
"extensions": [".ts", ".tsx"]
},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"moduleDirectory": ["node_modules"]
}
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "./"
},
"plugins": ["unused-imports"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"no-multiple-empty-lines": 2,
"import/newline-after-import": [2],
"@typescript-eslint/explicit-function-return-type": 2,
"@typescript-eslint/no-inferrable-types": [
2,
{
"ignoreProperties": true
}
],
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"pathGroups": [
{
"pattern": "@/**",
"group": "external",
"position": "after"
},
{
"pattern": "@ve-app",
"group": "internal",
"position": "after"
},
{
"pattern": "@ve-components",
"group": "internal",
"position": "after"
},
{
"pattern": "@ve-core",
"group": "internal",
"position": "after"
},
{
"pattern": "@ve-utils",
"group": "internal",
"position": "after"
},
{
"pattern": "@ve-types/**",
"group": "type",
"position": "after"
},
{
"pattern": "../../lib/**",
"group": "external",
"position": "after"
}
],
"groups": [
"builtin",
"external",
"internal",
"unknown",
"parent",
"sibling",
"index",
"object",
"type"
]
}
]
}
}
]
}
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "develop", "master" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: "39 21 * * 4"

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

strategy:
fail-fast: false
matrix:
language: [ javascript ]

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ build
dist
deploy
docs
app/bower_components
app/bower_components_target
/app/*
.sass-cache
.idea
PhantomJS_*
Chrome_*
test-results/
angular-mms-grunt-servers.json
venv
.vscode
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// prettier.config.js or .prettierrc.js
module.exports = {
trailingComma: 'es5',
tabWidth: 4,
singleQuote: true,
printWidth: 120,
}
16 changes: 16 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"selector-type-no-unknown": [true, {
"ignore": [
"custom-types"
]
}],
"no-duplicate-selectors": null,
"no-descending-specificity": null,
"scss/at-extend-no-missing-placeholder": null,
"max-line-length": null,
"declaration-block-no-duplicate-properties": null,
"function-linear-gradient-no-nonstandard-direction": null
}
}
Loading

0 comments on commit 4cff4b0

Please sign in to comment.