palantirnet / butler Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
https://github.com/sasstools/sass-lint
In addition to the fact that I like knowing snugug is the maintainer and it's easy to yell at him when things aren't working: No Ruby and it lints CSS in additions to the Sass files. I think it's worth the easy swap.
Thoughts @rwagner00 ?
There is an issue trying to execute npm install
you will get the following error:
npm ERR! git fetch -a origin (git://github.com/squizlabs/HTML_CodeSniffer.git) fatal: remote error:
npm ERR! git fetch -a origin (git://github.com/squizlabs/HTML_CodeSniffer.git) The unauthenticated git protocol on port 9418 is no longer supported.
To solve this issue is needed to change the git://
to https://
or to github://
We think it needs and if statement, but it breaks if you run it on vagrant
We need a branch which only supports proxy for an external site for its compiling, so Drupal (and other) sites without a prototype can benefit from Butler.
When Butler attempts to compile faulty YAML files it fails silently. It should notify the user of the error, preferably what line of which file is failing.
I've tried implementing this with something like https://github.com/dtothefp/gulp-yaml-validate, but I wasn't able to integrate it into Butler's Gulpfile.js.
Optimally, I see this running before or after the CSS linter, scanning styleguide/source/styleguide/*.html for YAML parsing errors, and then outputting the errors to the terminal.
Currently the README for master doesn't address the "Umm... there's no code here, how do I work with this" aspect, which I think should be addressed first thing in the README.
Seems likely [timestamp] should actually be a timestamp, but when butler deploys to github pages, the commit message is always:
Updated with Butler - [timestamp]
While we're in that area of the code, it would also be handy to have the commit hash and message of the branch the deploy is working from. You can get this with git log -1 --format="[%ai] %h: %s"
So if we were deploying from here:
commit d23a45909d32aec3caade7a73b7e26725860e42c
Author: Amazing Designer <[email protected]>
Date: Tue Sep 13 14:28:49 2016 -0500
create breadcrumb component
The commit message would be:
Updated with Butler - [2016-09-13 14:28:49 -0500] d23a459: create breadcrumb component
This suggestion means we get the timestamp of the recent commit, and not the timestamp of the commit which triggers the deployment, but the timestamp of the commit triggering the deployment is already in the commit. If we have the commit log, we probably already have that timestamp.
Notice Beginning deploy to gh-pages forundefined
. There's no space after "Beginning deploy to gh-pages for" but also, the variable that is being printed after is "undefinded".
Also, pretty sure Committing "Updated with Butler - [timestamp]
should actually be a timestamp and not [timestamp]
For what it's worth, some of these may actually be set. The deploy seems to work, but the output is flawed. The exception being the git commit messages which really do just say [timestamp].
So there are a couple of issues:
defaults.sculpin_run
and it should actually be overrides.sculpin_run
conf/defaults.butler.js
Butler is not overriding the path variable. Instead, it continues to look for the vendor/bin/sculpin
@agentrickard we added a MIT license to the project to allow other people to use it, but the repository is still private. Seems like if we're going to allow others to use it, then we should at least make the repo public. I'd be interested in exploring, what else needs to be done to make this a public artifact.
I am running into an issue with installing butler via npm in vagrant. I've updated node and npm but maybe this is only an issue with vagrant: npm/npm#9633 (comment). Either way I'm reporting it in case other people run into the issue. Does it make sense to add it as a git clone instead?
npm ERR! Linux 3.19.0-47-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "git://github.com/palantirnet/butler.git"
npm ERR! node v5.9.1
npm ERR! npm v3.8.3
npm ERR! path /var/www/palantir20.local/node_modules/@palantirnet/butler/bin/butler
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/var/www/palantir20.local/node_modules/@palantirnet/butler/bin/butler'
npm ERR! enoent ENOENT: no such file or directory, chmod '/var/www/palantir20.local/node_modules/@palantirnet/butler/bin/butler'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/palantir20.local/npm-debug.log
npm ERR! code 1
I've run into this a few times while bringing projects up. Running npm install
initially can take over an hour to run. I'm unsure what might be causing the problems.
I may investigate using another npm
compatible package manager like yarn
to see if it speeds up the process.
When adding butler to a project you should be adding a release tag instead of saving exact.
https://github.com/svg/svgo can automate a lot of SVG optimization tasks, which I've heard:
we literally have no standards around
It might be worth considering as an addition.
Does "The beginnings of a Sculpin-based style guide creation tool." really explain what this is? Is there something better that could go here?
The configuration variables custom to the project that are stored in the conf/butler.default.js are not being used. If you run console.log(defaults) in the gulpfile after trying to pull in the custom variables you will receive the following output even with a git remote repository being set:
{ scss:
[ '../../styleguide/source/code/sass/*.scss',
'../../styleguide/source/code/sass/**/*.scss' ],
css: '../../styleguide/source/code/css/',
sculpin: '../../styleguide/',
output_dev: '../../styleguide/output_dev',
output_prod: '../../styleguide/output_prod/**/*',
sculpin_run: '../../vendor/bin/sculpin',
autoprefixer: { browsers: [ 'last 2 versions', '> 5%' ] },
stylelint: { configFile: 'config/linters/stylelint.config.json' },
deploy: { remoteUrl: undefined } }
I have a solution for this that I will link a PR to: #29
Because I really like Jarvis from Iron Man, mkay? ๐
I changed index.html, but the changes were not reflected in the browser until I ran gulp again.
'events.js:85
throw er; // Unhandled 'error' event
^
Error: stdout maxBuffer exceeded.
at Socket. (child_process.js:792:12)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)'
Right now there has been little done around favicons/device icons in the styleguide. We should create the desired set of dimensions need for this.
Bill fixed this on FAMSF and here is a link to that commit: https://github.com/palantirnet/famsf-digital-stories/pull/100/commits/0650e596aea82beb536cf920424c49ee5647bf2e
I think we should apply this to all butlers, not just famsf's
This could probably be left out of the Butler repo and and installed as part of startup on a per project basis.
npm WARN cannot run in wd [email protected] find node_modules/ -name '*.info' -type f -delete (wd=/Users/LaurenByrwa/Sites/butler)
So there are a couple of issues:
defaults.sculpin_run
and it should actually be overrides.sculpin_run
conf/defaults.butler.js
Butler is not overriding the path variable. Instead, it continues to look for the vendor/bin/sculpin
Over in the PNet project, I've taken Carl's styleguide and enhanced it with real data using Vue.js (a single JS include) and some JSON exports of real Drupal data.
That work is in https://github.com/palantirnet/palantirnet-d8/pull/78
Is this something we want to do with our styleguide work? It would entail:
{% verbatim %}
in Twig templates so that Vue.js handlebar tags are not interpreted.Here's a snippet of the final code, which iterates over content for populating a list:
<div class="grid">
<div class="grid-sizer"></div>
<div class="gutter-sizer"></div>
<!-- Vue.js template for printing each item. -->
<template v-for="(item, index) in selectedContent(content, display, topicSelected, industrySelected)">
<div :class="'grid-item' + getClass(index)">
<a class="grid-link" :v-bind="{ href: item.url }" :style="{ backgroundImage: 'url(\'' + background(index, item.image) + '\')' }">
<div class="grid-link__content">
<span class="grid-link__label">{% verbatim %}{{ item.type }}{% endverbatim %}</span>
<h2 class="grid-link__title">{% verbatim %}{{ item.title | decode }}{% endverbatim %}</h2>
</div>
<div class="grid-link__view">
<span class="grid-link__label">{% verbatim %}{{ item.title | decode }}{% endverbatim %}</span>
<span class="grid-link__view-text" :style="{ color: getColor(index) }">View {% verbatim %}{{ item.type }}{% endverbatim %}</span>
</div>
</a>
</div>
</template>
</div>
this needs some instructions on how to review things and should be setup to flag that users read the contributing.md before creating a PR
Use Drupal breadcrumb as an include in our base install. This can be static.
<nav role="navigation" aria-labelledby="system-breadcrumb">
<h2 class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
<ol>
{% for item in breadcrumb %}
{% if item.url %}
<a href="{{ item.url }}">{{ item.text }}</a>
{% else %}
{{ item.text }}
{% endif %}
{% endfor %}
</ol>
</nav>
I tried just running Butler statically to see if it would pull up the sculpin prototype. It seems to have installed the dependencies, however when I ran gulp
this is the error that I got:
Error: Cannot find module 'isarray'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/LaurenByrwa/Sites/butler/node_modules/gulp-inject/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js:25:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/LaurenByrwa/Sites/butler/node_modules/gulp-inject/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/readable.js:1:90)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
When you encounter certain Sass errors, Butler is halted. Rerunning Butler throws an error because the port (8000) is occupied. I believe the former process never lets go of the port.
The only fix so far is restarting Vagrant and then running Butler.
Error thrown when trying to rerun Butler:
events.js:85
throw er; // Unhandled 'error' event
^
Error: Command failed: /bin/sh -c ../../vendor/bin/sculpin generate --watch --server --project-dir="../../styleguide/"
[React\Socket\ConnectionException]
Could not bind to tcp://0.0.0.0:8000: Address already in use
I get TypeError cannot read property '0' null when running npm run deploy either locally or in the virtual machine.
TypeError: Cannot read property '0' of null
at Function.module.exports.Commit.actor (/var/www/uw-stout.local/styleguide/node_modules/butler/node_modules/gulp-gh-pages/node_modules/gift/lib/commit.js:145:56)
at Function.module.exports.Commit.parse_commits (/var/www/uw-stout.local/styleguide/node_modules/butler/node_modules/gulp-gh-pages/node_modules/gift/lib/commit.js:111:21)
at /var/www/uw-stout.local/styleguide/node_modules/butler/node_modules/gulp-gh-pages/node_modules/gift/lib/commit.js:71:39
at ChildProcess.exithandler (child_process.js:745:7)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1019:16)
at Process.ChildProcess._handle.onexit (child_process.js:1091:5)
I've traced this to an error with the gulp-gh-pages module and from there to its dependent gift module:
notatestuser/gift#96
It looks like there is a pushed fix. Is there any way to update butler to get that fix in place?
Seems to be a performance issue with the way that Virtual Box handles the NFS Mount, should be tested with VMWare to see if that would solve the problem or not.
README instructions point to "#remove-ruby" which is no longer a branch it should point to the tag that we are using currently.
Right now Butler assumes that it is the dependency of a project that has a styleguide. This means that the package.json
and the node_modules
are in the project root, but maybe that assumption is incorrect. Should it really be considered a styleguide dependency where those things would live in [project]/styleguide/
instead of inside [project]
?
If it is acceptable to ignore these linting warnings, can we configure the linter to ignore them too so real warnings do not get lost in the deluge?
โ Expected double quotes (string-quotes) [stylelint],
โ 'rule-no-duplicate-properties' has been deprecated and in 5.0 it will be removed. Use 'declaration-block-no-duplicate-properties' instead. [stylelint]
โ 'declaration-block-no-single-line' has been deprecated and in 5.0 it will be removed. Use 'block-no-single-line' instead. [stylelint]
โ 'rule-trailing-semicolon' has been deprecated and in 5.0 it will be removed. Use 'declaration-block-trailing-semicolon' instead. [stylelint]
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.