clippedjs / clipped Goto Github PK
View Code? Open in Web Editor NEW:paperclip: How configurations should have been made
Home Page: https://clippedjs.github.io
License: MIT License
:paperclip: How configurations should have been made
Home Page: https://clippedjs.github.io
License: MIT License
https://github.com/siddharthkp/auto-install#readme
watch
hookconfig:watch
also for clipped.config.js
?For example
const config = createChainable({
abc: [
{text: 'abc'}
]
})
If i do something like
config.abc.text
Since the array abc
does not have text
property, it should try accessing conffig.abc[0].text
This is useful tools that can have multiple sets of config e.g. rollup
Some tools like babel and typescript have additional functions in their cli, so its actually better to like create a config file rather than trying to recreate their cli behaviours using their api like @babel/core
.clipped
for storing those config files@vue/cli
's ConfigTransform
?when(clipped => clipped.mode === 'development', clipped => clipped.webpack.plugins.add('commonChunks'))
unclip
as new nameCurrently a preset cannot really be reused because they have app specific constants such as entry path, app name.
App specific options can be passed in .env
file, plugins get options from function call
// plugin-blabla.js
module.exports = (opt) => ({config, on, env, tools}) => ({
return {
docker: {
"HttpHeaders": {
"MyHeader": opt.header
}
}
}
})
// clipped.config.js
module.exports = () => [
require('@clipped/plugin-blabla')({header: 'someheader'})
]
Current way needs a really long object chain before even reaching the config.
Current way:
module.exports = clipped => {
clipped.config.webpack.plugins.push(/* blablabla */)
}
Correspond export's object keys to correspond to config, and mutation will be similar to immer's behaviour
New way:
// base.js
module.exports = () => () => ({
webpack: {
entry: [],
rules: {}
}
})
// clipped.config.js
module.exports = () => () => {
return {
webpack: config => plugins.push(/* blablabla */)
}
}
Currently when user edit a preset he actually does not know how the final config object is like.
Maybe stream to console / json file?
For instance the way rollup use babel config and that of webpack is 99% similar but not same
https://github.com/clippedjs/jointed/issues/24
Current init
does not work anymore because didn't scan nested folder structure on github
Make create
a reserved command, which lets user choose plugins to install first, and then use init
command which is currently used for running yeoman generator, make it empty instead initially
unclip
as new namedescribe
function to describe presettransform
function to copy config from e.g. .babelrc
(opt) => [(clipped) => {}]
besides (clipped) => {}
for clipped and the pluginscreate
hook in cliCurrently StandardJs reports error on custom flowtype, might be due to wrong setup.
Right now a problem is that config often depends on the hook triggered and options passed, but right now api.config
is immediately mutated
chain
as a function so the mutation function can be queued, and executed on hook call instead of immediatelyCurrently CLI is getting a bit bloaty due to added hooks, and is not clearly separated in terms of initializing clipped.
Think might be better to move it to separate package @clipped/cli
like @babel/cli
Maybe do it before cac
migration
And I think it will be awesome if when some cases can be automated for users.
Examples:
clipped dev
, cli can assume behaviour like create-react-app. So install webpack, babel and react plugin and then run the dev
hookindex.html
in src, automatically use it as template in html-webpack-plugin
Possible issues:
Be able to keep running clipped.config.js and return clipped.config
Support .forEach()
, .map()
in primitives
3.0.0
to 3.1.0
.This version is covered by your current version range and after updating it in your project the build failed.
codacy-coverage is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 14 commits.
bd4742f
Release version 3.1.0
b9cac41
Merge pull request #67 from codacy/mrfyda-patch-1
7b995cd
Add GitLab CI commit env variable
2b39b7f
Merge pull request #66 from codacy/IGFCoimbra-patch-1
b4c8786
Add available options
83eb16c
Release version 3.0.1
56316e7
Update package-lock.json for npm 5.10.0
f511ac4
Merge pull request #65 from codacy/update-package-lock
9a73660
Update package-lock.json
ae0a7ec
Merge pull request #64 from mrfyda/master
07b31bb
Update vulnerable packages
49561f6
Update README.md
e5be8b8
Don't depend on jest exit code
149e9c2
Add Windows command notes to README
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Plugins
Since some cli do not have JS API, might offer method to convert JSON to arguments string
Branch | Build failing 🚨 |
---|---|
Dependency | lerna |
Current Version | 3.3.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
lerna is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 13 commits.
5da1319
chore(release): publish v3.3.1
367bf4e
test(integration): Avoid inexplicable snapshot comparison errors on Windows
5880788
test(helpers): Replace normalize-test-root with augmented placeholder serialization
ed16536
test(helpers): Make serialize-tempdir placeholder consistent with normalize-test-root
00842d6
fix(create): Upgrade whatwg-url to ^7.0.0
ebb7ee4
fix(prompt): Upgrade inquirer to ^6.2.0
b8d11b8
chore(deps): Update eslint + jest
7bd3179
chore: flailing around trying avoid 'no visual difference' snapshot garbage on Windows
b8915e7
fix(run-lifecycle): Remove repetitive error logging
a379266
chore(helpers): Normalize newlines to coddle windows
2a6f0a4
fix(publish): Tell yarn to stop creating git tags
ac0baa7
test(integration): avoid quoting arguments to coddle windows
b084293
fix(import): Handle filepaths with spaces more robustly (#1655)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
module.exports = () => [
api => api.describe({
id: 'org.clipped.webpack',
name: 'Webpack plugin'
description: 'Webpack bundler support',
after: ['org.clipped.babel'],
before: ['org.clipped.typescript']
})
]
Codecov to analyse the report on website
The report was successfully uploaded, but on the website Codecov said error
No clue yet
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Currently need to install clipped globally and then clipped create
create-clipped
package that runs clipped create
clipped create <folder-name>
creates folder and go into itTest cases:
A clip exposes a cli.js and a index.js respectively. We trigger actions with the cli from actions, but when we attempt an override, index.js will export is config and functions
Currently it is hard to support a standard config cross build tools
Need a way to reflect e.g. clipped.config.name
to clipped.config.webpack.plugins .html.args[0].title
which is clumsy and hard to remember
Installs, but when tying t use create
or init
, it errors.
λ clipped create
module.js:550
throw err;
^
Error: Cannot find module '../dist/src'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Mark\AppData\Roaming\npm\node_modules\clipped\bin\clipped:3:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Using node 8.12 and npm 6.4.1
After trials it actually seems like having separate plugins instead of templates is better, but then how to guide users who are used to create-react-app or @vue/cli to use it is a problem, because it is possible they don't even know what is the difference between Webpack and Rollup, and why need to setup Babel separately.
Make create hook more like a survey like 'Do you want to build a library or website' -> 'Do you want to use react / vue / angular' -> 'Do you want to use typescript' ?
Or make recipes on documentation like parceljs's
The project to be re-transpiled and active page hot-reloaded
It was re-transpiled but needs to reload the page to take effect
Should install dependencies before using
C:\source
λ npm i -g [email protected]
C:\Users\Mark\AppData\Roaming\npm\clipped -> C:\Users\Mark\AppData\Roaming\npm\node_modules\clipped\bin\clipped
+ [email protected]
updated 1 package in 15.395s
then:
C:\source
λ cd clipTest\
C:\source\clipTest
λ clipped init
Usage: clipped ACTION
Actions:
version, create, config:watch
C:\source\clipTest
λ clipped create
{ Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'init' ] }
C:\source\clipTest
λ ls
C:\source\clipTest
λ clipped
Usage: clipped ACTION
Actions:
version, create, config:watch
C:\source\clipTest
λ clipped create
{ Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'init' ] }
C:\source\clipTest
λ clipped version
2.1.4
Originally posted by @devtech8 in #118 (comment)
Make the scripts run from the clips rather than target directory, then pass the target directory path into it as src and dist path
Checklist:
Maybe with VuePress or GitBook?
Presets, generators, clipped itself
Clone clip from corresponding repo
http://www.nodegit.org/guides/cloning/
3.3.2
to 3.4.0
.This version is covered by your current version range and after updating it in your project the build failed.
lerna is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
We now use libnpmaccess
and npm-registry-fetch
to validate logged-in status and package permissions. Huge thanks to @zkat for extracting these fabulous packages!
The new version differs by 5 commits.
cd5a8fa
chore(release): publish v3.4.0
65fc603
feat(publish): Use APIs for validation queries instead of CLI
21aa430
chore(map-to-registry): Ensure env does not pollute config resolution
ea41470
chore: Remove beta-quality Azure Pipelines
fd62753
chore(ci): Set core.autoCRLF -> true so Windows stops failing lint
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
npx --package yo --package @sonicdoe/generator-node
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.