-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monorepo #330
Conversation
…s across packages
…dependencies into dev dependencies
…dency version in starter kyt rather than kyt.version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great overall! i have a bunch of microfeedback to take or leave
@@ -1,4 +1,4 @@ | |||
language: node_js | |||
node_js: | |||
- 6.0 | |||
script: npm run lint && npm test && npm run e2e | |||
script: cd packages/kyt-core && npm install && cd ../kyt-cli && npm install && cd ../kyt-utils && npm install && cd ../.. && npm run lint && npm install && npm test && npm run e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe worth breaking out into a separate script?
- `setup` is now deprecated as part of kyt-core. It can be found in kyt-cli | ||
- `start` now runs the node server without a kyt wrapped command. This means kyt can be installed as a dev dependency | ||
3. kyt-utils - Shared kyt code. Not to be used independently | ||
4. starter-kyts - kyt-starter-static and kyt-starter-universal now live in the yt repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, yt
=> kyt
}, | ||
"engines": { | ||
"node": ">=6.1.0" | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "private": true
mean here? and the version? maybe if this is just for the e2e tests, we could move those to another folder at the root level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
means it won't let you publish to npm, it's just as a safeguard. I think its nice to have these at the root level because you can run all the tests and linting at once.
@@ -0,0 +1,5 @@ | |||
{ | |||
"extends": [ | |||
"../kyt-core/config/.eslintrc.base.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the idea that this will change to a versioned dependency once kyt-core
is (pre)published? thoughts on publishing the eslint configs separately too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this linting is just for when you're locally developing I think it's fine to point to another package. We can certainly revisit publishing the eslint configs. Thoughts @delambo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
userKytConfigPath, | ||
userNodeModulesPath, | ||
userPackageJSONPath, | ||
} = require('../../utils/paths')(); // eslint-disable-line import/newline-after-import | ||
// eslint-disable-next-line import/no-dynamic-require |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can lose the eslint comment now, it's not a "dynamic require" anymore
const tmpDir = path.resolve(userRootPath, '\.kyt-tmp'); // eslint-disable-line no-useless-escape | ||
const repoURL = args.repository || 'https://github.com/NYTimes/kyt-starter-universal.git'; | ||
const removeTmpDir = () => shell.rm('-rf', tmpDir); | ||
const tmpRepo = path.resolve(userRootPath, '\.kyt-tmp'); // eslint-disable-line no-useless-escape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should just be equivalent to '.kyt-tmp'
without the eslint comment, no?
type: 'list', | ||
name: 'starterChoice', | ||
message: 'Which starter-kyt would you like to install?', // eslint-disable-line | ||
choices: ['Universal', 'Static'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably ok for now but it would be cool to have this assembled by just reading the contents of packages/starter-kyts
, or at least some configuration somewhere?
also, maybe it's worth having a third option for "Specify a remote repository" where you don't necessarily need knowledge of the -r
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm yeah that sounds cool actually, maybe a post merge task?
{ | ||
type: 'confirm', | ||
name: 'cliVersion', | ||
message: 'There is a newer version of kyt-cli available. \n We recommend you upgrade before you continue. \n Would you like to proceed anyway?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this message output the installed and latest version of kyt-cli? (e.g. "You have 0.4.0 installed, the latest is 0.5.2")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah definitely! we can test after we prepublish
}; | ||
|
||
|
||
program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another potential command this might have (just spitballing) could be ls-starter-kyts
(or something with a better name) - lists available local starter kyts
i'd also add to the docs for the options (directory defaults to .
, setup
doesn't necessarily need a github url since it will prompt for static and universal, -r
is a repo address for a starter-kyt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ls-starter-kyts would involve finding the kyt repo and looking for the list because kyt-cli won't have any of that info locally, we should be thinking about how to keep all this connected though. I want to think through this a little more. Let's chat about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, yeah, maybe there is a way to do this but let's not block this pr on it
### BREAKING CHANGES | ||
|
||
#### MONOREPO | ||
kyt is now a mono repo with several packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably stay consistent on the name "monorepo"
"kyt-cli": "index.js" | ||
}, | ||
"scripts": { | ||
"test": "jest --testPathPattern /__tests__/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need test
and lint
here? I thought that we were testing and linting from the main /package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the main package.json
just runs the sub-packages' scripts
@@ -1,6 +1,24 @@ | |||
|
|||
## Master | |||
|
|||
## 0.4.0 (TBD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
er, shouldn't this go under the "## Master" section?
@@ -0,0 +1,32 @@ | |||
{ | |||
"name": "kyt-cli", | |||
"version": "0.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start at 0.0.1
@@ -0,0 +1,21 @@ | |||
{ | |||
"name": "kyt-utils", | |||
"version": "0.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start at 0.0.1.
…ep for publish after merge
* 'monorepo' of github.com:NYTimes/kyt: removing branch specific code and changing cli version to alpha to prep for publish after merge update kyt-utils to point to npm
* master: (35 commits) creates local copies of packages so e2e tests use latest code (#345) adds style and script linter packages (#344) now using npm version to check for kyt-cli updates (#337) Adds kyt version option to setup command (#343) make lint-script command; lint now runs scripts and style (#339) Adds bootstrap scripts (#341) fixes test coverage command (#342) Run test from root directory (#336) Monorepo (#330) [ci skip] document Jest/Watchman issue and common workaround (#334) Catch SIGINT (#332) Fixes e2e tests (#326) Removes deprecated reflect eslint rule (#325) Upgrade Linter dependencies (#289) [doc]fix path of eslintrc and stylelintrc (#321) Update unit tests for changes made to resolve #303 (#318) adds ISSUE_TEMPLATE (#317) Adds rfc template (#316) document possible kyt setup repository url formats (#314) Overwrites default npm init test script on setup (#293) ... # Conflicts: # .travis.yml # e2e_tests/tests/cli.test.js # package.json # packages/kyt-cli/cli/actions/setup.js
fixes #323
fixes #327
Makes kyt a mono repo with several packages
kyt-cli setup -d myDirectory
setup
is now deprecated as part of kyt-core. It can be found in kyt-clistart
now runs the node server without a kyt wrapped command. This means kyt can be installed as a dev dependencye2e tests have been pulled to the top level and will be used to test all packages.
Tasks before merge:
prepublish kyt-utils as alpha
point kyt-cli and kyt-core dependency to kyt-utils alpha rather than file dependency
Fix ToDos in setup
Post Merge:
I've also started the docs which can get merged after all the monorepo packages are published.
https://github.com/NYTimes/kyt/compare/monorepo...monorepo-docs?expand=1