hotell / typescript-lib-starter Goto Github PK
View Code? Open in Web Editor NEWTypescript library starter
License: MIT License
Typescript library starter
License: MIT License
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
It's 2019 already huh! cloning repos manually is kinda "old school/cumbersome".
We should support modern project bootstraping experience, like yarn create
or npx create-typescript-lib
.
Work that needs to be done:
TODO:
create
prefix (@martin_hotell/create-typescript-lib
)How would bin work?:
the package would just clone this repo and execute init
script
Ahoj Martine!
It will be great if most of tools can work just as expected by running them.
What I can see in package.json
scripts
— there are mostly explicit calls with loading args from ./config/…
It isn't good for almost everyone who use command line ;-)
I expect that root folder will be bloated with hidden dot files — like:
.gitignore
.editorconfig
.npmignore
, .npmrc
.prettierrc.js
, .prettierignore
.travis.yml
.yarnrc
?but, seriously, really… I thing it is worse to keep expected config files outside than add them to their default path. Tools will be happy with everything in implicit path and tooling will behave more correctly with editors.
So, please, consider move everything which must be specified explicitly in package.json
to the root,
if possible, remove config
dir entirely — files inside IMHO can be moved on better path with much better semantic meaning
Currently when used runs yarn
after clone and terminates prompts, "initialization" process will run anyways with destructive consequences ( removed files... re-initialised git etc).
All that needs to be done is to handle CTRL+C gracefully -> just terminate without executing the script logic
we are not updating tslint.json in existing project. Currently migrate script just echoes that nothing was updated, because it does no-op. This should be fixed/implemented. All we need to do is to find out how to properly merge .jsonc
files ( json files with comments )
Just a feedback:
since this is a typescript related library, It would be awesome that the devtools also use TypeScript. In particular config/rollup.config.js is hard to follow due to the jsdoc. For scripts you can use ts-node for run the typescript directly but you will need to transpile them in order to the tools like rollup, jest, etc to "undertand" the config (or maybe not if using valid js?)
you are targeting es5 which is fine but for those which can target more than that it won't work because rollup-plugin-uglify doesn't understand es6. using rollup-plugin-uglify-es will work for all.
I think jest-puppeteer can be easily added to run the specs in the browser too
(more ambitious) would be awesome to use yeoman generator to ask: library name, target js version, if install jest and tests or not, if install lint tool, travis, etc. In my case I only needed the tsc & rollup part. Maybe this could be another project and use this one as a template
Just a feedback, the tool is very helpful and the project has lot of quality. I was looking for building libraries written with typescript, bundling in different module formats and didn't found much since in general people bundle applications not libraries . Congrats, keep it up - you can close this. Sorry for the noise
Hi
you are forcing VSCode users to:
"typescript.referencesCodeLens.enabled": true,
"javascript.referencesCodeLens.enabled": true,
As I can imagine — it can be very powerful tool. But it doesn't work for me and I must explicitly disable it.
Will be much better to instruct people how to turn this on instead of letting us (scratching on the head) what is that 0 references
disturbing line…
support monorepo setup on init.
https://github.com/Hotell/ts-setup already uses this starter with various tweaks. It would be nice to incorporate those, so use would get asked during init
if he wan't to create monorepo or standard single repo.
import/export
make no mistake, all of this is already possible with rollup, but since we are using webpack here well ... :) 👍
It's not very user friendly to manually set library name after fork etc. A yarn init
after cloning the project would be definitely much better experience
When I first pack, there will be a file loss. If I copy the CHANGELOG.md file back, it's normal.
npm run build
> [email protected] prebuild /Volumes/MAC1/file/test/npm/typescript-lib-starter
> npm run cleanup && npm run verify
> [email protected] cleanup /Volumes/MAC1/file/test/npm/typescript-lib-starter
> shx rm -rf dist
> [email protected] verify /Volumes/MAC1/file/test/npm/typescript-lib-starter
> npm run validate-js && npm run style && npm run test:ci
> [email protected] validate-js /Volumes/MAC1/file/test/npm/typescript-lib-starter
> tsc -p ./config && tsc -p ./scripts
> [email protected] style /Volumes/MAC1/file/test/npm/typescript-lib-starter
> npm run format -- --list-different && npm run lint
> [email protected] format /Volumes/MAC1/file/test/npm/typescript-lib-starter
> prettier "**/*.{ts,tsx,js,jsx,css,scss,sass,less,md}" "--list-different"
> [email protected] lint /Volumes/MAC1/file/test/npm/typescript-lib-starter
> tslint --project tsconfig.json --format codeFrame
> [email protected] test:ci /Volumes/MAC1/file/test/npm/typescript-lib-starter
> npm t -- --ci
> [email protected] test /Volumes/MAC1/file/test/npm/typescript-lib-starter
> jest -c ./config/jest.config.js "--ci"
PASS src/__tests__/greeter.spec.ts
Greeter
✓ should greet (3ms)
✓ should greet and print deprecation message if in dev mode (9ms)
console.warn node_modules/jest-mock/build/index.js:711
this method is deprecated, use #greet instead
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 4.048s
Ran all test suites.
> [email protected] build /Volumes/MAC1/file/test/npm/typescript-lib-starter
> tsc && tsc --target es2018 --outDir dist/esm2015 && rollup -c config/rollup.config.js && rollup -c config/rollup.config.js --environment NODE_ENV:production
/Volumes/MAC1/file/test/npm/typescript-lib-starter/dist/esm5/index.js → dist/bundles/index.umd.js...
created dist/bundles/index.umd.js in 28ms
/Volumes/MAC1/file/test/npm/typescript-lib-starter/dist/esm2015/index.js → dist/bundles/index.esm.js...
created dist/bundles/index.esm.js in 8ms
/Volumes/MAC1/file/test/npm/typescript-lib-starter/dist/esm5/index.js → dist/bundles/index.umd.min.js...
created dist/bundles/index.umd.min.js in 259ms
/Volumes/MAC1/file/test/npm/typescript-lib-starter/dist/esm2015/index.js → dist/bundles/index.esm.min.js...
created dist/bundles/index.esm.min.js in 182ms
> [email protected] postbuild /Volumes/MAC1/file/test/npm/typescript-lib-starter
> node scripts/copy && npm run size
fs.js:119
throw err;
^
Error: ENOENT: no such file or directory, copyfile '/Volumes/MAC1/file/test/npm/typescript-lib-starter/CHANGELOG.md' -> '/Volumes/MAC1/file/test/npm/typescript-lib-starter/dist/CHANGELOG.md'
at copyFileSync (fs.js:1743:3)
at source.forEach (/Volumes/MAC1/file/test/npm/typescript-lib-starter/scripts/copy.js:43:7)
at Array.forEach (<anonymous>)
at cp (/Volumes/MAC1/file/test/npm/typescript-lib-starter/scripts/copy.js:42:12)
at main (/Volumes/MAC1/file/test/npm/typescript-lib-starter/scripts/copy.js:22:3)
at Object.<anonymous> (/Volumes/MAC1/file/test/npm/typescript-lib-starter/scripts/copy.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postbuild: `node scripts/copy && npm run size`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wsx/.npm/_logs/2019-03-04T01_33_39_760Z-debug.log
Please explain how you'd expect it to behave.
Explain the rationale for this feature.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.