Skip to content

Commit 3ad4026

Browse files
authored
Merge pull request #107 from sdkman/refactoring
Refactoring
2 parents 712533a + e132778 commit 3ad4026

File tree

79 files changed

+409
-362
lines changed

Some content is hidden

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

79 files changed

+409
-362
lines changed

.prettierrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{
22
"singleQuote": true,
3-
"proseWrap": "always"
3+
"proseWrap": "always",
4+
"plugins": ["@trivago/prettier-plugin-sort-imports"],
5+
"importOrder": [
6+
"^@site/src/types/(.*)$",
7+
"^react(/[^\\/]+)?$",
8+
"<THIRD_PARTY_MODULES>",
9+
"^@site/src/components/(.*)$",
10+
"^@site/src/hooks/(.*)$",
11+
"^@site/src/lib/(.*)$",
12+
"^@site/src/data/(.*)$",
13+
"^@site/src/(.*)$",
14+
"^[./]"
15+
],
16+
"importOrderSeparation": true,
17+
"importOrderSortSpecifiers": true
418
}

docs/install.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Installation
33
---
44

5-
import DocsCarbonAds from '@site/src/components/sections/DocsCarbonAds';
5+
import DocsCarbonAds from '@site/src/components/ads/DocsCarbonAds';
66

77
<DocsCarbonAds />
88

@@ -107,17 +107,19 @@ curl -s "https://get.sdkman.io?rcupdate=false" | bash
107107

108108
## CI Mode
109109

110-
For automated environments like CI/CD pipelines, SDKMAN! offers a dedicated CI mode
111-
that optimizes the installation for non-interactive use:
110+
For automated environments like CI/CD pipelines, SDKMAN! offers a dedicated CI
111+
mode that optimizes the installation for non-interactive use:
112112

113113
```shell
114114
curl -s "https://get.sdkman.io?ci=true" | bash
115115
```
116116

117117
CI mode automatically:
118+
118119
- Answers all prompts (sets `sdkman_auto_answer=true`)
119120
- Disables colored output for cleaner logs (sets `sdkman_colour_enable=false`)
120-
- Turns off the self-update feature to prevent unexpected updates (sets `sdkman_selfupdate_feature=false`)
121+
- Turns off the self-update feature to prevent unexpected updates (sets
122+
`sdkman_selfupdate_feature=false`)
121123

122124
You can combine this with other parameters as needed:
123125

docs/usage.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Usage
33
---
44

5-
import DocsCarbonAds from '@site/src/components/sections/DocsCarbonAds';
5+
import DocsCarbonAds from '@site/src/components/ads/DocsCarbonAds';
66

77
<DocsCarbonAds />
88

@@ -305,7 +305,7 @@ native: 0.1.3
305305
## Offline Mode
306306
307307
Initially called _Aeroplane Mode_, this allows SDKMAN! to function when working
308-
offline. It has a parameter that can be passed to *enable* or _disable_ the
308+
offline. It has a parameter that can be passed to _enable_ or _disable_ the
309309
offline mode.
310310
311311
```shell

docs/vendors.mdx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Vendors
33
---
44

5-
import DocsCarbonAds from '@site/src/components/sections/DocsCarbonAds';
5+
import DocsCarbonAds from '@site/src/components/ads/DocsCarbonAds';
66

77
<DocsCarbonAds />
88

@@ -130,11 +130,14 @@ https://vendors.sdkman.io/default
130130

131131
## GitHub Actions
132132

133-
If you're using GitHub Actions for your CI/CD pipeline, SDKMAN! provides official GitHub Actions that can help you automate the release process.
133+
If you're using GitHub Actions for your CI/CD pipeline, SDKMAN! provides
134+
official GitHub Actions that can help you automate the release process.
134135

135136
### SDKMAN! Release Action
136137

137-
The [SDKMAN! Release Action](https://github.com/sdkman/sdkman-release-action) allows you to release a new version of your candidate to SDKMAN! directly from your GitHub workflow.
138+
The [SDKMAN! Release Action](https://github.com/sdkman/sdkman-release-action)
139+
allows you to release a new version of your candidate to SDKMAN! directly from
140+
your GitHub workflow.
138141

139142
#### Features
140143

@@ -163,7 +166,10 @@ jobs:
163166
consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }}
164167
candidate: myCandidateName
165168
version: ${{ github.event.release.tag_name }}
166-
url: https://github.com/myorg/myrepo/releases/download/${{ github.event.release.tag_name }}/mycandidatename-${{ github.event.release.tag_name }}.zip
169+
url:
170+
https://github.com/myorg/myrepo/releases/download/${{
171+
github.event.release.tag_name }}/mycandidatename-${{
172+
github.event.release.tag_name }}.zip
167173
```
168174
169175
#### Advanced Usage
@@ -191,10 +197,12 @@ jobs:
191197
consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }}
192198
candidate: java
193199
version: ${{ github.event.inputs.version }}
194-
url: https://github.com/acme/java/releases/download/${{ github.event.inputs.version }}/java-linux-x64.tar.gz
200+
url:
201+
https://github.com/acme/java/releases/download/${{
202+
github.event.inputs.version }}/java-linux-x64.tar.gz
195203
platform: LINUX_64
196-
checksum-md5: "abcd1234..."
197-
checksum-sha-512: "efgh5678..."
204+
checksum-md5: 'abcd1234...'
205+
checksum-sha-512: 'efgh5678...'
198206
```
199207
200208
## Gradle SDK Vendor Plugin

package-lock.json

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@docusaurus/module-type-aliases": "^3.8.1",
3737
"@docusaurus/tsconfig": "^3.8.1",
3838
"@docusaurus/types": "^3.8.1",
39+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
3940
"prettier": "^3.6.0",
4041
"typescript": "~5.8.3"
4142
},

src/components/CarbonAds/index.tsx renamed to src/components/ads/CarbonAds/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { useEffect, useRef } from 'react';
1+
import * as React from 'react';
22

33
type Props = { code: string; placement: string };
44

55
export default function CarbonAds({ code, placement }: Props) {
6-
const ref = useRef<HTMLDivElement>(null);
6+
const ref = React.useRef<HTMLDivElement>(null);
77

8-
useEffect(() => {
8+
React.useEffect(() => {
99
if (ref.current) {
1010
ref.current.innerHTML = '';
1111
const s = document.createElement('script');

src/components/sections/DocsCarbonAds/index.tsx renamed to src/components/ads/DocsCarbonAds/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import CarbonAds from '@site/src/components/CarbonAds';
1+
import CarbonAds from '@site/src/components/ads/CarbonAds';
2+
23
import { CARBON_ADS_CODE, CARBON_ADS_PLACEMENT } from '@site/src/constants';
34

45
export default function DocsCarbonAds() {

src/components/sections/PageCarbonAds/index.tsx renamed to src/components/ads/PageCarbonAds/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import CarbonAds from '@site/src/components/CarbonAds';
2-
import styles from './styles.module.scss';
1+
import CarbonAds from '@site/src/components/ads/CarbonAds';
32

43
import { CARBON_ADS_CODE, CARBON_ADS_PLACEMENT } from '@site/src/constants';
54

5+
import styles from './styles.module.scss';
6+
67
export default function PageCarbonAds() {
78
return (
89
<section className={styles.section}>

0 commit comments

Comments
 (0)