Giter Club home page Giter Club logo

generator-chiubaka-typescript-package's People

Contributors

chiubaka avatar

Stargazers

 avatar

Watchers

 avatar

generator-chiubaka-typescript-package's Issues

Re-enable `unicorn/prefer-modules`

  • Enable ECMAModules in jest
  • Enable module: "esnext" in tsconfig (copy this modification over to chiubaka/tsconfig)
  • Refactor code to avoid use of __dirname
  • Re-enable unicorn/prefer-modules in linting configs

Get Tests tab working in CircleCI

Similar to what I was seeing in #6, the "Tests" tab in CircleCI stopped working again :/.

I think it might be a change I made from ./reports/ to ./reports in the CircleCI configs? Not sure.

Yarn commands fail with errors

shinsoku:generator-typescript-package dchiu$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ generator-typescript-package@workspace:. doesn't provide @types/node (p70791), requested by ts-node
➤ YN0002: │ generator-typescript-package@workspace:. doesn't provide mem-fs (p4cb9a), requested by yeoman-test
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0018: │ @types/yeoman-environment@npm:2.10.7: The remote archive doesn't match the expected checksum
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 204ms

Happening after merging of #5. Blocking development off of master since I can't seem to properly install new dependencies??

ESLint errors / warnings for YAML don't show up in VSCode

This should likely be moved to the ESLint config / plugin project once it's created.

After adding eslint-plugin-yml, I'm unfortunately not seeing the YAML errors show up in the VSCode UI even though eslint correctly picks them up from the command line.

Seems like I'm not the only person to have seen this, but this particular issue was closed because no example repo could be made: microsoft/vscode-eslint#997

Set up CI for the generator itself

Would be nice to make sure tests and other checks are clearing before merge, and the generator should dogfood the scaffolding it's creating for other packages.

Run generator and push changes to generated project repos on publish

When the generator is published, we should publish to NPM as you would expect.

However, we should also run the generator with a standard set of options, output that to a submodule, then commit and push updates to that submodule with a message matching the current version of the generator.

#44 likely needs to be completed before this can happen. Standardized configurations for generated packages can be stored as YAML and consumed by the non-interactive mode of the generator.

Add testing harness for generator

Add a basic testing harness for the generator itself so that we can verify its functionality continues to work as we upgrade and improve it.

ESLint freaks out when trying to lint file named TsConfigGenerator.ts

I'm trying to write a TsConfig generator to resolve #3, and ESLint trips over TsConfigGenerator.ts with this error:
image

If I rename the file to something else I don't see this problem. Weirdly, if I run ESLint from the command line, it also doesn't trip over this file. It's showing in the VSCode UI, though, which is pretty annoying.

Cannot find module 'isbinaryfile'

 FAIL  src/node-module/NodeModuleGenerator.test.ts
  NodeModuleGenerator
    ✕ creates a package.json file (280 ms)

  ● NodeModuleGenerator › creates a package.json file

    Cannot find module 'isbinaryfile' from '/Users/dchiu/Developer/generator-typescript-package/.yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util'

    Require stack:
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util/binary-diff.js
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util/conflicter.js
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/environment.js
      .yarn/__virtual__/yeoman-test-virtual-d24845de57/0/cache/yeoman-test-npm-6.3.0-cf0e4ba284-7d8e79fadd.zip/node_modules/yeoman-test/lib/index.js
      src/node-module/NodeModuleGenerator.test.ts

      at resolveSync (.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip/node_modules/resolve/lib/sync.js:111:15)

I have found that installing isbinaryfile as a dev dependency in my package resolves the error, but it feels like I shouldn't have to do that :/. Feels like yeoman-environment should be including isbinaryfile as a dependency so that it gets pulled in when I install yeoman-environment. I opened an issue with them to this effect: yeoman/environment#420

Properly generate a multi-line array for package.json keywords

Tough to justify working on this, as I've found a workaround that doesn't involve a multi-line array, but I've found that it's surprisingly difficult to get the right formatting and indentation for a multi-line array of keywords in EJS.

There's some discussion of how includes don't respect indentation from the included file here, which is semi-relevant.

It's possible I just don't know all that much about EJS, but the one version of this that I was able to get working looked really bad in code, and just wasn't worth the trade-off. It felt like EJS wasn't respecting my indentation choices even inline, and I couldn't quite grok the pattern (or lack thereof) of indentation output based on the code I wrote.

Set up CodeCov for generator project

Choosing CodeCov because they're offering free unlimited usage for open source and a limited free plan for private repos.

Pricing for CodeCov is also more competitive for a small team ($10/mo vs $25/mo for Coveralls, though Coveralls comes with unlimited users at that price).

Move README shield generation for respective services to their own generators

For example, the NodeModuleGenerator should be responsible for the NPM shield and the CircleCiGenerator should be responsible for the CircleCI shield.

This would be nice because it means that subgenerators are, themselves, completely self-contained. If I don't run the CircleCiGenerator, no other generator is going to see anything at all related to CircleCI. There are a few exceptions since we globally expect there to be both a README and a .gitignore file, but for the most part this model makes sense to me.

I encountered some difficulty getting this to work properly. Specifically, I was finding that the NodeModuleGenerator would constantly fail to find the README.md file that should have been created already by the ReadmeGenerator that it was composed with.

Some logging did reveal that the ReadmeGenerator#writing method was being called before my attempts to write to README.md (note, though, that by default NodeModuleGenerator#writing appears to happen before its composed sub-generators, so I placed my write attempt in conflicts or install).

I kept getting that README.md does not exist. Weirdly, doing this.fs.exists("README.md") would return true, but this.fs.read("README.md") would throw the error.

I did some searching around in the Yeoman docs and in the underlying mem-fs-editor docs and found that this functionality should be working because mem-fs-editor seems like it should be checking its in-memory files before going to disc and because Yeoman claims to be sharing the mem-fs-editor instance across all subgenerators.

Ultimately, I gave up on getting this to work and decided to move the shield generation into ReadmeGenerator, which I don't love.

Generate a README.md file

  • Should include instructions to complete set up of git repository
  • Should include instructions to complete set up for CircleCI
  • Should include instructions to complete set up for CodeCov
    • Add CODECOV_TOKEN env var to CircleCI

Resolve yarn resolution warnings

➤ YN0000: ┌ Resolution step
➤ YN0002: │ generator-typescript-package@workspace:. doesn't provide @types/node (p70791), requested by ts-node
➤ YN0002: │ generator-typescript-package@workspace:. doesn't provide mem-fs (p4cb9a), requested by yeoman-test
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed

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.