Giter Site home page Giter Site logo

thescientist13 / copy-dots Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.98 MB

Quickly copy dot files (and more!) from another project into an existing project with a single command.

License: MIT License

JavaScript 100.00%
cli hacktoberfest nodejs utility

copy-dots's Introduction

Hello there ๐Ÿ‘‹

I find myself most passionate about helping people learn about technology and how it can help improve their process and workflows. I like to do so through software projects that are well designed, tested, performant, and maintained in a way that advocates for great experiences for all involved. I like to write and speak on a variety of topics, but also love talking about, and getting lost in some code, just as easily.

These days I'm happily mixing it up and focusing on open source and the web. Would love to hear what you're up to, too!

  • ๐Ÿ”ญ Iโ€™m currently working on Project Evergreen and Greenwood
  • ๐ŸŒฑ Iโ€™m currently learning about SSR and Web Components and Serverless SSG
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on web standards (WHATWG, TC39, NodeJS WGs, etc)
  • ๐Ÿค” Iโ€™m looking for help with anything you see in my profile. Contributary I think is a fun project!
  • ๐Ÿ’ฌ Ask me about getting started with web development!
  • ๐Ÿ“ซ How to reach me: Twitter, LinkedIn, Blog

copy-dots's People

Contributors

thescientist13 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

copy-dots's Issues

Contributing and developer documentation

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Would be good to get a Contributing.md setup and how to write tests / do local development.

Details

add support for options

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Some useful flags should be added to easily assist with project initialization and extending the value of copy-dots.

Details

Features / flags to add

  • -l - License file,
  • -g - git files (ignore, attributes)
  • -r- readme
  • -w - the works, all the flags
  • -c - config files. like tool.config.js

Can we use commander and other dependencies here?

clean up TestBed code and make generic / compatibile with Greenwood (to publish as its own package)

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

The TestBed code is from the Greenwood project and has been slightly adapted / slimmed down to work for this project. Would like to make sure it is compatible with Greenwood and then publish as its own package.

Details

Would be good to figure out why I need to specify an output directory though...

Thoughts / notes

  1. is this.context needed? - test in greenwood. call it mocha-test-bed if so?
  2. setup / test files (fixtures, etc)
  3. why is output directory needed?
  4. teardown (automatically clean setup / test files?), e.g. output file, greenwood/, .public/
  5. bin path relative vs abs?

setup unit testing

This project should easily be able to support basic unit testing and would be necessary to support local testing without using the project repo itself as test bad.

better way to work around NODE_ENV=development for local development

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Currently for local development, a NODE_ENV is used to help output the contents into an output/ folder to not stomp over the local working directory.

Details

Would be nice to clean this up, would help with code coverage too. Not sure if it requires taking a second path param for custom output directory? Or just use only specs?

publishing and testing checklist

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Should test with various options and flags using npx in a new project.

Details

  1. files
  2. bin
  3. ???

initial POC

something that can at least run and copy files from an arbitrary directory. Doesn't need to "work work" via NPM.

build docs from Greenwood (using GitHub pages?)

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Would be nice to try and use Greenwood to build the docs for this, maybe using GitHub pages.

Details

TBD

ensure support for absolute (and relative) paths

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Currently the docs show using a relative path, e.g. ../../my-project/. Should make sure that a path like /Users/<name/my-project/

Details

add code and test coverage for scanFile exception handling

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Code coverage should be added for this code block.

const scanFiles = (userDirectory) => {
  return new Promise((resolve, reject) => {
    try {   
      const files = fs.readdirSync(userDirectory)
        .filter(isDotFile)
        .filter(file => isNotDirectory(`${userDirectory}/${file}`));
      
      resolve(files);
    } catch (error) {
      console.log('Unexpected error scanning files', error);
      reject(error);
    }
  });
};

Details

Current reporting stands at

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |   94.87 |       75 |     100 |   94.87 |
 index.js |   94.87 |       75 |     100 |   94.87 | 47-48
----------|---------|----------|---------|---------|-------------------

=============================== Coverage summary ===============================
Statements   : 94.87% ( 37/39 )
Branches     : 75% ( 9/12 )
Functions    : 100% ( 9/9 )
Lines        : 94.87% ( 37/39 )
================================================================================

add README badges

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Should add things like tag, continuous integration, PRs, issues, etc.

Details

Can use Greenwood as an example.

programmatic API

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Although general use case would be to invoke via npx, would be cool to see if this could be something harnessed to power other scaffolding tools, like for Greenwood or Create Evergreen App.

Details

TBD

Error EISDIR: illegal operation on a directory

Type of Change

  • New Feature Request
  • Improvement / Suggestion
  • Documentation
  • Bug
  • Other (please clarify below)

Summary

Trying to run copy-dots and getting this error

$ npx copy-dots ../../../project-evergreen/repos/greenwood
npx: installed 1 in 1.36s
Validating user directory...
Scanning Files in user directory... /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood
Filtering files in user directory...
Copying filtered files into current directory...
copying file from /Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/.browserslistrc
copying file to /Users/owenbuckley/Workspace/github/repos/copy-dots-demo
{ Error: EISDIR: illegal operation on a directory, copyfile '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/.browserslistrc' -> '/Users/owenbuckley/Workspace/github/repos/copy-dots-demo'
    at Object.copyFileSync (fs.js:1724:3)
    at filteredFiles.forEach.file (/Users/owenbuckley/.npm/_npx/52263/lib/node_modules/copy-dots/src/index.js:101:10)
    at Array.forEach (<anonymous>)
    at run (/Users/owenbuckley/.npm/_npx/52263/lib/node_modules/copy-dots/src/index.js:91:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at findNodeScript.then.existing (/Users/owenbuckley/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)
  errno: -21,
  syscall: 'copyfile',
  code: 'EISDIR',
  path:
   '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/.browserslistrc',
  dest: '/Users/owenbuckley/Workspace/github/repos/copy-dots-demo' }

Details

Seems related to #13 in that this error happens when not using the work around

export NODE_ENV=developments

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.