mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 19:52:53 +00:00
feat: copy .editorconfig during installation
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
|
|
||||||
# editorconfig.org
|
# editorconfig.org
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
@@ -7,11 +6,10 @@ root = true
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
# We recommend you to keep these unchanged
|
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
@@ -7,5 +7,6 @@
|
|||||||
!package.json
|
!package.json
|
||||||
!package-lock.json
|
!package-lock.json
|
||||||
!README.md
|
!README.md
|
||||||
|
!scripts
|
||||||
!tsconfig.json
|
!tsconfig.json
|
||||||
!tslint.json
|
!tslint.json
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ A collection of configuration base files for StApps projects.
|
|||||||
npm install --save-dev @openstapps/configuration
|
npm install --save-dev @openstapps/configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `.editorconfig`
|
||||||
|
|
||||||
|
This file is automatically copied to your project's root directory upon installation of this package. It tells your editor/IDE about basic settings for indentation and formatting.
|
||||||
|
|
||||||
## `tsconfig.json`
|
## `tsconfig.json`
|
||||||
|
|
||||||
Create a `tsconfig.json` with the following content:
|
Create a `tsconfig.json` with the following content:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "A collection of configuration base files for StApps projects.",
|
"description": "A collection of configuration base files for StApps projects.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||||
|
"install": "./scripts/postinstall.sh",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
9
scripts/postinstall.sh
Executable file
9
scripts/postinstall.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
if [[ ! -d "$INIT_CWD/node_modules/@openstapps/configuration/" ]]; then
|
||||||
|
exit;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
echo "Copying .editorconfig from @openstapps/configuration to this project."
|
||||||
|
|
||||||
|
cp "$INIT_CWD/node_modules/@openstapps/configuration/.editorconfig" "$INIT_CWD/.editorconfig"
|
||||||
Reference in New Issue
Block a user