diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 85109e7ba9..0000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,100 +0,0 @@ -// eslint-disable-next-line no-undef -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - plugins: [ - "@typescript-eslint", - ], - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react-hooks/recommended" - ], - env: { - "browser": true, - "amd": true - }, - globals: { - "dojo": "readonly", - "dijit": "readonly", - "dojoConfig": "readonly", - "debugConfig": "readonly", - "Promise": "readonly" - }, - rules: { - "no-redeclare": "off", - "no-empty": "off", - "no-empty-pattern": "off", - "no-constant-condition": "off", - "no-case-declarations": "off", - "no-prototype-builtins": "off", - "no-unused-vars": "off", - "no-useless-escape": "off", - "no-unexpected-multiline": "off", - "no-extra-boolean-cast": "off", - "no-self-assign": "off", - "no-multiple-empty-lines": [ - "error", { - max: 1 - } - ], - "no-console": [1, { - "allow": ["info", "warn", "error"] - }], - "func-call-spacing": ["error", "never"], - "space-before-function-paren": ["error", { - "anonymous": "always", - "named": "never", - "asyncArrow": "always" - }], - "comma-spacing": [ - "error", { - "before": false, - "after": true - } - ], - - "prefer-rest-params": "off", - "prefer-spread": "off", - - "semi": ["error", "always"], - "quotes": [ - "error", - "double", { - "avoidEscape": true - } - ], - - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/ban-types": [ - "error", - { - "types": { - // add a custom message, AND tell the plugin how to fix it - "String": { - "message": "Use string instead", - "fixWith": "string" - }, - - "{}": { - "message": "Use object instead", - "fixWith": "object" - }, - - "object": false - } - } - ], - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-var-require": "off", - "@typescript-eslint/no-unsafe-declaration-merging": "off" - } -}; diff --git a/.github/workflows/ossar-analysis.yml b/.github/workflows/ossar-analysis.yml deleted file mode 100644 index 78d3efe81d..0000000000 --- a/.github/workflows/ossar-analysis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow integrates a collection of open source static analysis tools -# with GitHub code scanning. For documentation, or to provide feedback, visit -# https://github.com/github/ossar-action -name: OSSAR - -on: - pull_request: - -jobs: - OSSAR-Scan: - name: Open Source Static Analysis Runner - - # OSSAR runs on windows-latest. - # ubuntu-22.04 and macos-latest support coming soon - runs-on: windows-latest - - steps: - # Checkout your code repository to scan - - name: Checkout repository - uses: actions/checkout@v4 - # Skip demos - - name: Remove File - uses: JesseTG/rm@v1.0.3 - with: - path: ./demos - - # Ensure a compatible version of dotnet is installed. - # The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201. - # A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action. - # GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped. - # For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action: - # - name: Install .NET - # uses: actions/setup-dotnet@v1 - # with: - # dotnet-version: '3.1.x' - - # Run open source static analysis tools - - name: Run OSSAR - uses: github/ossar-action@v1 - id: ossar - - # Upload results to the Security tab - - name: Upload results to Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: ${{ steps.ossar.outputs.sarifFile }} diff --git a/.gitignore b/.gitignore index d404970de6..88e50eae5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .eclcc .env .nx +.vite-inspect/ node_modules dist/ dist-test/ diff --git a/demos/gallery/.vscode/launch.json b/demos/gallery/.vscode/launch.json index 9f873b51f5..c631ae330c 100644 --- a/demos/gallery/.vscode/launch.json +++ b/demos/gallery/.vscode/launch.json @@ -1,11 +1,19 @@ { + "version": "0.2.0", "configurations": [ { - "name": "Launch Edge", + "name": "index.html", "request": "launch", "type": "msedge", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}" + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] } ] } \ No newline at end of file diff --git a/demos/gallery/index.html b/demos/gallery/index.html index ce8863467b..a42f681646 100644 --- a/demos/gallery/index.html +++ b/demos/gallery/index.html @@ -6,6 +6,7 @@
, props: Readonly
, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) { - React.render(React.h(C, props), parent, replaceNode); +export function render
(C: FunctionComponent
, props: Readonly
, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {
+ preactRender(h(C, props), parent, replaceNode);
}
-export interface FunctionComponent (C: React.FunctionComponent , props: Readonly , parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {
- React.render(React.h("svg", null, React.h(C, props)), parent, replaceNode);
+export function svgRender (C: FunctionComponent , props: Readonly , parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {
+ preactRender(h("svg", null, h(C, props)), parent, replaceNode);
}
export class HTMLAdapter extends HTMLWidget {
@@ -30,7 +27,7 @@ export class HTMLAdapter extends HTMLWidget {
return this;
}
- constructor(protected readonly _component: React.FunctionComponent ) {
+ constructor(protected readonly _component: FunctionComponent ) {
super();
}
@@ -64,7 +61,7 @@ export class SVGAdapter extends SVGWidget {
return this;
}
- constructor(protected readonly _component: React.FunctionComponent ) {
+ constructor(protected readonly _component: FunctionComponent ) {
super();
}
diff --git a/packages/react/src/shape.tsx b/packages/react/src/shape.tsx
index a44f93821e..caf8d9da28 100644
--- a/packages/react/src/shape.tsx
+++ b/packages/react/src/shape.tsx
@@ -1,4 +1,4 @@
-import * as React from "@hpcc-js/preact-shim";
+import { FunctionComponent } from "preact";
interface CircleProps {
radius?: number;
@@ -8,7 +8,7 @@ interface CircleProps {
shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
}
-export const Circle: React.FunctionComponent