accurat / accurapp Goto Github PK
View Code? Open in Web Editor NEWCreate JS apps with flexible build configuration, tailored for the specific needs of Accurat
License: MIT License
Create JS apps with flexible build configuration, tailored for the specific needs of Accurat
License: MIT License
@caesarsol wrote on Slack:
ciao @devs, chi configura un deploy su Netlify, per piacere NON aggiunga un nuovo Slack Hook ma usi sempre questo:
https://accurat.slack.com/services/....
Hook: ...
So we need to change the instructions in the README accordingly 🙃
Instead of throwing an error, it's better to show the usage help if missing on the CLI
$ create-accurapp
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.resolve (path.js:1146:7)
at Object.<anonymous> (/Users/marco/.config/yarn/global/node_modules/create-accurapp/index.js:91:21)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
is not defined
should be an error instead of a warning
Suggestion: use json-perf-loader instead of the default webpack JSON loader.
Because the JSON grammar is much simpler than JavaScript’s grammar, JSON can be parsed more efficiently than JavaScript. This knowledge can be applied to improve start-up performance for web apps that ship large JSON-like configuration object literals (such as inline Redux stores). Instead of inlining the data as a JavaScript object literal.
As long as the JSON string is only evaluated once, the JSON.parse approach is much faster compared to the JavaScript object literal
I've asked if that is still useful for webpack v4 here, just to be sure it makes sense :)
In the package.json scripts, so that you can check what's wrong by running yarn lint
Should be enough to remove exclude: 'node_modules'
from the babel config of the prod build configuration.
When it will be more mature
https://github.com/typescript-eslint/typescript-eslint
Examples
facebook/create-react-app#6513
facebook/create-react-app#6701
https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/
Lerna will still handle the publishing.
Currently waiting on this issue to be resolved
The configuration described here gives now an error:
https://github.com/accurat/accurapp#customizing-webpack
const { buildWebpackConfig } = require('webpack-preset-accurapp')
const { sass } = require('webpack-blocks')
module.exports = buildWebpackConfig([
sass(),
])
https://github.com/accurat/accurapp/blob/master/packages/accurapp-scripts/bin/scripts.js#L31
The try catch
gives NOT_FOUND
even if a sub-sub-module of build.js
has a module not found.
Would be better to use require.resolve
and/or fs.exists()
to check for the existence of the script/
What if we use drop_console
option on uglifyjs to remove unwanted console logs in production?
https://github.com/mishoo/UglifyJS2#compressor-options
Use something similar to eslint-config-standard's globals config to enforce browser globals to be declared with window.
or document.
Maybe MobX?
emulate this:
"scripts": {
"lint": "node node_modules/eslint/bin/eslint.js src/",
"lint:errors": "node node_modules/eslint/bin/eslint.js --quiet src/"
}
For SVG imported like this:
import { ReactComponent as SvgIcon } from './123-abc.svg'
Webpack gives this error:
!!! Errors in compiling:
• ./src/123-abc.svg
TypeError: Cannot read property 'each' of undefined
at Array.forEach (<anonymous>)
at Array.forEach (<anonymous>)
The solution is start the SVG filename with a letter.
This is due to the SVGO plugin which has a bug prefixing CSS classes names with the filename, and CSS classes cannot begin with a number. @ilariaventurini is filing an issue (and a fix) on SVGO repo right now! Both for the non-meaningful error of numeric classes, and for the filename-prefixing code.
Then we should alert the SVGR team, and then update accurapp's SVGR version.
In the meanwhile remember to rename the SVGs and maybe we should add an alert in the accurapp README.
@marcofugaro @lucafalasco @nkint @markov00
Let's list all the eslint related proposals in this issue.
One proposal per post, votes through reactions.
The solution is easy: adding a robots.txt
in the build
dir.
The problem is to be extra-sure we don't add that in production, but only in staging env!
We can't be sure about this since the same yarn build
command is used, and the NODE_ENV
variable is apparently not correctly set (@marcofugaro told me, but is that true?).
Seems like the best option could be to use something like:
[[ ! -v GENERATE_SOURCEMAP ]] && [[ -v CI ]] && echo 'User-agent: *\nDisallow: /' > build/robots.txt
Refactor the babelrc when babel7 comes out.
Also add babel-macros
https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
And use browserlist
babel/babel-preset-env#149
Is your feature request related to a problem? Please describe.
Sometimes for developers overlook, an npm
command gets run in the repo and a package-lock.json
gets created even if a yarn.lock
is already present.
This creates problems in Netlify and other auto-deploy platforma, because they choose the tool depending on which files they find.
Describe the solution you'd like
Any accurapp
command (start / build / lint) could check: if package-lock.json
AND yarn.lock
are present, block everything and alert with a big red flashy warning.
Solution for the user: delete one of the two files (preferably the NPM one)
Thoughts?
Every property should be overridable either in package.json
or in webpack.config.js
Would be nice to change the path of the production folder, in my use case we have to create different folders at build time for each different language.
Example:
build/
-- app.js
-- index.html
-- assets/
-- fr/
---- app.js
---- index.html
-- de/
---- app.js
---- index.html
BUILD_PATH=build/fr
Reduce the used logo to a more minimal one so that with small console is readable.
Maybe changing the ASCII art font or just using the /|||/| logo.
We currently have a conflict between the rules in eslint
and the formatting in prettier
. In particular eslint
forces to put a space before the generator function * fetchOutsample()
and prettier defaults to function* fetchOutsample()
. I like the prettier version more and would remove the eslint rule but I wanted to raise the issue to @marcofugaro first. For now you can do:
// .eslintrc
{
"extends": "eslint-config-accurapp",
"rules": {
"generator-star-spacing": 0
}
}
Now done with:
yarn add -D csv-loader
and in webpack.config.js
:
const buildWebpackConfig = require('webpack-preset-accurapp')
module.exports = buildWebpackConfig([
(context) => ({
module: {
loaders: [
{
test: /\.csv$/,
loader: 'csv-loader',
options: {
dynamicTyping: true,
header: true,
skipEmptyLines: true,
},
},
],
},
}),
])
Are we reusing something from the create-react-app that needs BSD license?
There should be a check or, at least, a clearer error message (createEnvFile is called if process.env.CI === true)
$ yarn build
yarn build v0.21.3
$ accurapp-scripts build
module.js:472
throw err;
^
Error: Cannot find module 'fs-extra'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/marco/Workspaces/Accurat/tools/prova/node_modules/accurapp-scripts/scripts/build.js:22:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
error Command failed with exit code 1.
Add the create-accurapp version when creating a project and when lunching start
,build
etc
Is your feature request related to a problem? Please describe.
Sometimes circular dependencies are introduced in the project. Often without knowing, maybe for simple exported strings or trivial constants.
This introduces these possible problems:
null
or undefined
;Describe the solution you'd like
Add circular-dependency-plugin to Webpack by default, to error out (or a BIG warning, but I prefer error) in case of a circular dependency.
Related project: madge
cc @ivanross (for problem 3 and for the discovery of madge)
cc @pitou (for problem 2)
This would help catching bugs!
Like webpack-blocks does
https://github.com/andywer/webpack-blocks/tree/release-2.0/packages/sample-app
Steps to reproduce
Actual behavior
The two IDs clashes, because they are note rewritten, and the second clipPath does not work.
Expected behavior
The IDs should be renamed and prefixed (with filenames).
Easy to do just removing this line:
@marcofugaro do you remember why for *.color.svg the IDs are not prefixed?
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.