From ca78254ae2734a32fd09e6388b10dbdb5ecd41bd Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 23 Nov 2020 08:50:29 +0100 Subject: [PATCH] Scaffold file explorer react app --- libs/remix-ui/file-explorer/.babelrc | 4 + libs/remix-ui/file-explorer/.eslintrc | 248 ++++++++++++++++++ libs/remix-ui/file-explorer/README.md | 7 + libs/remix-ui/file-explorer/src/index.ts | 1 + .../file-explorer/src/lib/file-explorer.css | 0 .../file-explorer/src/lib/file-explorer.tsx | 16 ++ libs/remix-ui/file-explorer/tsconfig.json | 16 ++ libs/remix-ui/file-explorer/tsconfig.lib.json | 13 + nx.json | 3 + package.json | 2 +- tsconfig.json | 3 +- workspace.json | 19 ++ 12 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 libs/remix-ui/file-explorer/.babelrc create mode 100644 libs/remix-ui/file-explorer/.eslintrc create mode 100644 libs/remix-ui/file-explorer/README.md create mode 100644 libs/remix-ui/file-explorer/src/index.ts create mode 100644 libs/remix-ui/file-explorer/src/lib/file-explorer.css create mode 100644 libs/remix-ui/file-explorer/src/lib/file-explorer.tsx create mode 100644 libs/remix-ui/file-explorer/tsconfig.json create mode 100644 libs/remix-ui/file-explorer/tsconfig.lib.json diff --git a/libs/remix-ui/file-explorer/.babelrc b/libs/remix-ui/file-explorer/.babelrc new file mode 100644 index 0000000000..09d67939cc --- /dev/null +++ b/libs/remix-ui/file-explorer/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["@nrwl/react/babel"], + "plugins": [] +} diff --git a/libs/remix-ui/file-explorer/.eslintrc b/libs/remix-ui/file-explorer/.eslintrc new file mode 100644 index 0000000000..977f139a09 --- /dev/null +++ b/libs/remix-ui/file-explorer/.eslintrc @@ -0,0 +1,248 @@ +{ + "rules": { + "array-callback-return": "warn", + "dot-location": ["warn", "property"], + "eqeqeq": ["warn", "smart"], + "new-parens": "warn", + "no-caller": "warn", + "no-cond-assign": ["warn", "except-parens"], + "no-const-assign": "warn", + "no-control-regex": "warn", + "no-delete-var": "warn", + "no-dupe-args": "warn", + "no-dupe-keys": "warn", + "no-duplicate-case": "warn", + "no-empty-character-class": "warn", + "no-empty-pattern": "warn", + "no-eval": "warn", + "no-ex-assign": "warn", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-label": "warn", + "no-fallthrough": "warn", + "no-func-assign": "warn", + "no-implied-eval": "warn", + "no-invalid-regexp": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-labels": ["warn", { "allowLoop": true, "allowSwitch": false }], + "no-lone-blocks": "warn", + "no-loop-func": "warn", + "no-mixed-operators": [ + "warn", + { + "groups": [ + ["&", "|", "^", "~", "<<", ">>", ">>>"], + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": false + } + ], + "no-multi-str": "warn", + "no-native-reassign": "warn", + "no-negated-in-lhs": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-obj-calls": "warn", + "no-octal": "warn", + "no-octal-escape": "warn", + "no-redeclare": "warn", + "no-regex-spaces": "warn", + "no-restricted-syntax": ["warn", "WithStatement"], + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-shadow-restricted-names": "warn", + "no-sparse-arrays": "warn", + "no-template-curly-in-string": "warn", + "no-this-before-super": "warn", + "no-throw-literal": "warn", + "no-restricted-globals": [ + "error", + "addEventListener", + "blur", + "close", + "closed", + "confirm", + "defaultStatus", + "defaultstatus", + "event", + "external", + "find", + "focus", + "frameElement", + "frames", + "history", + "innerHeight", + "innerWidth", + "length", + "location", + "locationbar", + "menubar", + "moveBy", + "moveTo", + "name", + "onblur", + "onerror", + "onfocus", + "onload", + "onresize", + "onunload", + "open", + "opener", + "opera", + "outerHeight", + "outerWidth", + "pageXOffset", + "pageYOffset", + "parent", + "print", + "removeEventListener", + "resizeBy", + "resizeTo", + "screen", + "screenLeft", + "screenTop", + "screenX", + "screenY", + "scroll", + "scrollbars", + "scrollBy", + "scrollTo", + "scrollX", + "scrollY", + "self", + "status", + "statusbar", + "stop", + "toolbar", + "top" + ], + "no-unexpected-multiline": "warn", + "no-unreachable": "warn", + "no-unused-expressions": [ + "error", + { + "allowShortCircuit": true, + "allowTernary": true, + "allowTaggedTemplates": true + } + ], + "no-unused-labels": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-escape": "warn", + "no-useless-rename": [ + "warn", + { + "ignoreDestructuring": false, + "ignoreImport": false, + "ignoreExport": false + } + ], + "no-with": "warn", + "no-whitespace-before-property": "warn", + "react-hooks/exhaustive-deps": "warn", + "require-yield": "warn", + "rest-spread-spacing": ["warn", "never"], + "strict": ["warn", "never"], + "unicode-bom": ["warn", "never"], + "use-isnan": "warn", + "valid-typeof": "warn", + "no-restricted-properties": [ + "error", + { + "object": "require", + "property": "ensure", + "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" + }, + { + "object": "System", + "property": "import", + "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" + } + ], + "getter-return": "warn", + "import/first": "error", + "import/no-amd": "error", + "import/no-webpack-loader-syntax": "error", + "react/forbid-foreign-prop-types": ["warn", { "allowInPropTypes": true }], + "react/jsx-no-comment-textnodes": "warn", + "react/jsx-no-duplicate-props": "warn", + "react/jsx-no-target-blank": "warn", + "react/jsx-no-undef": "error", + "react/jsx-pascal-case": ["warn", { "allowAllCaps": true, "ignore": [] }], + "react/jsx-uses-react": "warn", + "react/jsx-uses-vars": "warn", + "react/no-danger-with-children": "warn", + "react/no-direct-mutation-state": "warn", + "react/no-is-mounted": "warn", + "react/no-typos": "error", + "react/react-in-jsx-scope": "error", + "react/require-render-return": "error", + "react/style-prop-object": "warn", + "react/jsx-no-useless-fragment": "warn", + "jsx-a11y/accessible-emoji": "warn", + "jsx-a11y/alt-text": "warn", + "jsx-a11y/anchor-has-content": "warn", + "jsx-a11y/anchor-is-valid": [ + "warn", + { "aspects": ["noHref", "invalidHref"] } + ], + "jsx-a11y/aria-activedescendant-has-tabindex": "warn", + "jsx-a11y/aria-props": "warn", + "jsx-a11y/aria-proptypes": "warn", + "jsx-a11y/aria-role": "warn", + "jsx-a11y/aria-unsupported-elements": "warn", + "jsx-a11y/heading-has-content": "warn", + "jsx-a11y/iframe-has-title": "warn", + "jsx-a11y/img-redundant-alt": "warn", + "jsx-a11y/no-access-key": "warn", + "jsx-a11y/no-distracting-elements": "warn", + "jsx-a11y/no-redundant-roles": "warn", + "jsx-a11y/role-has-required-aria-props": "warn", + "jsx-a11y/role-supports-aria-props": "warn", + "jsx-a11y/scope": "warn", + "react-hooks/rules-of-hooks": "error", + "default-case": "off", + "no-dupe-class-members": "off", + "no-undef": "off", + "@typescript-eslint/consistent-type-assertions": "warn", + "no-array-constructor": "off", + "@typescript-eslint/no-array-constructor": "warn", + "@typescript-eslint/no-namespace": "error", + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": [ + "warn", + { + "functions": false, + "classes": false, + "variables": false, + "typedefs": false + } + ], + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { "args": "none", "ignoreRestSiblings": true } + ], + "no-useless-constructor": "off", + "@typescript-eslint/no-useless-constructor": "warn" + }, + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "jest": true, + "node": true + }, + "settings": { "react": { "version": "detect" } }, + "plugins": ["import", "jsx-a11y", "react", "react-hooks"], + "extends": ["../../../.eslintrc"], + "ignorePatterns": ["!**/*"] +} diff --git a/libs/remix-ui/file-explorer/README.md b/libs/remix-ui/file-explorer/README.md new file mode 100644 index 0000000000..d38b498f59 --- /dev/null +++ b/libs/remix-ui/file-explorer/README.md @@ -0,0 +1,7 @@ +# remix-ui-file-explorer + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test remix-ui-file-explorer` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/remix-ui/file-explorer/src/index.ts b/libs/remix-ui/file-explorer/src/index.ts new file mode 100644 index 0000000000..7f375b8fb6 --- /dev/null +++ b/libs/remix-ui/file-explorer/src/index.ts @@ -0,0 +1 @@ +export * from './lib/file-explorer' diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.css b/libs/remix-ui/file-explorer/src/lib/file-explorer.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx new file mode 100644 index 0000000000..2582096189 --- /dev/null +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -0,0 +1,16 @@ +import React from 'react' + +import './remix-ui-file-explorer.css' + +/* eslint-disable-next-line */ +export interface FileExplorerProps {} + +export const FileExplorer = (props: FileExplorerProps) => { + return ( +
+

Welcome to file-explorer!

+
+ ) +} + +export default FileExplorer diff --git a/libs/remix-ui/file-explorer/tsconfig.json b/libs/remix-ui/file-explorer/tsconfig.json new file mode 100644 index 0000000000..6b65264565 --- /dev/null +++ b/libs/remix-ui/file-explorer/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "jsx": "react", + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/libs/remix-ui/file-explorer/tsconfig.lib.json b/libs/remix-ui/file-explorer/tsconfig.lib.json new file mode 100644 index 0000000000..b560bc4dec --- /dev/null +++ b/libs/remix-ui/file-explorer/tsconfig.lib.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": ["node"] + }, + "files": [ + "../../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../../node_modules/@nrwl/react/typings/image.d.ts" + ], + "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} diff --git a/nx.json b/nx.json index e27c2d38e4..4f324dd6cf 100644 --- a/nx.json +++ b/nx.json @@ -86,6 +86,9 @@ }, "remix-ui-toaster": { "tags": [] + }, + "remix-ui-file-explorer": { + "tags": [] } } } diff --git a/package.json b/package.json index affda60c1f..030cea751f 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "workspace-schematic": "nx workspace-schematic", "dep-graph": "nx dep-graph", "help": "nx help", - "lint:libs": "nx run-many --target=lint --projects=remixd,remix-ui-modal-dialog,remix-ui-toaster", + "lint:libs": "nx run-many --target=lint --projects=remixd,remix-ui-modal-dialog,remix-ui-toaster,remix-ui-file-explorer", "build:libs": "nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd", "test:libs": "nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd", "publish:libs": "npm run build:libs & lerna publish --skip-git & npm run bumpVersion:libs", diff --git a/tsconfig.json b/tsconfig.json index 07d617152b..f267d32ab8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,7 +33,8 @@ "@remix-ui/clipboard": ["libs/remix-ui/clipboard/src/index.ts"], "@remix-project/remix-solidity-ts": ["libs/remix-solidity/src/index.ts"], "@remix-ui/modal-dialog": ["libs/remix-ui/modal-dialog/src/index.ts"], - "@remix-ui/toaster": ["libs/remix-ui/toaster/src/index.ts"] + "@remix-ui/toaster": ["libs/remix-ui/toaster/src/index.ts"], + "@remix-ui/file-explorer": ["libs/remix-ui/file-explorer/src/index.ts"] } }, "exclude": ["node_modules", "tmp"] diff --git a/workspace.json b/workspace.json index 6f6935c308..4fb9bbd36c 100644 --- a/workspace.json +++ b/workspace.json @@ -617,6 +617,25 @@ } } } + }, + "remix-ui-file-explorer": { + "root": "libs/remix-ui/file-explorer", + "sourceRoot": "libs/remix-ui/file-explorer/src", + "projectType": "library", + "schematics": {}, + "architect": { + "lint": { + "builder": "@nrwl/linter:lint", + "options": { + "linter": "eslint", + "tsConfig": ["libs/remix-ui/file-explorer/tsconfig.lib.json"], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/file-explorer/**/*" + ] + } + } + } } }, "cli": {