-
Notifications
You must be signed in to change notification settings - Fork 28
Url Module: Bootstrap the repository and add the first module #1
Conversation
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.
Few indentation issues here.
lerna.json
Outdated
"packages/*" | ||
], | ||
"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.
Should we use tabs in JSON config 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.
Yes, I'll add an .editorconfig
shortly, WordPress is switching back to tabs for .json
files:
See #WP40946 and WordPress/gutenberg#1067
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 is auto-generated by lerna, I wonder if it forces spacing indentation if I replace with tabs. I'll test.
packages/url/package.json
Outdated
"description": "WordPress URL utilities", | ||
"main": "build/index.js", | ||
"module": "build-module/index.js", | ||
"browser": "build-browser/index.js", |
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.
Mixed indentation.
scripts/build.js
Outdated
* Babel Configuration | ||
*/ | ||
const babelDefaultConfig = JSON.parse( | ||
fs.readFileSync( path.resolve( __dirname, '..', '.babelrc' ), 'utf8' ) |
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.
Mixed indentation.
scripts/watch.js
Outdated
return fs.statSync(filename).isFile(); | ||
} catch (e) {} | ||
return false; | ||
}; |
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.
Should probably tabify this file too.
I'll fix those indentation issues, hopefully we could get eslint soon :) |
99db7aa
to
6914067
Compare
Thanks for the review, The indentation issues should be fixed. I am using tabs for everything except the package.json
@youknowriad I'll have an ESLint PR soon 😄 |
6914067
to
fde7ea5
Compare
I'd appreciate some 👀 and a ✅ to move forward with the other steps (testing, watching...) |
.babelrc
Outdated
"last 2 iOS versions", | ||
"last 1 Android version", | ||
"last 1 ChromeAndroid version", | ||
"ie 11" |
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.
Did you omit the last 2 edge versions on purpose?
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've just copy/pasted from Gutenberg, we missed Edge :)
package.json
Outdated
"mkdirp": "^0.5.1" | ||
}, | ||
"scripts": { | ||
"build-clean": "rm -rf ./packages/*/build ./packages/*/build-es5", |
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 won't work on windows. Is that a concern? If so, we could use rimraf
.
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.
Good catch, let's not leave Windows users behind :)
I have commented in two locations. I have also tested this locally, for me this PR is ✅. Concerns could be addressed in new PRs. |
Thanks for the review, Feedback addressed. |
Cool, lerna seems like the best way to go here 👍 |
This PR tries to bootstrap the repository using a simple Lerna config.
This PR is highly inspired by how the Jest Repository works.
The idea is trying to build our workflow around a simple module breaking things up into several PRs.
For this initial PR, I'm setting up the
build
script. (Trying to keep it as small as possible)Follow-up PRs should think about linting, testing, watching...
Included in this PR:
url
module as as an example module. The example function here is actually extracted from The Gutenberg repository.Not included yet:
wp.url
global variable.Testing instructions