Git Product home page Git Product logo

generator-theia-extension's People

Contributors

akosyakov avatar azatsarynnyy avatar dependabot[bot] avatar ducngn avatar jankoehnlein avatar jfaltermeier avatar jonashelming avatar lucas-koehler avatar lukasboll avatar marcdumais-work avatar max-elia avatar msujew avatar planger avatar sailingkieler avatar sdirix avatar seltzered avatar svenefftinge avatar therrance avatar thezoker avatar vince-fugnitto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-theia-extension's Issues

Instructions how to start examples are inconsistent

As mentioned in the discussion below, the instructions in the Readme on how to launch the examples are inconsistent. In the "how to run" sections it mentions the CLI command, in the "how to develop" it mentions the VSCode configs. I suggest to:

  • remove the VSCode way from the "develop" sections completly
  • Add the VS Code alternative to the "how to run" sections
  • Link from the "develop" to the "how to run" section

I'm a little confused as to why the docs describe the watch workflow in such a way where we need to launch the backends with vscode, we can alternatively also describe how to do so simply with the terminal.

I agree that it would make sense to at least also mention that the backend can be started from within VSCode via the launch config or with e.g. cd browser-app; yarn start. Do you want me to open a separate PR with a proposal?

If you'd like to and agree it adds value for extension developers then please feel free to open the PR :)

Originally posted by @vince-fugnitto in #82 (comment)

Support a standalone option

It would be useful to support the standalone generation of an extension meaning without he root level, the browser app and the electron app. This allows to create a new extension into an existing project.

documentation: update readme to list all available templates and their information

The proposal is to update the readme to add additional information for all available templates.
The changes can look something like:

Template Option Description Documentation
hello-world Creates a simple extension which provides a command and menu item which displays a message readme
widget Creates the basis for a simple widget including a toggle command, alert message and button displaying a message readme
labelprovider Creates a simple extension which adds a custom label (with icon) for .my files readme
tree-editor Creates a tree editor extension readme
empty Creates a simple, minimal extension readme
backend Creates a backend communication extension readme

We should generate the `lerna.js` just as we did in Theia

Otherwise, running yarn will hit a deadlock on Windows due to the parallel execution.

Update: copy the lerna.js from here into the root of your extension (where you can find the actual extension with the example apps) and replace lerna with node lerna.js in your npm scripts.

Update2: make sure the lernaPath points into lerna inside the node_modules/.bin

error while installing generator-theia-extension

Description

$ npm install -g yo generator-theia-extension

npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/root/.nvm/versions/node/v10.16.3/bin/yo -> /root/.nvm/versions/node/v10.16.3/lib/node_modules/yo/lib/cli.js
/root/.nvm/versions/node/v10.16.3/bin/yo-complete -> /root/.nvm/versions/node/v10.16.3/lib/node_modules/yo/lib/completion/index.js

> [email protected] postinstall /root/.nvm/versions/node/v10.16.3/lib/node_modules/generator-theia-extension/node_modules/spawn-sync
> node postinstall

internal/modules/cjs/loader.js:670
    throw err;
    ^

Error: Cannot find module '/root/.nvm/versions/node/v10.16.3/lib/node_modules/generator-theia-extension/node_modules/spawn-sync/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
    at Function.Module._load (internal/modules/cjs/loader.js:591:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-06T01_24_57_543Z-debug.log

And the tail of this debug log,
$ tail /root/.npm/_logs/2019-09-06T01_24_57_543Z-debug.log

7080 verbose argv "/root/.nvm/versions/node/v10.16.3/bin/node" "/root/.nvm/versions/node/v10.16.3/bin/npm" "install" "-g" "yo" "generator-theia-extension"
7081 verbose node v10.16.3
7082 verbose npm  v6.9.0
7083 error code ELIFECYCLE
7084 error errno 1
7085 error [email protected] postinstall: `node postinstall`
7085 error Exit status 1
7086 error Failed at the [email protected] postinstall script.
7086 error This is probably not a problem with npm. There is likely additional logging output above.
7087 verbose exit [ 1, true ]

I installed [email protected] and [email protected] but still no luck

Reproduction Steps

npm install -g yo generator-theia-extension

OS and Theia version:

Diagnostics:

initial generation fails

I'm currently working on a extension for Xtext syntax highlighting. :-)
The VS code extension works already and now thought I may try to create a Theia extension too. Unfortunately, the generator did not work for me.

Not sure what and why it fails. May be I'm doing something wrong.

denis@modula:~/VSCodeWorkspace/xtext-theia-extension$ yo theia-extension xtext-lang
XtextLang
   create package.json
   create lerna.json
identical .gitignore
   create README.md
identical .vscode/launch.json
   create xtext-lang/package.json
   create xtext-lang/tsconfig.json
   create xtext-lang/src/browser/xtext-lang-frontend-module.ts
   create xtext-lang/src/browser/xtext-lang-contribution.ts
   create browser-app/package.json
   create electron-app/package.json
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Can you give me a hint, please?

`yo theia-extension` failing after theia 1.15 update

Running yo theia-extension currently fails with the following error:

ERROR in ../node_modules/vscode-languageclient/lib/client.js
Module not found: Error: Can't resolve 'vscode' in '/tmp/theia-extension/node_modules/vscode-languageclient/lib'
 @ ../node_modules/vscode-languageclient/lib/client.js 10:17-34
 @ ../node_modules/monaco-languageclient/lib/monaco-language-client.js
 @ ../node_modules/monaco-languageclient/lib/index.js
 @ ../node_modules/@theia/languages/lib/browser/language-client-factory.js
 @ ../node_modules/@theia/languages/lib/browser/languages-frontend-module.js
 @ ./src-gen/frontend/index.js

generated extension cannot be compiled

In order to reproduce

npm install -g yo generator-theia-extension
yo theia-extension my-extension

You will get a result as:

error TS18003: No inputs were found in config file '/workspace/my-extension/my-extension/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Add template on how to build a tree-based editor in Theia

We developed an extension generator that shows how to develop a tree based editor in Theia.
In particular the template shows:

  • How to implement custom editors and register them for custom file types
  • How to integrated web technologies into Theia to implement views and editors
  • How to build a tree-based master detail editor, often required in tools to display JSON files with a defined schema

bug: failure to build 'LabelProvider' extension

Description

There is a build failure when attempting to generate a LabelProvider extension using the generator. The build failure is likely due to a breaking change upstream:

src/browser/aaa-contribution.ts(22,5): error TS2416: Property 'getIcon' in type 'AaaLabelProviderContribution' is not assignable to the same property in base type 'LabelProviderContribution'.
  Type '() => MaybePromise<string>' is not assignable to type '(element: object) => string | undefined'.
    Type 'MaybePromise<string>' is not assignable to type 'string | undefined'.
      Type 'Promise<string>' is not assignable to type 'string'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    at Promise.all.then.arr (/Users/vincentfugnitto/Desktop/vince/node_modules/execa/index.js:236:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:71999) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:71999) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to Reproduce

  1. clone the repository
  2. perform yarn
  3. perform npm link
  4. create a directory and perform yo theia-extension
  5. select the LabelProvider option, and verify the build
  6. the build should fail with the above error

cc @JonasHelming

Activity Bar not available for debugger

in extension mode, some functionality in activity bar (on the very left) is missing like debugger, git, search. However, if we build the original theia repository, they are all there. Are we missing some dependency in package.json?

Generate README per extension

Should document details about the extension, e.g.:

How to try the feature in the running browser app
That stand alone extension have to manually added and how

Selection menu empty after startup

When you start theia in the browser and you did not open the file view then the selection menu tries to open and only shows an empty overlay which is some pixels high.
If you open the files view and select some file then the selection menu shows all entries, most of which are disabled.
If you close the file view and reload the application in the browser the selection menu is empty again.

Support generating an empty extension

This would be useful to set up a new contribution, which is not covered by an existing template. The option to not create an example is actually already existing ("example:boolean"). However, the option is not correctly processed by most existing templates. As a consequence, if you set "example" to false, the templates will create the frontend module, but not the contribution, which leads to not compilable code. I suggest to remove the option "example" and provide a dedcaited empty template. I will push a PR.

Generation fails if extension name is given as parameter

If I run i.e. yo theia-extension hello-world then no src folder gets created.
This ends up in an build error.

...
hello-world: $ tsc
hello-world: error TS18003: No inputs were found in config file '/the/path/to/hello-world-extension/hello-world/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.
...

Files created with given name parameter (where the 'hello-world' extension should be default):

$ yo theia-extension hello-world
HelloWorld
   create package.json
   create lerna.json
   create .gitignore
   create README.md
   create .vscode/launch.json
   create hello-world/package.json
   create hello-world/tsconfig.json
   create browser-app/package.json
   create electron-app/package.json

vs. Files created without the name parameter and explicitly chosen extension kind:

$ yo theia-extension
? The extension's name hello-world
? The extension's type hello-world
HelloWorld
   create package.json
   create lerna.json
   create .gitignore
   create README.md
   create .vscode/launch.json
   create hello-world/package.json
   create hello-world/tsconfig.json
   create hello-world/src/browser/hello-world-frontend-module.ts
   create hello-world/src/browser/hello-world-contribution.ts
   create browser-app/package.json
   create electron-app/package.json

generator broken: error TS18003: No inputs were found in config file

Generator fails upon running this generator with default settings.

npm install -g yo generator-theia-extension
mkdir theia-hello-world-extension
cd theia-hello-world-extension
yo theia-extension hello-world-extension

hello-world-extension: $ tsc
hello-world-extension: error TS18003: No inputs were found in config file '/home/ubuntu/environment/theia-hello-world-extension/hello-world-extension/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.
hello-world-extension: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
hello-world-extension: error Command failed with exit code 2.
hello-world-extension: npm ERR! code ELIFECYCLE
hello-world-extension: npm ERR! errno 2
hello-world-extension: npm ERR! [email protected] prepare: `yarn run clean && yarn run build`
hello-world-extension: npm ERR! Exit status 2
hello-world-extension: npm ERR! 
hello-world-extension: npm ERR! Failed at the [email protected] prepare script.
hello-world-extension: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
hello-world-extension: npm ERR! A complete log of this run can be found in:
hello-world-extension: npm ERR!     /home/ubuntu/.npm/_logs/2019-08-19T15_54_36_233Z-debug.log
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run prepare
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! error Command failed with exit code 2.
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! errno 2
lerna ERR! npm ERR! [email protected] prepare: `yarn run clean && yarn run build`
lerna ERR! npm ERR! Exit status 2
lerna ERR! npm ERR! 
lerna ERR! npm ERR! Failed at the [email protected] prepare script.
lerna ERR! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR! 
lerna ERR! npm ERR! A complete log of this run can be found in:
lerna ERR! npm ERR!     /home/ubuntu/.npm/_logs/2019-08-19T15_54_36_233Z-debug.log
lerna ERR! 
lerna ERR! 
lerna ERR! > [email protected] prepare /home/ubuntu/environment/theia-hello-world-extension/hello-world-extension
lerna ERR! > yarn run clean && yarn run build
lerna ERR! 
lerna ERR! yarn run v1.17.3
lerna ERR! $ rimraf lib
lerna ERR! Done in 0.17s.
lerna ERR! yarn run v1.17.3
lerna ERR! $ tsc
lerna ERR! error TS18003: No inputs were found in config file '/home/ubuntu/environment/theia-hello-world-extension/hello-world-extension/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! 
lerna ERR!     at Promise.all.then.arr (/home/ubuntu/environment/theia-hello-world-extension/node_modules/execa/index.js:236:11)
(node:16576) UnhandledPromiseRejectionWarning: Error: Command failed: npm run prepare
warning package.json: No license field
warning package.json: No license field
error Command failed with exit code 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prepare: `yarn run clean && yarn run build`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2019-08-19T15_54_36_233Z-debug.log

[email protected] prepare /home/ubuntu/environment/theia-hello-world-extension/hello-world-extension
yarn run clean && yarn run build

yarn run v1.17.3
$ rimraf lib
Done in 0.17s.
yarn run v1.17.3
$ tsc
error TS18003: No inputs were found in config file '/home/ubuntu/environment/theia-hello-world-extension/hello-world-extension/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["lib"]'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

at Promise.all.then.arr (/home/ubuntu/environment/theia-hello-world-extension/node_modules/execa/index.js:236:11)
at process._tickCallback (internal/process/next_tick.js:68:7)

(node:16576) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:16576) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
`

Build error TS1254 and error TS2552

Initial template generation using yo fails with the error below:

build_error

Fix:
Adding "skipLibCheck": true, on the tsconfig.json of the template fixed this for me.

No default value for template

With the introduction of the second template (widget), you cannot call yo theia-extension hello-world-extension anymore (without specifying the template to be used). This is however documented as the default call here: https://www.theia-ide.org/docs/authoring_extensions

Suggestion is to use the hello-world template as default if the user does not specify anything, I will provide this fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.