strvcom / create-strv-app Goto Github PK
View Code? Open in Web Editor NEWSet up new app in line with STRV's best practices in one command
Home Page: https://npm.im/create-strv-app
License: MIT License
Set up new app in line with STRV's best practices in one command
Home Page: https://npm.im/create-strv-app
License: MIT License
We should probably add firebase-cli as a dev dependency, and also add deploy script
After getting through all steps
yarn create v1.5.1
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐ Building fresh packages...
success Installed "[email protected]" with binaries:
- create-strv-app
[STRV placeholder]
? Choose an application type: SPA
? Choose a template: default
? Enter your project name: projectname
? Sugar on top: styled-components
I expect no errors, but I got:
โ ERROR Failed with following error: Error: ENOENT: no such file or directory, open '/Users/username/STRV/projectname/package.json'
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: /usr/local/bin/create-strv-app
Arguments:
Directory: /Users/jakubkotula/STRV/test
Output:
".
I'm adding babel-plugin-module-resolver
plugin using this configuration in .babelrc
:
"plugins": [
[
"module-resolver",
{
"root": ["."],
"alias": {
"containers": "./src/containers"
}
}
]
]
then in index.js
I use import App from 'containers/App'
.
Expected behavior
App
is imported and application starts
Actual behavior
Application fails with error:
'containers' should be listed in the project's dependencies. Run 'npm i -S containers' to add it import/no-extraneous-dependencies
We used SPA template for https://github.com/strvcom/strv-admin-web, at the beginning we dealt with a few issues or not completed configuration. I wrote small guideline which may help others to use it.
Before creating PR I would like to discuss what you consider as mandatory and other aspects.
Here is the list of changes in SPA project itself:
missing task for run eslint/lint
after checking eslint, several warnings/errors appeared, mainly that some Definition for rule
was not found:
eslint-plugin-import
package.eslintrc
"globals": {
"process": true
},
"env": {
"jest": true
}
react/prefer-stateless-function
and also contains classNames through styled-components optionModule build failed: ReferenceError: Unknown plugin "flow" specified in "/home/paave/WebstormProjects/create-strv-app/test/.babelrc" at 0, attempted to resolve relative to "/home/paave/WebstormProjects/create-strv-app/test"
at Array.map (<anonymous>)
.flowconfig
filebabel-plugin-module-resolver
and eslint-import-resolver-babel-module
.env
with NODE_PATH='src'
.flowconfig
options section added module.system.node.resolve_dirname=./src module.system.node.resolve_dirname=node_modules
.eslintrc
:"settings": {
"import/resolver": {
"babel-module": {},
"node": {
"paths": [
"./src"
]
}
}
// @flow
comment: credit to @koss-lebedev FILES_COUNT=$(echo $FILES_WITHOUT_FLOW | wc -w)
if [ $FILES_COUNT -ne 0 ]
then
echo "Following files are missing @flow annotation:"
echo $FILES_WITHOUT_FLOW | tr " " "\n"
exit 1
fi
.editorconfig
After initialising project with flow, you have to call flow init
to make flow checker working.
Solution could be to add some basic .flowconfig
file or call flow init
after npm install
.
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.