diff --git a/README.md b/README.md new file mode 100644 index 0000000..b855f02 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Following issues were discovered in this repository + +1. Folder `plugins` may only contain plugins, which export an object, components, anything else can not be located here. Action: **I will try adding more detailed message about that!**. +2. Extensions can not enable themself - the enabled extension resoltion is recurive - from your application root we scan all enabled extensions up, so it is not reccomended to enable extension in the same extension. Action - **I will try adding an warnign about that** +3. For some reason, potentially for some babel-specific reason the following code: `import React from "react";` and then `React.Component` did not function correctly. Use the `import { Component } from "react";` instead. This is a bug, but I am not sure if I will be able to address it soon enough. +4. Finally and most importantly, the local modules can only by symlinked if their version in `package.json` starts with `link:` and you are using `yarn` or `file:` but then manual symlinking is needed (`yarn link` or `npm link`). \ No newline at end of file diff --git a/extension/package.json b/extension/package.json index 031d9fc..74afe5c 100644 --- a/extension/package.json +++ b/extension/package.json @@ -4,9 +4,6 @@ "main": "index.js", "license": "MIT", "scandipwa": { - "type": "extension", - "extensions": { - "extension": true - } + "type": "extension" } } diff --git a/extension/src/plugin/components/HelloWorldComponent.js b/extension/src/components/HelloWorldComponent.js similarity index 100% rename from extension/src/plugin/components/HelloWorldComponent.js rename to extension/src/components/HelloWorldComponent.js diff --git a/extension/src/plugin/WelcomePageComponent.plugin.js b/extension/src/plugin/WelcomePageComponent.plugin.js index e61556d..3bc3f6e 100644 --- a/extension/src/plugin/WelcomePageComponent.plugin.js +++ b/extension/src/plugin/WelcomePageComponent.plugin.js @@ -1,9 +1,9 @@ -import HelloWorldComponent from "./components/HelloWorldComponent"; +import HelloWorldComponent from "../components/HelloWorldComponent"; export default { "scandi-test/WelcomePageComponent": { "member-function": { - renderHello: () => "Foobar", + renderHello: () => , }, }, }; diff --git a/scandi-test/.eslintcache b/scandi-test/.eslintcache index 17da081..9f60142 100644 --- a/scandi-test/.eslintcache +++ b/scandi-test/.eslintcache @@ -1 +1 @@ -[{"/Users/jherr/tmp/scandi-test/scandi-test/src/index.js":"1","/Users/jherr/tmp/scandi-test/scandi-test/src/reportWebVitals.js":"2","/Users/jherr/tmp/scandi-test/scandi-test/src/WelcomePageComponent.js":"3","/Users/jherr/tmp/scandi-test/scandi-test/src/App.js":"4"},{"size":500,"mtime":1612215764585,"results":"5","hashOfConfig":"6"},{"size":362,"mtime":1612215764586,"results":"7","hashOfConfig":"6"},{"size":420,"mtime":1612217043178,"results":"8","hashOfConfig":"6"},{"size":184,"mtime":1612216611092,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1wafsoe",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/jherr/tmp/scandi-test/scandi-test/src/index.js",[],"/Users/jherr/tmp/scandi-test/scandi-test/src/reportWebVitals.js",[],"/Users/jherr/tmp/scandi-test/scandi-test/src/WelcomePageComponent.js",[],"/Users/jherr/tmp/scandi-test/scandi-test/src/App.js",[]] \ No newline at end of file +[{"/home/scandiweb/Projects/scandi-test/scandi-test/src/index.js":"1","/home/scandiweb/Projects/scandi-test/scandi-test/src/reportWebVitals.js":"2","/home/scandiweb/Projects/scandi-test/scandi-test/src/WelcomePageComponent.js":"3","/home/scandiweb/Projects/scandi-test/scandi-test/src/App.js":"4"},{"size":500,"mtime":1612267396923,"results":"5","hashOfConfig":"6"},{"size":362,"mtime":1612267396923,"results":"7","hashOfConfig":"6"},{"size":422,"mtime":1612267505084,"results":"8","hashOfConfig":"6"},{"size":184,"mtime":1612267396923,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"9x3575",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/scandiweb/Projects/scandi-test/scandi-test/src/index.js",[],"/home/scandiweb/Projects/scandi-test/scandi-test/src/reportWebVitals.js",[],"/home/scandiweb/Projects/scandi-test/scandi-test/src/WelcomePageComponent.js",[],"/home/scandiweb/Projects/scandi-test/scandi-test/src/App.js",[]] \ No newline at end of file diff --git a/scandi-test/package.json b/scandi-test/package.json index d796116..3dace67 100644 --- a/scandi-test/package.json +++ b/scandi-test/package.json @@ -7,7 +7,7 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", - "extension": "^0.2.2", + "extension": "link:../extension", "react": "^17.0.1", "react-dom": "^17.0.1", "react-scripts": "4.0.1", diff --git a/scandi-test/src/WelcomePageComponent.js b/scandi-test/src/WelcomePageComponent.js index b1007dd..ea71af5 100644 --- a/scandi-test/src/WelcomePageComponent.js +++ b/scandi-test/src/WelcomePageComponent.js @@ -1,7 +1,7 @@ -import React from "react"; +import { Component } from "react"; /** @namespace scandi-test/WelcomePageComponent */ -export class WelcomePageComponent extends React.Component { +export class WelcomePageComponent extends Component { renderHello() { return "Hello - default value"; } diff --git a/scandi-test/yarn.lock b/scandi-test/yarn.lock index 912e319..290e496 100644 --- a/scandi-test/yarn.lock +++ b/scandi-test/yarn.lock @@ -5305,10 +5305,9 @@ extend@~3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -extension@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/extension/-/extension-0.2.2.tgz#a1e37c4ae1c8ea32e0172cbc23f9bb2ae451ecd1" - integrity sha512-Ui0gR2zpiK2PrHLf4xmujfPoKP5K9H4UhE4maIlPF0NCNRoGsS0yJXRa8sbCa1DglaPIi1Svjwj0OzL5yYkBqw== +"extension@link:../extension": + version "0.0.0" + uid "" external-editor@^3.0.3: version "3.1.0" diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +