Skip to content

Commit

Permalink
feat: Update dependencies, adopt latest build process
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-lacatus committed Sep 5, 2023
1 parent 5ad5351 commit 8c73edc
Show file tree
Hide file tree
Showing 19 changed files with 6,990 additions and 4,937 deletions.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
THINGWORX_SERVER=http://localhost:8015
THINGWORX_USER=Administrator
THINGWORX_PASSWORD=Administrator12345
78 changes: 78 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:prettier/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
parserOptions: {
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
project: true,
tsconfigRootDir: __dirname,
},
plugins: ['prettier', '@typescript-eslint'],
rules: {
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
// Deactivated because it also disables the use of readonly T[] over ReadonlyArray<T>
// and readonly T[] can be confusing (is T or the array readonly)
'@typescript-eslint/array-type': 'off',

// Disabled because this defeats one the purposes of template expressions, to make it easy to
// log values which may be incorrect or mistyped
'@typescript-eslint/restrict-template-expressions': 'off',

// Disabled because this prevents passing around unbound functions in all cases, even when they
// don't reference this in the implementation at all and the workaround of specifying this: void
// as the first argument is very awkward
'@typescript-eslint/unbound-method': 'off',
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true },
],
'@typescript-eslint/no-var-requires': ['error'],
},
},
],
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
ignorePatterns: '.eslintrc.cjs',
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ ui
.gradle
build
zip
.idea/
.vscode/
.env
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 4
}
100 changes: 53 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,73 @@
"name": "svgViewer",
"version": "1.2.1",
"description": "A svg viewer allowing viewing svg files, as well as interacting with them dynamically.",
"thingworxServer": "http://localhost:8015/",
"thingworxUser": "Administrator",
"thingworxPassword": "Administrator12345",
"author": "placatus@iqnox.com",
"minimumThingWorxVersion": "6.0.0",
"homepage": "https://github.com/ptc-iot-sharing/SvgViewerWidgetTWX",
"autoUpdate": {
"gitHubURL": "https://api.github.com/repos/ptc-iot-sharing/SvgViewerWidgetTWX/releases/latest",
"giteaURL": "http://roicentersvn/api/v1/repos/placatus/SvgViewerWidget/releases/latest"
},
"repository": {
"type": "git",
"url": "https://github.com/ptc-iot-sharing/SvgViewerWidgetTWX.git"
},
"author": "placatus@iqnox.com",
"minimumThingWorxVersion": "6.0.0",
"homepage": "https://github.com/ptc-iot-sharing/SvgViewerWidgetTWX",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint:check": "eslint --ext ts,tsx src",
"lint:fix": "eslint --ext ts,tsx --fix src",
"build": "webpack --mode production",
"buildDev": "webpack --mode development",
"watch": "webpack --watch --mode development",
"server": "webpack-dev-server --open",
"upload": "webpack --mode development --env.upload",
"init": "webpack --env.init",
"server": "webpack serve",
"upload": "webpack --mode development --env upload",
"prepublishOnly": "rm -rf dist && mkdir dist && yarn run build && mv zip/* dist && yarn run buildDev && mv zip/* dist"
},
"type": "module",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.5.5",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.5",
"@types/jquery": "^3.3.31",
"@types/node": "^14.6.4",
"@types/webpack-env": "^1.14.0",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.1.0",
"css-loader": "^4.2.2",
"dtsbundler-webpack-plugin": "github:stefan-lacatus/dtsbundler-webpack-plugin#master",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^6.1.0",
"fork-ts-checker-webpack-plugin": "^5.1.0",
"jimp": "^0.16.1",
"request": "^2.88.0",
"responsive-loader": "^2.0.2",
"source-map-loader": "^1.1.0",
"style-loader": "^1.0.0",
"ts-loader": "^8.0.3",
"typescript": "^4.0.2",
"url-loader": "^4.1.0",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.8.0",
"webpack-encoding-plugin": "^0.3.1",
"xml2js": "^0.4.19",
"zip-webpack-plugin": "^3.0.0"
"@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/exec": "^6.0.1",
"@semantic-release/git": "^10.0.0",
"@semantic-release/gitlab": "^12.0.5",
"@types/jquery": "^3.5.14",
"@types/node": "^20.5.9",
"@types/webpack-env": "^1.18.0",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^16.0.3",
"dts-bundle-webpack": "^1.0.2",
"esbuild-loader": "^4.0.2",
"esbuild-register": "^3.4.2",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.32.2",
"extract-loader": "^5.1.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"prettier": "^3.0.0",
"source-map-loader": "^4.0.1",
"style-loader": "^3.3.2",
"ts-declaration-webpack-plugin": "^1.2.3",
"typescript": "^5.1.6",
"webpack": "^5.82.0",
"webpack-cli": "^5.0.2",
"webpack-dev-server": "^4.13.3",
"webpack-merge": "^5.3.0",
"xml2js": "^0.6.2",
"zip-webpack-plugin": "^4.0.1"
},
"dependencies": {
"panzoom": "^9.2.5",
"typescriptwebpacksupport": "^2.0.9"
"panzoom": "^9.4.3",
"typescriptwebpacksupport": "^2.2.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
24 changes: 24 additions & 0 deletions src/@types/assets/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
declare module '*.jpg' {
const content: string;
export default content;
}

declare module '*.png' {
const content: string;
export default content;
}

declare module '*.json' {
const content: string;
export default content;
}

declare module '*.svg' {
const content: string;
export default content;
}

declare module '*.css' {
const content: string;
export default content;
}
Loading

0 comments on commit 8c73edc

Please sign in to comment.