Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor recommendation packages #2910

Merged
merged 69 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b24d360
chore: Update marketplace badge in MARKETPLACE.md
felixhaeberle Jun 10, 2024
135bb06
small README adjustment
felixhaeberle Jun 10, 2024
62ef702
chore: Ignore SVG warning and update Inlang-ecosystem compatibility b…
felixhaeberle Jun 10, 2024
96e4d78
chore: Update README.md to remove SVG warning and update Inlang-ecosy…
felixhaeberle Jun 10, 2024
88d6db7
chore: Update project.ts to use Sherlock for workspace recommendation
felixhaeberle Jun 10, 2024
f693ebc
chore: Update project.ts to use Sherlock for workspace recommendation
felixhaeberle Jun 10, 2024
3bbcb20
chore: Update recommendation.ts to use Sherlock for workspace recomme…
felixhaeberle Jun 10, 2024
ab742bf
chore: Add cross-sell packages to package.json
felixhaeberle Jun 10, 2024
d41ae92
chore: Update project.ts to use Sherlock for workspace recommendation
felixhaeberle Jun 10, 2024
e6e8b72
Merge remote-tracking branch 'origin' into felixhaeberle/sherl-2-cros…
felixhaeberle Jun 18, 2024
df9234a
Merge branch 'main' of github.com:inlang/monorepo into felixhaeberle/…
felixhaeberle Jun 19, 2024
a6ab28e
chore: Add cross-sell ninja integration to linterDiagnostics function
felixhaeberle Jun 19, 2024
07a4030
feat: Add cross-sell ninja integration to linterDiagnostics function
felixhaeberle Jun 19, 2024
d706cf9
chore: Update settings to enable app recommendations for ninjas
felixhaeberle Jun 19, 2024
32eaf32
chore: Update main.ts to register nodeishFs in extension components
felixhaeberle Jun 19, 2024
78328ce
chore: Update package.json to enable app recommendations for ninjas
felixhaeberle Jun 19, 2024
a7d64f1
feat: Update cross-sell ninja import path in linterDiagnostics.ts
felixhaeberle Jun 19, 2024
7b64f83
chore: Update cross-sell ninja import path in linterDiagnostics.ts
felixhaeberle Jun 19, 2024
c58c830
feat: Add cross-sell ninja integration to linterDiagnostics function
felixhaeberle Jun 19, 2024
dbd8322
chore: Remove cross-sell ninja integration from linterDiagnostics fun…
felixhaeberle Jun 19, 2024
38957a0
chore: Update dedent import path in settings-component.mjs
felixhaeberle Jun 19, 2024
e913f81
chore: Create workflow directory if it does not exist
felixhaeberle Jun 19, 2024
d626e47
chore: Update cross-sell ninja import path in linterDiagnostics.ts
felixhaeberle Jun 19, 2024
c42d62c
chore: Update cross-sell ninja import path in linterDiagnostics.ts
felixhaeberle Jun 19, 2024
63c325f
merge origin/main
NiklasBuchfink Jun 20, 2024
2fe1ce0
refactor: change isAdopted to shouldRecommend and check for "GitHub" …
NiklasBuchfink Jun 20, 2024
f8ea80e
refactor: Remove unused tsconfig files and recommendation utility fun…
felixhaeberle Jun 21, 2024
a13fe82
chore: Update import path for recommend-ninja in linterDiagnostics.ts
felixhaeberle Jun 21, 2024
ab8f2b9
chore: Update import path for recommend-ninja in linterDiagnostics.ts
felixhaeberle Jun 21, 2024
c07da6c
chore: Update import path for recommend-ninja in linterDiagnostics.ts
felixhaeberle Jun 21, 2024
7a6952c
feat: Add new files and configuration for @inlang/recommend-sherlock …
felixhaeberle Jun 21, 2024
119223b
chore: Update import path for recommend-ninja package in linterDiagno…
felixhaeberle Jun 21, 2024
b592b5e
chore: Update import path for recommend-ninja package in linterDiagno…
felixhaeberle Jun 21, 2024
e9ce43d
chore: Update import path for recommend-ninja package in linterDiagno…
felixhaeberle Jun 21, 2024
d3119f9
chore: Update import path for recommend-ninja package in linterDiagno…
felixhaeberle Jun 21, 2024
0f934eb
chore: Update pnpm lock & pnpm workspace
felixhaeberle Jun 21, 2024
43b8c03
refactor: Update shouldRecommend function to return true for nested d…
felixhaeberle Jun 21, 2024
8887535
fix: tests should mock .git/config
NiklasBuchfink Jun 21, 2024
c640a6d
chore: remove console.logs
NiklasBuchfink Jun 21, 2024
f5d9ef8
fix: tests should include github config
NiklasBuchfink Jun 24, 2024
e7e63e5
Merge remote-tracking branch 'origin' into felixhaeberle/sherl-2-cros…
felixhaeberle Jun 24, 2024
dd13e19
chore: Update pnpm-lock
felixhaeberle Jun 24, 2024
7c0fa59
chore: Add Sherlock and Ninja Github Action recommendations to IDE-EX…
felixhaeberle Jun 24, 2024
4554042
chore: Update recommendations UI
felixhaeberle Jun 24, 2024
a9bf8cb
chore: Add recommendation view change event emitter
felixhaeberle Jun 24, 2024
410559d
chore: Refactor recommendation banner logic in IDE extension
felixhaeberle Jun 24, 2024
198e603
chore: Update shouldRecommend function to check if .git/config file e…
felixhaeberle Jun 24, 2024
f2972e9
chore: add back isAdopted
felixhaeberle Jun 24, 2024
cc34482
Refactor recommendation banner logic in IDE extension
felixhaeberle Jun 24, 2024
b29c797
Refactor recommendation view logic in IDE extension
felixhaeberle Jun 25, 2024
0941226
Refactor recommendation view tests in IDE extension
felixhaeberle Jun 25, 2024
65c87bf
chore: Update sherlock recommendaion tests
felixhaeberle Jun 25, 2024
aa03d16
Merge remote-tracking branch 'origin' into felixhaeberle/sherl-2-cros…
felixhaeberle Jun 25, 2024
39089a5
chore: Refactor recommendation view tests and logic in IDE extension
felixhaeberle Jun 25, 2024
dff4d41
Refactor Ninja i18n adoption checks and tests
felixhaeberle Jun 25, 2024
15a216f
chore: update lock
felixhaeberle Jun 25, 2024
6730c25
feat: update Sherlock adoption check in maybe-add-Sherlock.ts
felixhaeberle Jun 25, 2024
e37eabf
chore: add changeset
felixhaeberle Jun 25, 2024
4ba10df
chore: update changeset
felixhaeberle Jun 25, 2024
94a8ccf
fix typo
felixhaeberle Jun 25, 2024
cc8943f
chore: update settings component
felixhaeberle Jun 25, 2024
157cc55
chore: Update Ninja recommendation logic in ninja.ts
felixhaeberle Jun 25, 2024
5916de1
chore: Update Ninja recommendation logic to use recommendNinja function
felixhaeberle Jun 25, 2024
5d45fe9
chore: Update Ninja recommendation logic to use recommendNinja functi…
felixhaeberle Jun 25, 2024
af6f0c0
chore: Rename crossSellNinja to recommendNinja in ninja.ts
felixhaeberle Jun 25, 2024
32c0793
chore: Update appRecommendation settings key
felixhaeberle Jun 25, 2024
0cac27f
chore: rename directory
felixhaeberle Jun 25, 2024
5cf82b7
chore: update import
felixhaeberle Jun 25, 2024
5996c15
chore: Refactor recommendNinja function in ninja.test.ts
felixhaeberle Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/cuddly-kangaroos-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@inlang/recommend-sherlock": minor
"@inlang/recommend-ninja": minor
"@inlang/paraglide-js": minor
"vs-code-extension": minor
---

- renamed packages `@inlang/cross-sell-X` to `@inlang/recommend-X` be more descriptive
- refactor recommendation view in Sherlock VS Code extension
- introduce new `shouldRecommend` function to `@inlang/recommend-sherlock` & `@inlang/recommend-ninja`
2 changes: 1 addition & 1 deletion inlang/source-code/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@iconify-json/cib": "^1.1.2",
"@iconify-json/material-symbols": "^1.1.26",
"@inlang/cli": "workspace:*",
"@inlang/cross-sell-ninja": "workspace:*",
"@inlang/recommend-ninja": "workspace:*",
"@inlang/design-system": "workspace:*",
"@inlang/detect-json-formatting": "workspace:*",
"@inlang/env-variables": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function TheActualPage() {
languageTags,
userIsCollaborator,
isNinjaRecommendationDisabled,
ninjaIsAdopted,
shouldRecommendNinja,
filteredMessageLintRules,
localChanges,
} = useEditorState()
Expand Down Expand Up @@ -183,7 +183,7 @@ function TheActualPage() {
<ListHeader />
<Show
when={
ninjaIsAdopted() === false &&
shouldRecommendNinja() === false &&
filteredMessageLintRules().length !== 0 &&
userIsCollaborator() &&
!isNinjaRecommendationDisabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
import { posthog as telemetryBrowser } from "posthog-js"
import type { Result } from "@inlang/result"
import { id } from "../../../../../marketplace-manifest.json"
import * as Ninja from "@inlang/cross-sell-ninja"
import * as Ninja from "@inlang/recommend-ninja"

type EditorStateSchema = {
/**
Expand Down Expand Up @@ -147,7 +147,7 @@ type EditorStateSchema = {
languageTags: () => LanguageTag[]

isNinjaRecommendationDisabled: () => boolean
ninjaIsAdopted: Resource<boolean>
shouldRecommendNinja: Resource<boolean>
addNinja: (
triggerPushChanges: (message: string) => Promise<(() => void) | undefined>
) => Promise<void>
Expand Down Expand Up @@ -546,7 +546,7 @@ export function EditorStateProvider(props: { children: JSXElement }) {
(repo) => repo.owner === routeParams().owner && repo.repository === routeParams().repository
)

const [ninjaIsAdopted, { refetch: refetchNinjaIsAdopted }] = createResource(
const [shouldRecommendNinja, { refetch: refetchShouldRecommendNinja }] = createResource(
() => {
if (repo() === undefined || isNinjaRecommendationDisabled()) {
return undefined
Expand All @@ -556,17 +556,17 @@ export function EditorStateProvider(props: { children: JSXElement }) {
async ({ fs }) => {
// wait for the browser to be idle
await new Promise((resolve) => requestIdleCallback(resolve))
return await Ninja.isAdopted({ fs })
return await Ninja.shouldRecommend({ fs })
}
)

async function addNinja(
triggerPushChanges: (message: string) => Promise<(() => void) | undefined> | undefined
) {
try {
if (!ninjaIsAdopted() && repo()) {
if (!shouldRecommendNinja() && repo()) {
await Ninja.add({ fs: repo()!.nodeishFs })
refetchNinjaIsAdopted()
refetchShouldRecommendNinja()
// commit, push and pull
await triggerPushChanges("feat: add Ninja GitHub action 🥷")
}
Expand Down Expand Up @@ -789,7 +789,7 @@ export function EditorStateProvider(props: { children: JSXElement }) {
sourceLanguageTag,
languageTags,
isNinjaRecommendationDisabled,
ninjaIsAdopted,
shouldRecommendNinja,
addNinja,
tourStep,
setTourStep,
Expand Down
2 changes: 2 additions & 0 deletions inlang/source-code/ide-extension/MARKETPLACE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 🕵️‍♂️ i18n inspector for VS Code

[![Inlang-ecosystem compatibility badge](https://cdn.jsdelivr.net/gh/opral/monorepo@main/inlang/assets/md-badges/inlang.svg)](https://inlang.com)

Inspect i18n within VS Code with powerful tools designed to streamline the translation process. Visualize, edit, and lint translated strings effortlessly using Inline Decorations & Hover Support. Extract new strings with a simple click, making localization tasks more intuitive and efficient.

Find the [source code on GitHub](https://github.com/opral/monorepo/tree/main/inlang/source-code/ide-extension).
Expand Down
7 changes: 3 additions & 4 deletions inlang/source-code/ide-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ Visualize, edit, and lint translated strings effortlessly using Inline Decoratio
<br />
</div>


<img width="100%" src="https://cdn.jsdelivr.net/gh/opral/monorepo/inlang/source-code/ide-extension/assets/sherlock-cover-small.png"/>

<br>
<br>

✅ Streamline the i18n translation process.
Streamline the i18n translation process.

✅ Visualize, edit, and lint translations.
Visualize, edit, and lint translations.

✅ Extract new translations with a simple click.
Extract new translations with a simple click.


<br>
Expand Down
Loading
Loading