Share code between different parts of your full-stack app

Overview

dryduck

Dryduck

Every programmer knows dry. Don't repeat yourself. So why repeat yourself across platforms, writing the same thing twice? Dryduck is a tool for code-sharing across cross-platform apps. It's a fork of wml

Why?

Let's face it, sometimes symbolic links just aren't enough. Github has more than 10K issues with the words "support for symlinks" in them.

Two examples I've encountered so far were: React Native's packager lack of support for them and Webpack's inability to find linked modules dependencies (working around this has issues of its own). A lot of people resolve to working directly from the nodemodules folder in these cases, but _a. if your package is required by two projects on which you are working simultaneously, you're screwed, and b. it just feels wrong.

Dryduck makes use of Facebook's ultra-fast Watchman to watch for changes in your source folder and copy them (and only them) into your destination folder. It makes it possible (unlike wml) to add relative paths into a settingsfile so that you can watch and copy folders across big monorepo's.

Install

npm install dryduck
#or
yarn add dryduck

Also, make sure you have watchman installed

brew update
brew install watchman

Then, add dryduck to your yarn scripts

scripts: {
    "dryduck": "dryduck",
    ...
}

Usage

# add the link to dryduck using `yarn dryduck add 
    
    
     `
    
   
yarn dryduck add ~/my-package ~/main-project/node_modules/my-package
# start watching all links added
yarn dryduck start

Commands

add

yarn dryduck add (or yarn dryduck a)

Adds a link.

dryduck will not start listening to changes until you start it by running dryduck start.

Each link is given an unique id, you can see all links and their ids by running dryduck list. Links are saved to src/links.json in your dryduck install directory, meaning that your configuration is specific to that dryduck install.

rm

yarn dryduck rm

Removes a link. Passing all as linkId removes all links.

start

yarn dryduck start (or yarn dryduck s)

Starts dryduck.

It first copies all watched files from source to destination folder and then waits for new changes to happen.

list

yarn dryduck list (or yarn dryduck ls)

Lists all links.

Shows each link's id, state and source/destination folders.

enable

yarn dryduck enable [linkId] (or yarn dryduck en)

Enables a link. Passing all as linkId enables all links.

If you don't specify a linkId dryduck will open in interactive mode.

disable

yarn dryduck disable [linkId] (or yarn dryduck d)

Disables a link. Passing all as linkId disabled all links.

If you don't specify a linkId dryduck will open in interactive mode.

Great for re-using old links without having to type them over and over again.

Miscellaneous

Ignored folders

When adding a new link dryduck will try to detect if your source folder is a git repository or an npm package, it will then offer to ignore the ".git" and "node_modules" folders for you.

If you want to add more folders to your ignored folders first create a file named .watchmanconfig in your source folder, this file should contain Watchman's configuration for this folder. See example below to learn how populate it or check out the Watchman docs to learn more about Watchman configurations.

In the following example we are ignoring the ".git" and "node_modules" folders:

{
    "ignore_dirs": [".git", "node_modules"]
}
You might also like...
A guide to building your own React stack, explaining options and tradeoffs along the way
A guide to building your own React stack, explaining options and tradeoffs along the way

Custom React Stack React has a very rich ecosystem. For anything you want to do, there is probably a library or a framework available for it. That's g

Here is the place try to learn to call API using React.js with anything your code style and contribute to open-source. Part of Hacktoberfest

Table of Contents About The Project Built With Getting Started Prerequisites Installation Usage About The Project To welcome hacktoberfest we provide

Hotel-ETH - A Bed and Breakfast dApp run on Ethereum. Includes a token + schedule system (Solidity) and full front-end (React + ethers.js) built with Hardhat
This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoDB

This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoDB

A Remix stack setup to run on Deno with support for Rust WASM modules!

Remix + Deno + Rust - Webassembly - The Air Metal Stack Welcome to the Air Metal Stack for Remix! 🦕 + 🦀 This stack is a good choice if you want to

Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards
Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards

Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards

Simple generator of React code from Figma
Simple generator of React code from Figma

Simple generator of React code from Figma

A starter for React with Typescript with the fast Vite and all static code testing with Eslint and formatting with Prettier.
A starter for React with Typescript with the fast Vite and all static code testing with Eslint and formatting with Prettier.

A starter for React with Typescript with the fast Vite and all static code testing with Eslint and formatting with Prettier.

MobX React Handbook with code samples

Manual do MobX com React Exemplos de gerenciamento de estado no React usando a biblioteca MobX Versões Este repositório está utilizando as seguintes v

Owner
Code From Anywhere
Code From Anywhere
Code examples for the blog post titled The Complete Guide to Full Stack Solana Development with React, Anchor, Rust, and Phantom

The Complete Guide to Full Stack Solana Development with React, Anchor, Rust, and Phantom Code examples to go with the blog post available here Prereq

Nader Dabit 436 Dec 31, 2022
ReactJS-Spring-Boot-CRUD-Full-Stack-App - Course on YouTube

ReactJS-Spring-Boot-CRUD-Full-Stack-App - Course on YouTube

Nicole Bidigaray 4 Sep 30, 2022
Full-Stack Project that shows the weather forecast

Projeto Previsão de chuva Projeto que mostra a previsão de tempo de cada bairro Tecnologias Pre Requisitos Como usar Pasta front-end Pasta back-end Av

Pedro Paulo 1 Dec 12, 2021
Chrome extension to preview and debug your webpage's meta tags for different social platforms like Twitter, Facebook, WhatsApp, LinkedIn etc.

ogmeta Chrome extension to preview and debug your webpage's meta tags for different social platforms like Twitter, Facebook, WhatsApp, LinkedIn etc. E

Vamsi Rao 22 Aug 4, 2022
Facebook components like a Login button, Like, Share, Chat, Comments, Page or Embedded Post

React Facebook Components Components Facebook provider (provide settings to child components) Login button (provide user profile and signed request) L

Zlatko Fedor 740 Jan 3, 2023
A javascript framework to share url to social media sites like facebook, twitter, reddit, whastapp in an easy and simple way.

simple-sharer [by BUILDBROTHERS.COM] A javascript framework to share url to social media sites like facebook, twitter, reddit, whastapp in an easy and

null 5 May 29, 2022
A web application that allows you to create and share wall of gifs! Built on top of solana blockchain.

Wall of gif with Solana A web application that allows you to create and share wall of gifs! Built on top of solana blockchain. Installation and Usage

Sunrit Jana 4 Jan 1, 2022
Entire React code base explanation by visual block schemes (Stack version)

Under the hood: React This repository contains an explanation of inner work of React. In fact, I was debugging through the entire code base and put al

Bohdan Liashenko 5.4k Dec 29, 2022
How to create modular Elm code that scales nicely with your app

Elm Elm is a programming language that compiles to JavaScript. It is known for its friendly error messages, helping you find issues quickly and refact

Evan Czaplicki 4.2k Dec 22, 2022