Skip to content

Commit

Permalink
Merge branch 'main' into lorissigrist/parjs-156-show-good-and-bad-exa…
Browse files Browse the repository at this point in the history
…mple-for-server-side-usage-in-docs
  • Loading branch information
LorisSigrist committed Jun 17, 2024
2 parents 410f890 + ce025a5 commit 2842d93
Show file tree
Hide file tree
Showing 69 changed files with 422 additions and 198 deletions.
7 changes: 7 additions & 0 deletions inlang/source-code/badge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9

## 0.7.35

### Patch Changes

- Updated dependencies [da7c207]
- @inlang/sdk@0.35.8

Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/badge/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inlang/badge",
"type": "module",
"version": "0.7.35",
"type": "module",
"private": true,
"exports": {
".": "./dist/index.js",
Expand Down
7 changes: 7 additions & 0 deletions inlang/source-code/cross-sell/cross-sell-ninja/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @inlang/cross-sell-ninja

## 0.0.31

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9

## 0.0.30

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inlang/cross-sell-ninja",
"description": "A package to cross-sell Ninja",
"version": "0.0.30",
"version": "0.0.31",
"type": "module",
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions inlang/source-code/doc-layout-component/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @inlang/settings-component

## 0.0.19

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9

## 0.0.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/doc-layout-component/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inlang/doc-layout-component",
"type": "module",
"version": "0.0.18",
"version": "0.0.19",
"publishConfig": {
"access": "public"
},
Expand Down
18 changes: 18 additions & 0 deletions inlang/source-code/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @inlang/editor

## 0.1.2

### Patch Changes

- @inlang/settings-component@1.0.26

## 0.1.1

### Patch Changes

- b776572: update example repos

## 0.1.0

### Minor Changes

- c3211c6: init versioning

## null

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions inlang/source-code/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@inlang/editor",
"version": "0.1.2",
"type": "module",
"private": true,
"scripts": {
Expand Down Expand Up @@ -106,6 +107,5 @@
"peerDependencies": {
"express": "^4.18.2"
},
"license": "Apache-2.0",
"version": null
"license": "Apache-2.0"
}
9 changes: 6 additions & 3 deletions inlang/source-code/editor/scripts/updateVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function updateVersionFile() {
if (!pnpmOutput) return

const packages = JSON.parse(pnpmOutput)
const editorVersion = packages.find((pkg) => pkg.name === "@inlang/editor").version
const inlangVersion = packages.find((pkg) => pkg.name === "@inlang/sdk").version
const lixVersion = packages.find((pkg) => pkg.name === "@lix-js/client").version
// if working directory is not clean set commit hash to "dev"
Expand All @@ -31,19 +32,21 @@ function updateVersionFile() {
fs.writeFileSync(
versionFilePath,
`{
"@inlang/editor": "",
"commit-hash": "",
"@inlang/sdk": "",
"@lix-js/client": "",
"commit-hash": ""
"@lix-js/client": ""
}
`
)
}
const versionFile = JSON.parse(fs.readFileSync(versionFilePath))

// Update version.json file
versionFile["@inlang/editor"] = editorVersion
versionFile["commit-hash"] = commitHash
versionFile["@inlang/sdk"] = inlangVersion
versionFile["@lix-js/client"] = lixVersion
versionFile["commit-hash"] = commitHash

// Write the updated version.json
fs.writeFileSync(versionFilePath, JSON.stringify(versionFile, undefined, 2))
Expand Down
9 changes: 6 additions & 3 deletions inlang/source-code/editor/src/interface/editor/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ const Footer = () => {
<div class="flex items-center justify-end w-24">
<sl-dropdown prop:distance={8}>
<button slot="trigger" class="text-sm text-surface-500">
{version["commit-hash"].slice(0, 7)}
v{version["@inlang/editor"]}
</button>
<sl-menu class="flex flex-col px-4 py-3 text-sm w-60">
<span class="font-medium mb-2">Deployed version</span>
<div class="flex justify-between font-medium mb-2">
<span>Deployed version:</span>
<span>{version["@inlang/editor"]}</span>
</div>
<div class="flex justify-between">
<span>Commit hash: {""}</span>
<span>Commit hash:</span>
<a
href={`https://github.com/opral/monorepo/commit/${version["commit-hash"]}`}
target="_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ function LintFilter(props: { clearFunction: any }) {
</Show>
</div>
<button slot="clear-icon" class="p-0.5">
<IconClose class="w-4 h-4" />
<IconClose width={20} height={20} />
</button>

<div class="flex px-3 gap-2 text-sm font-medium">
Expand Down Expand Up @@ -838,7 +838,7 @@ function IdsFilter(props: { clearFunction: any }) {
props.clearFunction
}}
>
<IconClose />
<IconClose width={20} height={20} />
</button>
</Show>
</div>
Expand Down
5 changes: 5 additions & 0 deletions inlang/source-code/editor/src/pages/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* list and add your repository below.
*/
export const repositories: Repositories = [
{
owner: "LorisSigrist",
repository: "merge-berlin-lix-demo",
description: "Experience lix in your browser",
},
{
owner: "opral",
repository: "example",
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/editor/src/renderer/+onRenderHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default async function onRenderHtml(pageContext: PageContextRenderer): Pr
<meta name="description" content="${dangerouslySkipEscape(metaInfo.description)}" />
<meta name="og:image" content="/images/fink-social-image.jpg" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<!-- theme-color means the background color of the iOS status bar -->
<meta name="theme-color" content="#000000" />
<!-- START import inter font -->
Expand Down
8 changes: 8 additions & 0 deletions inlang/source-code/end-to-end-tests/paraglide-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @inlang/paraglide-js-e2e

## 0.0.35

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9
- @inlang/paraglide-js@1.9.1

## 0.0.34

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inlang/paraglide-js-e2e",
"version": "0.0.34",
"version": "0.0.35",
"private": true,
"type": "module",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @inlang/paraglide-next-e2e

## 0.0.19

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9
- @inlang/paraglide-next@0.4.1

## 0.0.18

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inlang/paraglide-next-e2e",
"version": "0.0.18",
"version": "0.0.19",
"private": true,
"type": "module",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions inlang/source-code/github-lint-action/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @inlang/github-lint-action

## 0.3.13

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9

## 0.3.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/github-lint-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inlang/github-lint-action",
"description": "This action checks for translation issues within your PRs.",
"version": "0.3.12",
"version": "0.3.13",
"private": true,
"publishConfig": {
"access": "public"
Expand Down
10 changes: 10 additions & 0 deletions inlang/source-code/ide-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# inlang-vs-code-extension

## 1.44.15

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9
- @inlang/rpc@0.3.31
- @inlang/settings-component@1.0.26
- @inlang/telemetry@0.3.46

## 1.44.14

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/opral/monorepo.git"
},
"icon": "assets/sherlock-logo.png",
"version": "1.44.14",
"version": "1.44.15",
"engines": {
"vscode": "^1.84.2"
},
Expand Down
7 changes: 7 additions & 0 deletions inlang/source-code/message-bundle-component/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @inlang/message-bundle-component

## 0.1.17

### Patch Changes

- Updated dependencies [8e9fc0f]
- @inlang/sdk@0.35.9

## 0.1.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/message-bundle-component/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inlang/message-bundle-component",
"type": "module",
"version": "0.1.16",
"version": "0.1.17",
"publishConfig": {
"access": "public"
},
Expand Down
6 changes: 6 additions & 0 deletions inlang/source-code/paraglide/paraglide-astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @inlang/paraglide-astro

## 0.1.28

### Patch Changes

- @inlang/paraglide-vite@1.2.68

## 0.1.27

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/paraglide/paraglide-astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inlang/paraglide-astro",
"version": "0.1.27",
"version": "0.1.28",
"author": "inlang <hello@inlang.com> (https://inlang.com/)",
"description": "A fully type-safe i18n library specifically designed for partial hydration patterns like Astro's islands.",
"homepage": "https://inlang.com/m/iljlwzfs/paraglide-astro-i18n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,13 @@ export function detectLanguageFromPath<T extends string>({
}): T | undefined {
base ??= ""
if (base === "/") base = ""

if (!path.startsWith(base)) {
return undefined
}

if (!path.startsWith(base)) return undefined
const pathWithoutBase = path.replace(base, "")

const maybeLang = pathWithoutBase.split("/")[1]
if (!maybeLang) return undefined

for (const lang of availableLanguageTags) {
if (lang.toLowerCase() === maybeLang.toLowerCase()) {
return lang
}
}
return undefined
return availableLanguageTags.map(lower).includes(lower(maybeLang)) ? (maybeLang as T) : undefined
}

const lower = (s: string) => s.toLowerCase()
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import { exec, parseRouteDefinition, bestMatch } from "./routeDefinitions.js"
// we're testing known-good vendored in code here, but the test are still helpful to understand the logic

describe("parse_route_id", () => {
it("should parse a route id", () => {
expect(parseRouteDefinition("/foo/bar")).toEqual({
it("should parse a static route id", () => {
const parsed = parseRouteDefinition("/foo/bar")
expect(parsed).toEqual({
params: [],
pattern: /^\/foo\/bar\/?$/,
})

expect(parsed.pattern.exec("/foo/bar")).toBeTruthy()
expect(parsed.pattern.exec("/not/match")).toBeFalsy()
})
it("should parse a route id", () => {
expect(parseRouteDefinition("/[lang]/test")).toEqual({
params: [
{
Expand Down
Loading

0 comments on commit 2842d93

Please sign in to comment.