1.0.38 • Published 2 years ago

papapackage v1.0.38

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Papapackage

This cli watches all your projects and copies changed files to all node_modules folders of dependent projects.

Installation

brew install watchman

yarn global add papapackage

Usage

Run papapackage in the folder you want to watch:

papapackage

or

papapackage ~/Documents

(or any other folder)

Let papa do the work

Now you can let papa do the work, and never worry that you have an old version installed!

Todo

Refactor

  • put type in every dest in watchlist instead of keeping 2 arrays. type is link or copy
  • Also watch linked ones, just skip the copying for linked destinations
  • test if the refactor was successful

Status

  • ActivityIndicator + "searching..." --> Checkmark + "X dependencies found for Y packages"
  • ActivityIndicator + "linking..." --> Checkmark + "X packages linked into Y destinations"
  • ActivityIndicator + "watching..." --> Checkmark + "X packages watched for Y destinations"
  • will be shown on startup/restart, but is also saved so it can be shown when hitting i

Copies:

  • don't show copies being made for the first round (the first 10 seconds)
  • after the first round, for every subscription event, show Checkmark + "X file(s) changed. Copying into to Y destination(s) and linking into Z destination(s)"

Hotkeys:

  • When hitting i or ?, you see available commands and the status (l, r, i + status)
  • When hitting l, you see all watched and linked directories, together in one array (watched have type watch, linked have type link). It is shown in nice tabular view. It's also copied as JSON
  • When hitting r, it restarts
  • When hitting q, it shows details of the latest copy/link event (package name, package src, link destinations, copy destinations)

General:

  • Add config option that lets you create some settings that change certain things in the cli
  • Add mode by default (turned off by -y) that asks you if it should start the watcher
  • Add -l that only lists table, but doesn't link or watch anything yet (it can then be started by hitting s)
  • Add -u/unlink that unlinks all the found packages to link
  • Add 'run {command}' that runs that command in all package folders

Downtime management:

  • safe last time papapackage was running and check the last time every dependency has had changes in non-ignored folders
  • remove current dest/node_modules/dependency folder for linking strategy copy
  • copy src folder to dest/node_modules/dependency
  • don't subscribe to every file on startup, only after startup (this is a watchman setting)

Article

  • Write an article about this

Test

  • Confirm it works for expo projects, next projects, and packages.

First, test it in daily usage

Fixes

  • change blue color (unreadable)
  • sometimes it watches twice for some reason
  • never block thread so it shows loading correctly (don't use sync functions)
  • show loader if loading files or any other sub-command
  • status doesn't get replaced properly if you hit the l sub-command (make it an object instead of an array, and replace keys instead of array.push)

Nice to have:

  • make sure to un-link all packages that are going to be linked, because the folders may have changed and it can't overwrite links.
  • Add papa ls that only lists table, but doesn't link or watch anything yet (it can then be started by hitting s)
  • Add papa unlink that unlinks all the found packages to link
  • Add papa exec {command} that runs that command in all package folders
  • Add papa run {script} that runs an npm script in each package that contains it
  • Change cli name to papa
  • Add mode by default (turned off by -y) that asks you if it should start the watcher
  • CLI should read papapackage.config.json for the key ignoreDirs which is an array of folder paths (absolute or relative) that will not be watched
  • Also add other keys in the config like useVoice and yarnOrNpm
  • Add papa ignore {path} that will add the path to the papapackage.config.json (and creates the configfile if it doesn't exist in the cwd)
  • Add papa init that creates the config file in the cwd in an interactive way (like most init cli's do)
  • Add papa help with info
  • Add papa publish, papa pull, papa ship, papa
  • Add papa to npx if that name is not taken yet
  • Add papa clean to remove all node_modules and lockfiles everywhere
1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago