question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleanup package scripts

See original GitHub issue

We currently leverage the scripts entry in our package.json. As of right now this includes around 34 scripts that aren’t really documented. Any addition, change etc. has to be followed by contributors to be understood.

It would be nice if we could consolidate those into a single place that also adds documentation. This should put emphasis on common tasks as well as guiding contributors: What script can I use to perform X task?

https://github.com/kentcdodds/nps looks very close to what I have in mind (task + description + watch mode in a single place).

Maybe there are other solutions for large monorepos. In any case it would be nice if we could improve the first contributor experience.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, May 29, 2019

Can we instead just add a new section in our documentation & document what each script does along with all it’s relevant information?

It’s part of the issue, yes. The problem is that documentation becomes easily outdated. Even putting it right next to the script won’t prevent it. A separate file (or gh wikis) would be even worse.

Since I want to enhance the scripts anyway (+debug, +watch) it’s a good opportunity to explore solutions that solve both issues (docs and better scripts).

1reaction
eps1loncommented, May 17, 2019

@cvanem This issue is totally up for grabs. This is what the “help wanted” issue is for.

The important part is that I don’t want the create churn for maintainers. The old workflows shouldn’t change. It’s mainly directed at new contributors so that they don’t feel overwhelmed when looking at the package.json and can have a single entry point.

Some points ordered by importance. They are up for debate starting with point 3 and can be implemented in separate PRs:

  1. document scripts
  2. improve readability and “workflow splitting” Essentially extract all && piping into separate scripts. For example when debugging docs generation I don’t want to clutter my git diff by deleting all API docs.
  3. Watchmode all the things!
  4. Get rid of babel-node babel-node is for developing node scripts that are published. Since we only use those for internal usage we can require the latest active LTS node version. The only feature we loose is es modules and we don’t need those for local dev. It also creates overhead when running the scripts because they have to be transpiled first.
  5. Document how to run the scripts with a debugger attached This is where no babel-node will help because we don’t have to fight source maps.

nps isn’t a requirement for this. From skimming the readme it just seemed like this would address 1 and 2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cleanup-script · GitHub Topics
Small utilities to cleanup directories such as download which are all the time full of random stuff. utility tool executable util cleanup-script exe...
Read more >
clean-scripts - npm
A CLI tool to make scripts in package.json clean. ... Start using clean-scripts in your project by running `npm i clean-scripts`.
Read more >
Cleanup Script | Enterprise Architect User Guide
Locate and double-click on the required script and select the 'Build > Clean' page or. Click on in the window Toolbar, select the...
Read more >
Manual complete cleanup scripts for WebSphere Application ...
This cleanup script cleans all entries related to WebSphere Application Server V5.1, V6.0, V6.1, and V7.0. If you intend to clean (delete) ...
Read more >
Post-clone cleanup scripts
Cleanup scripts automatically run on the target instance after the cloning process finishes. Use cleanup scripts to modify or remove bad data. Cleanup...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found