Skip to content
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

Add script for fully building public site #56

Merged
merged 7 commits into from
Nov 9, 2016
Merged

Conversation

themadcreator
Copy link
Contributor

No description provided.

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOU GOT LINTED!

}, {
id: "datetime",
cwd: "packages/datetime",
dependencies: ["core"],
sass: true,
typescript: true,
karma: true,
copy: false,
}, {
id: "docs",
cwd: "packages/docs/",
dependencies: [
// docs typescript "depends" on all other projects, but as it uses webpack entirely,
// that dependency is expressed by making `webpack` tasks depend on `typescript` tasks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment isn't entirely accurate now, is it? update wording please?

@@ -11,19 +11,22 @@ const projects = [
sass: true,
typescript: true,
karma: true,
copy: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a note that these tasks must exist yada yada so we don't forget?

blueprint.task("copy", "files", [], (project) => (
blueprint.task("copy", "files", [], (project) => {
// allow for no-op on project dependencies
if (project.copy === false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly i'd prefer to support {} here instead of false cuz false sounds like "don't run this task" but that's not what will happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to follow the convention in Gulpfile.js where you can switch on/off tasks with true/false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giladgray isn't that exactly what's happening? i.e. this task is not being run, it aborts early.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

essential distinction is that the task exists, it just does nothing. and it needs to exist because of how project dependencies work here.

copy: false suggests to me that the project wants to opt out of that task, which is precisely not what happens here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why that semantic distinction is meaningful -- this is getting pedantic

return gulp.src(config.srcGlob(project, true))
.pipe(plugins.sourcemaps.init())
.pipe(sassCompiler)
.pipe(plugins.postcss(postcssPlugins, postcssOptions))
.pipe(plugins.autoprefixer(config.autoprefixer))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a good time to move autoprefixer into postcss too? there's a warning on install that this plugin is deprecated and should be done through postcss.

https://github.com/postcss/autoprefixer#gulp

* @param project {Object} current project
* @param paths {string[]} subdirectories
*/
destPath(project, ...paths) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh i was hoping that dest() would be enough, which is why it includes the gulp.dest call.
worth unwrapping that so we only need one of these methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, then we'd just have to wrap the calls like gulp.dest(blueprint.dest(project))

postcssUrl({ url: "rebase" }),
// copy assets to dist folder, respecting rebase
postcssCopyAssets({
pathTransform: (newPath, origPath, contents) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contents is unused.
also the => () syntax would obviate the need for return.
then it might all fit on one line!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the current syntax; I think a one-liner would be overkill / too dense here.

@@ -34,6 +42,7 @@
"gulp-insert": "0.5.0",
"gulp-less": "3.1.0",
"gulp-load-plugins": "1.3.0",
"gulp-postcss": "^6.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exact deps all the way down please. no ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i aliased nid to npm install --save-dev --save-exact

@blueprint-bot
Copy link

lint

Preview: docs
Coverage: core | datetime

@blueprint-bot
Copy link

PR comments

Preview: docs
Coverage: core | datetime

@themadcreator
Copy link
Contributor Author

themadcreator commented Nov 9, 2016

only 251 artifacts exported!!!!!!!! (down from like 20,000 in some PRs)

@blueprint-bot
Copy link

merge

Preview: docs
Coverage: core | datetime

//
// * Even if you don't have a copy task, you should add `copy: false` to run a
// no-op copy task. This allows other packages that depend on yours to contain
// a copy task without failing the gulp build.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok that's pretty legit

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking great!

// that dependency is expressed by making `webpack` tasks depend on `typescript` tasks.
"datetime"
// You must add your package to this dependency list if you have any
// examples in the docs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time to add "table" now that it's merged?

@blueprint-bot
Copy link

add table to build script deps

Preview: docs
Coverage: core | datetime

@themadcreator themadcreator merged commit 19ce55a into master Nov 9, 2016
@themadcreator themadcreator deleted the bd/docs-scripts branch November 9, 2016 19:32
greglo pushed a commit to greglo/blueprint that referenced this pull request Dec 12, 2016
* Add script for fully building public site

* lint

* PR comments

* add table to build script deps
peterblazejewicz pushed a commit to peterblazejewicz/blueprint that referenced this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants