Code Monkey home page Code Monkey logo

theia-plugin-packager's Introduction

theia-plugin-packager

=======

Allow to package a plug-in.

License

EPL-2.0

theia-plugin-packager's People

Contributors

amiramw avatar benoitf avatar jonashelming avatar mcgordonite avatar thegecko avatar vzhukovs avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theia-plugin-packager's Issues

support yarn workspaces

If we try to package plugin in yarn workspace we will have error:

irst-plugin: => ๐Ÿš’ The dependency /Users/yevhen/work/test/test-plugin-packager/plugins/first-plugin/node_modules/aproba is referenced but is not available on the filesystem
first-plugin: error Command failed with exit code 1.
first-plugin: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
first-plugin: error Command failed with exit code 1.
first-plugin: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run prepare exited 1 in 'first-plugin'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

To reproduce the problem clone and build: https://github.com/evidolob/test-plugin-packager

Explanation

Currently, this tool isn't able to pack a plugin which is a part of a monorepository.
I see here two problems at least:

  • yarn list returns dependencies for all packages including packages (plugins) itself;
  • package's dependencies are usually hoisted to the workspace root.

How to fix

I believe, the first problem could be solved by filtering all the dependencies by a package (plugin) name which gives us only dependencies of a plugin.
For the second problem, we need to keep in mind that dependency could be resolved on the filesystem to /node_modules in the root of workpace or some /plugins/plugin-name/node_modules as well.

Abandoned? Security vulnerabilities?

Is this project abandoned? The last commit was several years ago and there are a number of security vulnerabilities due to outdated dependencies. Is there an alternative way to package plugins?

Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").

There is a problem between build theia-plugin-packager on version 1.21.0 and 1.21.1:

Logs from using yarn 1.21.0

vlad@MacBook-Pro-15-Vlad theia-plugin-packager % yarn
yarn install v1.21.0
[1/4] ๐Ÿ”  Resolving packages...
success Already up-to-date.
$ yarn run clean && yarn run build
yarn run v1.21.0
$ rimraf dist
โœจ  Done in 0.36s.
yarn run v1.21.0
$ yarn run compile && yarn run format-code && yarn run tslint-fix && yarn run test
$ tsc && chmod +x dist/index.js
$ tsfmt -r
$ tslint --fix --project .
$ jest
 PASS  tests/assembly/assembly.spec.ts
(node:76677) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
 PASS  tests/zip/zip.spec.ts
 PASS  tests/exec.spec.ts
 PASS  tests/yarn/yarn.spec.ts
 PASS  tests/validate/validate.spec.ts
 PASS  tests/step/step.spec.ts
 PASS  tests/zip/zip-mock.spec.ts
 PASS  tests/logger.spec.ts
 PASS  tests/step/steps-flow.spec.ts
 PASS  tests/cli-error.spec.ts
---------------|----------|----------|----------|----------|-------------------|
File           |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
---------------|----------|----------|----------|----------|-------------------|
All files      |      100 |    98.67 |      100 |      100 |                   |
 assembly.ts   |      100 |      100 |      100 |      100 |                   |
 cli-error.ts  |      100 |      100 |      100 |      100 |                   |
 command.ts    |      100 |      100 |      100 |      100 |                   |
 logger.ts     |      100 |      100 |      100 |      100 |                   |
 step.ts       |      100 |      100 |      100 |      100 |                   |
 steps-flow.ts |      100 |      100 |      100 |      100 |                   |
 validate.ts   |      100 |      100 |      100 |      100 |                   |
 yarn.ts       |      100 |    97.62 |      100 |      100 |               154 |
 zip.ts        |      100 |      100 |      100 |      100 |                   |
---------------|----------|----------|----------|----------|-------------------|

Test Suites: 10 passed, 10 total
Tests:       40 passed, 40 total
Snapshots:   0 total
Time:        3.279s
Ran all test suites.
โœจ  Done in 10.69s.
โœจ  Done in 12.15s.

Logs from using yarn 1.21.1

vlad@MacBook-Pro-15-Vlad theia-plugin-packager % yarn
yarn install v1.21.1
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
[1/4] ๐Ÿ”  Resolving packages...
success Already up-to-date.
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ yarn run clean && yarn run build
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
yarn run v1.21.1
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ rimraf dist
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
โœจ  Done in 0.36s.
yarn run v1.21.1
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ yarn run compile && yarn run format-code && yarn run tslint-fix && yarn run test
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ tsc && chmod +x dist/index.js
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ tsfmt -r
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ tslint --fix --project .
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning package.json: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
$ jest
warning @theia/[email protected]: Invalid bin entry for "theia:plugin" (in "@theia/plugin-packager").
 PASS  tests/assembly/assembly.spec.ts
(node:76092) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
 PASS  tests/zip/zip.spec.ts
 PASS  tests/yarn/yarn.spec.ts
 PASS  tests/exec.spec.ts
 PASS  tests/validate/validate.spec.ts
 PASS  tests/zip/zip-mock.spec.ts
 PASS  tests/step/steps-flow.spec.ts
 PASS  tests/step/step.spec.ts
 PASS  tests/logger.spec.ts
 PASS  tests/cli-error.spec.ts
---------------|----------|----------|----------|----------|-------------------|
File           |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
---------------|----------|----------|----------|----------|-------------------|
All files      |      100 |    98.67 |      100 |      100 |                   |
 assembly.ts   |      100 |      100 |      100 |      100 |                   |
 cli-error.ts  |      100 |      100 |      100 |      100 |                   |
 command.ts    |      100 |      100 |      100 |      100 |                   |
 logger.ts     |      100 |      100 |      100 |      100 |                   |
 step.ts       |      100 |      100 |      100 |      100 |                   |
 steps-flow.ts |      100 |      100 |      100 |      100 |                   |
 validate.ts   |      100 |      100 |      100 |      100 |                   |
 yarn.ts       |      100 |    97.62 |      100 |      100 |               154 |
 zip.ts        |      100 |      100 |      100 |      100 |                   |
---------------|----------|----------|----------|----------|-------------------|

Test Suites: 10 passed, 10 total
Tests:       40 passed, 40 total
Snapshots:   0 total
Time:        3.121s
Ran all test suites.
โœจ  Done in 10.41s.
โœจ  Done in 11.86s.

If line package.json#L8 is removed, then build will be successful without any warnings, but there will be only one binary from two desirable.

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.