Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug while sharing scripts via node modules #108

Open
taschetto opened this issue Jun 10, 2022 · 3 comments
Open

Bug while sharing scripts via node modules #108

taschetto opened this issue Jun 10, 2022 · 3 comments

Comments

@taschetto
Copy link

taschetto commented Jun 10, 2022

  • Versions:
    • scripty: 2.1.0
    • yarn: 1.22.18
    • OS: ubuntu 20.04

Actual Behavior

scripty can't find my scripts inside my helper module.

~/projects/my-project
❯ yarn lint
yarn run v1.22.18
$ scripty
scripty ERR! No script found for npm lifecycle 'lint' matching any of:
scripty ERR!   /home/taschetto/projects/my-project/script/lint+(|.*)
scripty ERR!   /home/taschetto/projects/my-project/script/lint/index+(|.*)
scripty ERR!   /home/taschetto/projects/my-project/script/lint/*
scripty ERR!   /home/taschetto/projects/my-project/node_modules/scripty/scripts/lint+(|.*)
scripty ERR!   /home/taschetto/projects/my-project/node_modules/scripty/scripts/lint/index+(|.*)
scripty ERR!   /home/taschetto/projects/my-project/node_modules/scripty/scripts/lint/*
scripty ERR! Either define a script or remove "scripty" from 'scripts.lint' in your package.json.
error Command failed with exit code 1.

Even though...

~/projects/my-projects
❯ ls -la ./node_modules/@my-org/node-scripts/scripts/lint 
total 16
drwxrwxr-x 2 taschetto taschetto 4096 jun 10 16:58 .
drwxrwxr-x 5 taschetto taschetto 4096 jun 10 16:58 ..
-rwxr-xr-x 1 taschetto taschetto   40 jun 10 16:58 fix
-rwxr-xr-x 1 taschetto taschetto  118 jun 10 16:58 index

Expected Behavior

The script should have been found.

my-projects/package.json

{
  // redacted
  "scripts": {
    "lint": "scripty",
  },
  // redacted
  "devDependencies": {
    "@my-org/node-scripts": "1.0.1",
    "scripty": "^2.1.0"
  },
  "config": {
    "scripty": {
      "modules": ["@my-org/node-scripts"]
    }
  }
}
@searls
Copy link
Member

searls commented Jun 11, 2022

It looks like the issue is that you specify "modules": ["@tatango/node-scripts"] but the dependency doesn't match as "@my-org/node-scripts"

@taschetto
Copy link
Author

@searls I'm sorry, that was a typo because I was redacting the code example to keep things private. My original comment was fixed.

@searls
Copy link
Member

searls commented Jun 14, 2022

Scripty is not being pro-actively maintained at this point. If you're interested in helping solve this problem with a PR, and/or a failing test case, and/or providing a minimal reproducing repo, that'd be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants