Skip to content

Commit

Permalink
Merge pull request #1324 from recurser/release-candidate-2024-01-03-1…
Browse files Browse the repository at this point in the history
…0-58

Release Candidate 2024-01-03-10-58
  • Loading branch information
recurser authored Jan 3, 2024
2 parents 846368a + 59f93d3 commit b65ffa0
Show file tree
Hide file tree
Showing 51 changed files with 909 additions and 1,073 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v4"
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
create_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# We 'parameterize' the PR title by converting it to lowercase and replacing spaces with hyphens, and use it as the branch name.
- name: Generate the branch name
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: main

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v4"
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
jest:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v4"
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
Expand Down
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"test": "yarn eslint src pages && yarn jest"
},
"dependencies": {
"@compiled/react": "^0.16.2",
"@compiled/react": "^0.16.8",
"@iarna/toml": "^2.2.5",
"bluebird": "^3.7.2",
"chrono-node": "^2.7.0",
"chrono-node": "^2.7.4",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.10",
"diff": "^5.1.0",
Expand All @@ -37,38 +37,38 @@
"next-translate": "^2.0.6",
"next-translate-plugin": "^2.0.5",
"papaparse": "^5.4.1",
"prettier": "^2.8.8",
"prettier": "^3.1.1",
"prismjs": "^1.29.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-responsive": "^9.0.2",
"showdown": "^2.1.0",
"sql-formatter": "^15.0.2",
"terser": "^5.24.0",
"terser": "^5.26.0",
"uuid": "^9.0.1"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^18.1.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@compiled/webpack-loader": "^0.12.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^12.1.5",
"@types/bluebird": "^3.5.42",
"@types/crypto-js": "^4.2.0",
"@types/crypto-js": "^4.2.1",
"@types/diff": "^5.0.9",
"@types/hjson": "^2.4.5",
"@types/hjson": "^2.4.6",
"@types/iarna__toml": "^2.0.5",
"@types/js-yaml": "^4.0.8",
"@types/js-yaml": "^4.0.9",
"@types/json2csv": "^5.0.7",
"@types/jsonwebtoken": "^9.0.5",
"@types/lodash": "^4.14.200",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.6",
"@types/papaparse": "^5.3.10",
"@types/papaparse": "^5.3.14",
"@types/prismjs": "^1.26.3",
"@types/react": "18.0.9",
"@types/showdown": "^2.0.6",
Expand All @@ -81,17 +81,19 @@
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "^14.0.4",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-tsdoc": "^0.2.17",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.6.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react-test-renderer": "^17.0.2",
"semantic-release": "^22.0.12",
"typescript": "5.2.2"
"typescript": "5.3.3"
}
}
8 changes: 4 additions & 4 deletions src/components/domain/convert/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { useMemo, useState } from 'react'
import { isEmpty } from 'lodash'
import useTranslation from 'next-translate/useTranslation'

import { BaseUrl } from '@lib/utilities/Constants'
import { copyToClipboard } from '@lib/utilities/Clipboard'
import { hyphenateConverterId } from '@lib/utilities/String'
import { useConverterContext } from '@contexts/ConverterContext'
import { useConverterOptionsContext } from '@contexts/ConverterOptionsContext'

Expand All @@ -31,10 +29,12 @@ export const ShareButton = () => {

const onClick = async () => {
if (!isEmpty(inputString) && !copied) {
const converterSlug = hyphenateConverterId(converter.id)
const encodedInput = encodeURI(inputString)
const encodedOptions = encode(JSON.stringify(options))
const url = `${BaseUrl}/${converterSlug}?i=${encodedInput}&o=${encodedOptions}`
const url = `${window.location.href.replace(
/[#\?].*$/,
'',
)}?i=${encodedInput}&o=${encodedOptions}`
await copyToClipboard(url)
setCopied(true)
setTimeout(() => setCopied(false), 1000)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/CssFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'css'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return cssOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/CsvToXmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const obj = csvInput(input)
if (!obj) {
return ''
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/HtmlFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return htmlOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/JavaScriptFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'javaScript'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return javaScriptOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/JsonToJavaScriptConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const outputId = 'javaScript'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const obj = jsonInput(input)
if (!obj) {
return ''
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/JsonToXmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const obj = jsonInput(input)
if (!obj) {
return ''
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/LessFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'css'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return lessOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/MarkdownFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'markdown'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return markdownOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/MarkdownToHtmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const converter = new Converter({ noHeaderId: true, strikethrough: true })
const html = converter.makeHtml(input)

Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/ScssFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'css'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return cssOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/TomlToXmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const obj = tomlInput(input)
if (!obj) {
return ''
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converters/XmlFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
return htmlOutput(input, options)
}
4 changes: 2 additions & 2 deletions src/lib/converters/YamlToXmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const outputId = 'html'
*
* @returns the converted string.
*/
export const operation = (
export const operation = async (
input: string,
options: ConverterOptions = {},
): string => {
): Promise<string> => {
const obj = yamlInput(input)
if (!obj) {
return ''
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converters/__tests__/HtmlFormatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('converters', () => {
await expectError(
HtmlFormatter,
'<paragraph',
'Unexpected character "EOF" (1:11)> 1 |',
'Opening tag "paragraph" not terminated. (1:1)> 1 |',
)
})
})
Expand Down
6 changes: 3 additions & 3 deletions src/lib/converters/__tests__/TimestampConverter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ describe('converters', () => {
it('converts the input to local time', async () => {
await expectOutput(
TimestampConverter,
'1234567890',
'1234524690',
'datetime-local-output',
'2009-02-13 23:31',
'2009-02-13 11:31',
)
})

Expand All @@ -24,7 +24,7 @@ describe('converters', () => {
it('handles human-readable times', async () => {
await expectOutput(
TimestampConverter,
'January 2020',
'January 1st 2020',
'datetime-local-output',
'2020-01-01 12:00',
)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converters/__tests__/XmlFormatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('converters', () => {
await expectError(
XmlFormatter,
'<note',
'Unexpected character "EOF" (1:6)> 1 |',
'Opening tag "note" not terminated. (1:1)> 1 |',
)
})
})
Expand Down
Loading

1 comment on commit b65ffa0

@vercel
Copy link

@vercel vercel bot commented on b65ffa0 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

string-is – ./

string-is-recurser.vercel.app
string.is
www.string.is
string-is-git-main-recurser.vercel.app

Please sign in to comment.