barrel / barrel-cli Goto Github PK
View Code? Open in Web Editor NEWA Wordpress and Shopify development toolkit
A Wordpress and Shopify development toolkit
Barrel WordPress will include stylelint
in an upcoming release.
Since adding this to the local webpack.config.js has no effect on HMR, we need to add the following to the webpack.js routine:
const StyleLintPlugin = require('stylelint-webpack-plugin')
...
preparePlugins () {
...
...(this.watching && config.get('hmr') ? [
new webpack.HotModuleReplacementPlugin()
]: []),
new StyleLintPlugin({
configFile: path.resolve(config.get('cwd'), '.stylelintrc'),
files: '(src/css/|modules/)**/*.css',
syntax: 'scss',
failOnError: false,
quiet: false
}),
new webpack.NoEmitOnErrorsPlugin(),
]
}
These are the deps required:
"stylelint": "^9.6.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-webpack-plugin": "^0.10.5",
Currently gulp is not triggering the tasks copy
& contact
when new files are added
to the source directory. They are only being triggered when the files have been changed
.
If the glob string provided to the watch task is an absolute path starting with a /
then gulp will not trigger for new files.
We can pass an options
argument to the watch tasks and set the cwd
property with the directory that will be used to build absolute paths.
watch () {
gulp.watch(
+ 'src/**/*.*',
+ {cwd: config.get('cwd')},
e => {
try {
this.copy(e, true)
} catch (e) {
new Err(e)
}
}
)
gulp.watch(
+ 'src/config/**',
+ {cwd: config.get('cwd')},
e => {
try {
this.concat(true)
} catch (e) {
new Err(e)
}
}
)
}
Also update the copy
method and check if the type of the event was added
.
+ if (type === 'changed' || type === 'added') {
While working on a Shopify site using the Back in Stock
app, I found I needed to work with a URL with no port attached (localhost
instead of localhost:3000
). This was due to a limitation of the app, which I didn't really have control over.
Changed the port in watcher.js
to 443
(the browser's default https port)
return {
proxy: {
...
port: 443
}
}
Then ran start as sudo:
sudo yarn start
This boots up your browser with just localhost
, instead of localhost:3000
I had to edit the npm package source directly. What would the level of effort be to make this configurable without having to edit the package's source?
Problem: On a Windows/WordPress setup The brrl -w
command doesn't trigger a browsersync update even though it compiles without error in response to file changes. Changes to js and css aren't reflected in the localhost site or proxied lando website as a result.
Background: lib/configure.js
checks for '/wp-content/
' in the webpack output path to form the public path for the api. On windows that path is backslashed in local configurations which breaks the path being fed to the webpack-dev-middleware
initialization in lib/watcher.js
. That in turn leads to the output files being compiled in memory at the wrong public path.
Solution: At the checkPublicPath()
function in lib/configure.js
use Node's path module to check for platform specific path separators then convert all backslashes to forward slashes when forming the public path.
Hello, I am working on a project that uses brrl-cli and I can't seem to generate a soure-map files. For some reason, my code during development mode works like a charm and during production it throws unexpected errors. I tried including source-maps but they're not there when I check the website on Shopify.
devtools: isProduction ? 'source-map' : 'inline-source-map',
I've tried other type of source-maps but it still fails.
Thanks a lot!
After running npm i
(where barrel cli is in package.json), I'm getting a bash: brrl: command not found
error. Tried reinstalling with npm i barrel-cli -D
and got a 404 error. Using https://registry.npmjs.org/ as base registry. Also tried installing with npm install @barrelny/cli
as per https://www.npmjs.com/package/@barrelny/cli -- no luck. Looks like the issue may be around the "bin" field in the package.json.
Hi,
After running "npm i @barrelny/cli -D", I try to run "brrl -b" and get the error:
-bash: brrl: command not found
Any clues?
Thanks,
Wil
Hi,
I'm following instructions as detailed in readme file here: https://gitlab.com/barrel/barrel-wordpress/tree/master/wp-content/themes/barrel-base
I'm running command "npm run build" on theme folder, but nothing seams to be happening to "assets/main.min.js". The file remains unchanged after doing any changes to "src/js/main.js".
Thanks,
Wil
Attempting a fresh install with npm i barrel-cli -D
on the theme...
npm ERR! code E404
npm ERR! 404 Not Found: barrel-cli@latest
The log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.9.2/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'i',
1 verbose cli 'barrel-cli',
1 verbose cli '-D' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 8a5e40f2850f724d
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 https://registry.npmjs.org/barrel-cli 860ms
8 silly fetchPackageMetaData error for barrel-cli@latest 404 Not Found: barrel-cli@latest
9 verbose stack Error: 404 Not Found: barrel-cli@latest
9 verbose stack at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
9 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack at runCallback (timers.js:789:20)
9 verbose stack at tryOnImmediate (timers.js:751:5)
9 verbose stack at processImmediate [as _immediateCallback] (timers.js:722:5)
10 verbose cwd /Users/westurner/Sites/barrel-kb/wp-content/themes/barrel-base
11 verbose Darwin 16.7.0
12 verbose argv "/usr/local/Cellar/node/8.9.2/bin/node" "/usr/local/bin/npm" "i" "barrel-cli" "-D"
13 verbose node v8.9.2
14 verbose npm v5.5.1
15 error code E404
16 error 404 Not Found: barrel-cli@latest
17 verbose exit [ 1, true ]
Issue occurred during Zupa Noma (PayWhirl -> reCharge) project.
$ npm run development
> [email protected] development /Users/user/Sites/zupa-noma
> brrl -d -e development
Proxy target set at https://zupa-noma-dev.myshopify.com
Compiling assets.. This could take a few moments
(node:66249) UnhandledPromiseRejectionWarning: fatal: bad object 8f2357061072669954108fff96842be184800b95
(node:66249) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:66249) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is a result of an uncaught exception due to unexpected behavior. The commits.txt
contained two commit hashes that were not relevant to the project. This can happen if the file was ported from another project or if the commits were invalidated due to force push. Either way I was able to confirm that the deployment process continued without issue after commenting out L32. Understandably, this should be returning the diff'd files to reduce overhead of pushing all files rather than changed ones. After adding a common commit hash to the commits.txt and removing the others, the deployment command succeeded.
I recommend adding a catch or condition to indicate to the user of the CLI that the commits.txt file is bad or add a process to wipe it out and start again or find a common commit hash that does exist in the file.
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.