-
Notifications
You must be signed in to change notification settings - Fork 0
[#170234614] refactor build system and docs #66
Conversation
README.md
Outdated
|
||
# Bring up the Docker test environment (build the frontend, pull the backend and the SPID test environment) | ||
docker-compose up | ||
# run yarn inside docker container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had to chmod +x ./scripts/yarn.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
README.md
Outdated
|
||
# Bring up the Docker test environment (build the frontend, pull the backend and the SPID test environment) | ||
docker-compose up | ||
# run yarn inside docker container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead # Launch docker image and run yarn inside docker
for me was not trivial to understand without going into the scripts
|
||
```shell | ||
yarn start-with-mock | ||
cp env.example .env | ||
# edit .env file | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the copied env.example into .env the mocked server and the app should work without any changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker part seems not to work properly. At least following the steps in the README. Seems that or the port are not exposed from the containers but the host from localhost seems unreachable. The browser is not able to find the provided url and keep trying.
Instead the part without docker works.
Affected stories
New dependencies added: dotenv-cliAuthor: entropitor Description: A global executable to run applications with the ENV variables loaded by dotenv Homepage: https://github.com/entropitor/dotenv-cli#readme
|
Created | over 4 years ago |
Last Updated | 13 days ago |
License | MIT |
Maintainers | 1 |
Releases | 58 |
Direct Dependencies | ansi-styles , chalk , cross-spawn , memorystream , minimatch , pidtree , read-pkg , shell-quote and string.prototype.padend |
Keywords | cli, command, commandline, tool, npm, npm-scripts, run, sequential, serial, parallel and task |
README
index | npm-run-all | run-s | run-p | Node API |
---|
npm-run-all
A CLI tool to run multiple npm-scripts in parallel or sequential.
⤴️ Motivation
- Simplify. The official
npm run-script
command cannot run multiple scripts, so if we want to run multiple scripts, it's redundant a bit. Let's shorten it by glob-like patterns.
Before:npm run clean && npm run build:css && npm run build:js && npm run build:html
After:npm-run-all clean build:*
- Cross platform. We sometimes use
&
to run multiple command in parallel, butcmd.exe
(npm run-script
uses it by default) does not support the&
. Half of Node.js users are using it on Windows, so the use of&
might block contributions.npm-run-all --parallel
works well on Windows as well.
💿 Installation
$ npm install npm-run-all --save-dev
# or
$ yarn add npm-run-all --dev
- It requires
Node@>=4
.
📖 Usage
CLI Commands
This npm-run-all
package provides 3 CLI commands.
The main command is npm-run-all.
We can make complex plans with npm-run-all command.
Both run-s and run-p are shorthand commands.
run-s is for sequential, run-p is for parallel.
We can make simple plans with those commands.
Yarn Compatibility
If a script is invoked with Yarn, npm-run-all
will correctly use Yarn to execute the plan's child scripts.
Node API
This npm-run-all
package provides Node API.
📰 Changelog
🍻 Contributing
Welcome♡
Bug Reports or Feature Requests
Please use GitHub Issues.
Correct Documents
Please use GitHub Pull Requests.
I'm not familiar with English, so I especially thank you for documents' corrections.
Implementing
Please use GitHub Pull Requests.
There are some npm-scripts to help developments.
- npm test - Run tests and collect coverage.
- npm run clean - Delete temporary files.
- npm run lint - Run ESLint.
- npm run watch - Run tests (not collect coverage) on every file change.
parcel-plugin-html-externals
Author: stoically
Description: ParcelJS plugin to ignore certain script and stylesheet link tags in html files marked as externals
Homepage: https://github.com/stoically/parcel-plugin-html-externals#readme
Created | 5 months ago |
Last Updated | 5 months ago |
License | MIT |
Maintainers | 1 |
Releases | 3 |
Direct Dependencies | minimatch |
README
ParcelJS plugin to ignore certain script and stylesheet link tags in html files marked as externals.
Parcel will probably support externals out of the box in the future, related issue here.
Install
npm install --save-dev parcel-plugin-html-externals
Usage
Put an externals
key into your package.json
, e.g.
{
"externals": {
"vendor/**/*": false
}
}
will ignore all script / stylesheet link tags whose src / href attribute starts with vendor/
, e.g
<script src="vendor/thirdparty.min.js"></script>
The externals key can be a string or any glob accepted by minimatch,
the value must be false
to trigger ignoring.
Caveats
The plugin monkey patches Parcel internals by extending the HTMLAsset class and proxying its ast walker, so it might just break in an upcoming version.
License
MIT
shx
Author: Unknown
Description: Portable Shell Commands for Node
Homepage: https://github.com/shelljs/shx#readme
Created | over 3 years ago |
Last Updated | over 1 year ago |
License | MIT |
Maintainers | 2 |
Releases | 11 |
Direct Dependencies | es6-object-assign , minimist and shelljs |
Keywords | shelljs, shell, unix, bash, sh, exec, cli and zsh |
README
Shx
shx
is a wrapper around ShellJS Unix
commands, providing an easy solution for simple Unix-like, cross-platform
commands in npm package scripts.
Difference Between ShellJS and shx
- ShellJS: Good for writing long scripts, all in JS, running via NodeJS (e.g.
node myScript.js
). - shx: Good for writing one-off commands in npm package scripts (e.g.
"clean": "shx rm -rf out/"
).
Install
npm install shx --save-dev
This will allow using shx
in your package.json
scripts.
Usage
Command Line
If you'd like to use shx
on the command line, install it globally with the -g
flag.
The following code can be run either a Unix or Windows command line:
$ shx pwd # ShellJS commands are supported automatically
/home/username/path/to/dir
$ shx ls # files are outputted one per line
file.txt
file2.txt
$ shx rm *.txt # a cross-platform way to delete files!
$ shx ls
$ shx echo "Hi there!"
Hi there!
$ shx touch helloworld.txt
$ shx cp helloworld.txt foobar.txt
$ shx mkdir sub
$ shx ls
foobar.txt
helloworld.txt
sub
$ shx rm -r sub # options work as well
$ shx --silent ls fakeFileName # silence error output
All commands internally call the ShellJS corresponding function, guaranteeing
cross-platform compatibility.
package.json
ShellJS is good for writing long scripts. If you want to write bash-like,
platform-independent scripts, we recommend you go with that.
However, shx
is ideal for one-liners inside package.json
:
{
"scripts": {
"clean": "shx rm -rf build dist && shx echo Done"
}
}
Unsupported Commands
Due to the differences in execution environments between ShellJS and shx
(JS vs CLI) some commands are not supported:
Unsupported command | Recommend workaround |
---|---|
shx cd |
Just use plain old cd (it's the same on windows too) |
shx pushd |
Just use plain old pushd . Use forward slashes and double-quote the path. (e.g. pushd "../docs" . This would fail on Windows without the quotes) |
shx popd |
Just use plain old popd |
shx dirs |
No workaround |
shx set |
See below |
shx exit |
Just use plain old exit |
shx exec |
Instead of shx exec cmd , just use plain old cmd |
shx ShellString |
No workaround (but why would you want this?) |
Shx options
Shx allows you to modify its behavior by passing arguments. Here's a list of
supported options:
set flag |
shell.config setting |
shx command | Effect |
---|---|---|---|
-e |
config.fatal = true |
Not supported | Exit upon first error |
-v |
config.verbose = true |
shx --verbose cd foo |
Log the command as it's run |
-f |
config.noglob = true |
shx --noglob cat '*.txt' |
Don't expand wildcards |
N/A | config.silent = true |
shx --silent cd noexist |
Don't show error output |
Team
Nate Fischer | Ari Porad | Levi Thomason |
this sounds odd since the ports are exposed inside docker-compose.yml. can you please do some debugging ? (which OS are you running as host ?)
|
Sorry, on my tired mac os x has taken some minutes before completely start with docker. In the end works also the docker compose. Great!!!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works both docker and locally
| IO_ONBOARDING_PA_API_HOST | The hostname of the APIs url | string | | ||
| IO_ONBOARDING_PA_API_PORT | The port for of APIs url | string | | ||
| IO_ONBOARDING_PA_SHOW_FAKE_IDP | Show or hide fake IDP button in SPID dropdown button (0 to hide, 1 to show) | string | | ||
| IO_ONBOARDING_PA_IS_MOCK_ENV | Front end is running with mock backend or with real APIs (0 for real APIs, 1 for mock backend) | string | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing env variable IO_ONBOARDING_PA_SESSION_TOKEN_DOMAIN that defines session token domain used to delete token when logging out
README.md
Outdated
$ yarn install | ||
``` | ||
To read the variable values inside the frontend application, use | ||
`window._env_.IO_ONBOARDING_PA_YOUR_VAR`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env variables can also be read with getConfig
method in config.ts class
env.example
Outdated
@@ -5,3 +5,6 @@ IO_ONBOARDING_PA_API_HOST=http://localhost | |||
IO_ONBOARDING_PA_API_PORT=3000 | |||
IO_ONBOARDING_PA_SHOW_FAKE_IDP=1 | |||
IO_ONBOARDING_PA_IS_MOCK_ENV=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 1 in mocked backend
This PR lets you run the frontend application seamlessy with or without docker with hot module reloading enabled in both cases.