Skip to content

Commit 7c8a228

Browse files
Merge pull request #1 from linked-planet/dev
Dev
2 parents 02cb68a + b747e83 commit 7c8a228

File tree

115 files changed

+18337
-9126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+18337
-9126
lines changed

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2022,
5+
"sourceType": "module",
6+
"ecmaFeatures": {
7+
"jsx": true
8+
}
9+
},
10+
"plugins": [
11+
"@typescript-eslint",
12+
"react",
13+
"react-hooks",
14+
"react-refresh",
15+
"@atlaskit/eslint-plugin-design-system",
16+
"formatjs"
17+
],
18+
"extends": [
19+
"eslint:recommended",
20+
"plugin:@typescript-eslint/recommended",
21+
"plugin:@atlaskit/design-system/recommended",
22+
"plugin:react/recommended",
23+
"plugin:react-hooks/recommended",
24+
"prettier"
25+
],
26+
"settings": {
27+
"react": {
28+
"version": "detect"
29+
}
30+
},
31+
"rules": {
32+
"react-hooks/rules-of-hooks": "error",
33+
"react-hooks/exhaustive-deps": "warn",
34+
"react-refresh/only-export-components": "warn",
35+
"@atlaskit/design-system/ensure-design-token-usage": "off"
36+
}
37+
}

.github/workflows/default.yml

Lines changed: 52 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,67 @@
11
name: ui-kit-ts - default
22

33
on:
4-
push:
5-
branches:
6-
- "main"
7-
release:
8-
types: [ created ]
9-
schedule:
10-
- cron: '0 6 * * 1' # At 06:00 on Monday
4+
push:
5+
branches:
6+
- "main"
7+
release:
8+
types: [created]
9+
schedule:
10+
- cron: "0 6 * * 1" # At 06:00 on Monday
1111

1212
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v3
18-
with:
19-
node-version: '19.1.0'
20-
- name: npm install library
21-
working-directory: ./library
22-
run: npm install
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: "19.1.0"
20+
- name: npm install
21+
run: npm install
2322

24-
- name: npm build library
25-
working-directory: ./library
26-
run: npm run build
23+
- name: npm build library
24+
run: npm run build:lib
2725

28-
- name: npm install showcase
29-
working-directory: ./showcase
30-
run: npm install
26+
- name: npm build showcase
27+
run: npm run build:sc
3128

32-
- name: npm build showcase
33-
working-directory: ./showcase
34-
run: npm run build
29+
- name: deploy Showcase to Github Pages
30+
if: ${{ github.event_name == 'release' }}
31+
uses: JamesIves/[email protected]
32+
with:
33+
branch: docs
34+
folder: dist-showcase
35+
single-commit: true
3536

36-
- name: deploy Showcase to Github Pages
37+
publish:
38+
needs: build
3739
if: ${{ github.event_name == 'release' }}
38-
uses: JamesIves/[email protected]
39-
with:
40-
branch: docs
41-
folder: showcase/build
42-
single-commit: true
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: actions/setup-node@v3
44+
with:
45+
node-version: "19.1.0"
46+
registry-url: "https://registry.npmjs.org"
4347

44-
publish:
45-
needs: build
46-
if: ${{ github.event_name == 'release' }}
47-
runs-on: ubuntu-latest
48-
defaults:
49-
run:
50-
working-directory: 'library'
51-
steps:
52-
- uses: actions/checkout@v3
53-
- uses: actions/setup-node@v3
54-
with:
55-
node-version: '19.1.0'
56-
registry-url: 'https://registry.npmjs.org'
48+
- name: Get release version
49+
id: release
50+
run: |
51+
FULL_VERSION=${{ github.event.release.tag_name }}
52+
SHORT_VERSION=${FULL_VERSION:1}
53+
echo shortVersion=${SHORT_VERSION} >> $GITHUB_OUTPUT
5754
58-
- name: Get release version
59-
id: release
60-
run: |
61-
FULL_VERSION=${{ github.event.release.tag_name }}
62-
SHORT_VERSION=${FULL_VERSION:1}
63-
echo shortVersion=${SHORT_VERSION} >> $GITHUB_OUTPUT
55+
- name: Update release version
56+
run: npm version ${{ steps.release.outputs.shortVersion }}
6457

65-
- name: Update release version
66-
working-directory: ./library
67-
run: npm version ${{ steps.release.outputs.shortVersion }}
58+
- name: Install dependencies
59+
run: npm install
6860

69-
- name: Install dependencies
70-
working-directory: ./library
71-
run: npm install
61+
- name: Build release
62+
run: npm run build:lib
7263

73-
- name: Build release
74-
working-directory: ./library
75-
run: npm run build
76-
77-
- name: Publish to npmjs
78-
working-directory: ./library
79-
run: npm publish --access public
80-
env:
81-
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
64+
- name: Publish to npmjs
65+
run: npm publish --access public
66+
env:
67+
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
4+
35
# dependencies
46
/showcase/package-lock.json
57
*/build
68
*/dist
9+
/dist-showcase
710
*/node_modules
811
/.pnp
912
.pnp.js
@@ -24,3 +27,5 @@
2427
npm-debug.log*
2528
yarn-debug.log*
2629
yarn-error.log*
30+
node_modules
31+
dist

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": true,
4+
"semi": false,
5+
"singleQuote": false
6+
}

.stylelintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": ["stylelint-config-standard"],
3+
"plugins": ["stylelint-order"],
4+
"rules": {
5+
"custom-property-empty-line-before": null,
6+
"selector-class-pattern": null,
7+
"comment-empty-line-before": null,
8+
"comment-whitespace-inside": "always"
9+
},
10+
"ignoreFiles": "dist/**/*"
11+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"docwriter.style": "JSDoc"
4+
}

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,31 @@ UI-Kit-ts provides several typescript ui components and functionality used throu
55
Checkout the online demo of the [showcase](https://linked-planet.github.io/ui-kit-ts/).
66

77
## Structure
8-
- `library`: library containing all components and functionality
9-
- `showcase`: showcase which demonstrates all components and their usage
8+
9+
- `library`: library containing all components and functionality
10+
- `showcase`: showcase which demonstrates all components and their usage
1011

1112
## Usage
1213

13-
Run the following command in `showcase` directory to start the showcase app and open it in your browser:
14-
```npm run start```
14+
Run the following command to start the showcase app and open it in your browser:
15+
`npm run dev:sc`
16+
17+
To build the library use:
18+
`npm run build:lib`
19+
20+
And the showcase:
21+
`npm run build:sc`
22+
23+
### Localization
24+
25+
ui-kit-ts offers integration of FormatJS to support localization, although no component is tight to it.
26+
Use the LocaleProvider in the locale context to automatically fetch translations of defined messages.
27+
With `npm run messages:extract` defined messages in FormatJS Message components are extracted into the library/localization/translations directory as Json. Create the translated Json using the locale identifier as file name (i.g. extracted is a 'en.json', so we create a 'de.json'). Compilation of the translated messages happens automatically during the build.
28+
29+
When using the LocaleProvider, it will try to download the compiled translations for a set locale from the public/translations-compiled directory. If none is available, it will default back to the default messages.
30+
31+
### Theming
32+
33+
ui-kit-ts supports the Atlassian design system, which is basically a mapping of tokens to css variables. If the used component does not seem to have the proper styling, use the 'initTheming()' function in the theming directory, which sets the themeing attribute in the HTML tag.
1534

16-
make sure to reload all dependency with:
17-
```npm run reload```
35+
Do not forget to add the '@linked-planet/ui-kit-ts/style.css' someplace in your project.

custom.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
declare module "*.module.css" {
2+
const classes: { [key: string]: string };
3+
export default classes;
4+
}
5+
6+
declare module "*.module.scss" {
7+
const classes: { [key: string]: string };
8+
export default classes;
9+
}
10+
11+
declare module "*.module.sass" {
12+
const classes: { [key: string]: string };
13+
export default classes;
14+
}
15+
16+
declare module "*.module.less" {
17+
const classes: { [key: string]: string };
18+
export default classes;
19+
}
20+
21+
declare module "*.module.styl" {
22+
const classes: { [key: string]: string };
23+
export default classes;
24+
}

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/ico" href="images/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>UI-KIT-TS Showcase</title>
8+
</head>
9+
<body>
10+
<script type="module" src="./showcase/src/index.tsx"></script>
11+
<div id="root"></div>
12+
</body>
13+
</html>

library/.eslintrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)