Skip to content

Commit f5a857d

Browse files
Prettier and namespace updates (#3)
* Updated namespace (remobed lab49) and added prettier * fixed prettier issues in unstaged file * fixed special character issue on publush.yml * fixed special character, other side * Squashed commit of the following: commit 8994a32 Author: Troy Prince <troy.prince@lab49.com> Date: Thu Jun 10 14:42:08 2021 -0400 Added full fetch depth commit c02922e Author: Troy Prince <troy.prince@lab49.com> Date: Thu Jun 10 14:35:31 2021 -0400 added headless chrome launcher for ci/cd commit 666aafb Author: Troy Prince <troy.prince@lab49.com> Date: Thu Jun 10 14:00:59 2021 -0400 all in one job commit e23642c Author: Troy Prince <troy.prince@lab49.com> Date: Thu Jun 10 13:28:15 2021 -0400 merged to one job commit 7049b93 Author: Troy Prince <troy.prince@lab49.com> Date: Thu Jun 10 13:26:32 2021 -0400 added chromatic action in separate file * removed documentation.json from git tracking * Created the 'Make it Nice' story for storybook, updated the component classes accordingly, and config for loading a global style to storybook * moved and renamed make-it-nice styles file
1 parent e7bfdca commit f5a857d

26 files changed

Lines changed: 848 additions & 815 deletions

.eslintrc.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"extends": [
1616
"plugin:@angular-eslint/ng-cli-compat",
1717
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
18-
"plugin:@angular-eslint/template/process-inline-templates"
18+
"plugin:@angular-eslint/template/process-inline-templates",
19+
"plugin:prettier/recommended",
20+
"prettier"
1921
],
2022
"rules": {
2123
"dot-notation": "error",
@@ -25,6 +27,7 @@
2527
"no-empty-function": "off",
2628
"no-shadow": "error",
2729
"no-unused-expressions": "error",
30+
"no-unused-vars": "error",
2831
"no-use-before-define": "off",
2932
"semi": "error"
3033
}
@@ -39,6 +42,14 @@
3942
"rules": {
4043
"eqeqeq": "error"
4144
}
45+
},
46+
{
47+
"files": ["*.html"],
48+
"excludedFiles": ["*inline-template-*.component.html"],
49+
"extends": ["plugin:prettier/recommended"],
50+
"rules": {
51+
"prettier/prettier": ["error", { "parser": "angular" }]
52+
}
4253
}
4354
]
4455
}

.github/actions/chromatic.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# .github/actions/chromatic.yml
2+
3+
name: 'Chromatic'
4+
descriptions: 'Deploys storybook to Chromatic'
5+
6+
runs:
7+
using: "composite":
8+
steps:
9+
uses: chromaui/action@v1
10+
with:
11+
token: ${{ secrets.GITHUB_TOKEN }}
12+
projectToken: "02c78aa7d86f"
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
name: Angular Value Flash CI/CD
22
on: [push]
33
jobs:
4-
lint:
4+
on-push-actions:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- run: npm install
9-
- run: npm run lint
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
with:
10+
fetch-depth: 0 # Required to retrieve git history for Chromatic
11+
- name: Install dependencies
12+
run: npm install
13+
- name: Lint
14+
run: npm run lint
15+
- name: Test
16+
run: npm run test:headless
17+
- name: Chromatic
18+
uses: chromaui/action@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
projectToken: "02c78aa7d86f"

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- run: npm run build:prod
1717
- run: npm run publish:lib
1818
env:
19-
NODE_AUTH_TOKEN: ${​​​​​​​​​​​​​{​​​​​​​​​​​​​ secrets.NPM_AUTOMATION_TOKEN }​​​​​​​​​​​​​}​​​​​​​​​​​​​
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ testem.log
4646
Thumbs.db
4747

4848
# Storybook
49-
build-storybook.log
49+
build-storybook.log
50+
documentation.json

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"endOfLine": "auto"
8+
}
9+

.storybook/main.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const path = require('path');
2+
13
module.exports = {
24
"stories": [
35
"../stories/**/*.stories.mdx",
@@ -6,5 +8,14 @@ module.exports = {
68
"addons": [
79
"@storybook/addon-links",
810
"@storybook/addon-essentials"
9-
]
10-
}
11+
],
12+
webpackFinal: async (config, { configType }) => {
13+
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
14+
config.module.rules.push({
15+
test: /\.scss$/,
16+
use: ['style-loader', 'css-loader', 'sass-loader'],
17+
include: path.resolve(__dirname, '../stories/styles/'),
18+
});
19+
return config;
20+
},
21+
}

.storybook/preview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
import '!style-loader!css-loader!sass-loader!../stories/styles/make-it-nice-theme.scss';
22
import { setCompodocJson } from "@storybook/addon-docs/angular";
33
import docJson from "../documentation.json";
44
setCompodocJson(docJson);
@@ -12,4 +12,4 @@ export const parameters = {
1212
date: /Date$/,
1313
},
1414
},
15-
}
15+
}

0 commit comments

Comments
 (0)