Skip to content

Commit

Permalink
chore: cleanup / yarn sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
v0l committed Nov 20, 2023
1 parent e8bcba1 commit 7c8fff9
Show file tree
Hide file tree
Showing 73 changed files with 552 additions and 360 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js"
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs"
}
20 changes: 20 additions & 0 deletions .yarn/sdks/eslint/lib/unsupported-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/use-at-your-own-risk
require(absPnpApiPath).setup();
}
}

// Defer to the real eslint/use-at-your-own-risk your application uses
module.exports = absRequire(`eslint/use-at-your-own-risk`);
12 changes: 10 additions & 2 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"name": "eslint",
"version": "8.48.0-sdk",
"version": "8.53.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"eslint": "./bin/eslint.js"
},
"exports": {
"./package.json": "./package.json",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
}
}
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/bin/prettier.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/bin/prettier.cjs
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`);
File renamed without changes.
7 changes: 4 additions & 3 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "prettier",
"version": "3.0.3-sdk",
"main": "./index.js",
"type": "commonjs"
"version": "3.1.0-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
}
6 changes: 3 additions & 3 deletions .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/typescript.js
// Setup the environment to be able to require typescript
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/typescript.js your application uses
module.exports = absRequire(`typescript/lib/typescript.js`);
// Defer to the real typescript your application uses
module.exports = absRequire(`typescript`);
6 changes: 5 additions & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"name": "typescript",
"version": "5.2.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}
6 changes: 3 additions & 3 deletions packages/app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module.exports = {
"formatjs/enforce-id": [
"error",
{
"idInterpolationPattern": "[sha512:contenthash:base64:6]"
}
]
idInterpolationPattern: "[sha512:contenthash:base64:6]",
},
],
},
root: true,
ignorePatterns: ["build/", "*.test.ts", "*.js"],
Expand Down
4 changes: 3 additions & 1 deletion packages/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Feature packed nostr client" />
<meta name="keywords" content="nostr snort fast decentralized social media censorship resistant open source software" />
<meta
name="keywords"
content="nostr snort fast decentralized social media censorship resistant open source software" />
<link rel="preconnect" href="https://imgproxy.snort.social" />
<link rel="apple-touch-icon" href="" />
<link rel="manifest" href="/manifest.json" />
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/Element/Embed/CashuNuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ export default function CashuNuts({ token }: { token: string }) {
</defs>
</svg>
<FormattedMessage
defaultMessage="<h1>{n}</h1> Cashu sats" id="6/SF6e"
defaultMessage="<h1>{n}</h1> Cashu sats"
id="6/SF6e"
values={{
h1: c => <h1>{c}</h1>,
n: <FormattedNumber value={amount} />,
Expand All @@ -116,7 +117,8 @@ export default function CashuNuts({ token }: { token: string }) {
</div>
<small className="xs w-max">
<FormattedMessage
defaultMessage="<b>Mint:</b> {url}" id="zwb6LR"
defaultMessage="<b>Mint:</b> {url}"
id="zwb6LR"
values={{
b: c => <b>{c}</b>,
url: new URL(cashu.token[0].mint).hostname,
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/Element/Embed/PubkeyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default function PubkeyList({ ev, className }: { ev: NostrEvent; classNam
Toastore.push({
element: (
<FormattedMessage
defaultMessage="Sent {n} sats to {name}" id="Ig9/a1"
defaultMessage="Sent {n} sats to {name}"
id="Ig9/a1"
values={{
n: amtSend,
name: getDisplayName(profile, pk),
Expand Down Expand Up @@ -70,7 +71,8 @@ export default function PubkeyList({ ev, className }: { ev: NostrEvent; classNam
<>
<AsyncButton className="mr5 secondary" onClick={() => zapAll()}>
<FormattedMessage
defaultMessage="Zap all {n} sats" id="IVbtTS"
defaultMessage="Zap all {n} sats"
id="IVbtTS"
values={{
n: <FormattedNumber value={login.appData.item.preferences.defaultZapAmount * ids.length} />,
}}
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/Element/Event/LongFormText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export function LongFormText(props: LongFormTextProps) {
<div className="flex g8">
<div>
<FormattedMessage
defaultMessage="{n} mins to read" id="zm6qS1"
defaultMessage="{n} mins to read"
id="zm6qS1"
values={{
n: <FormattedNumber value={readTime().mins} />,
}}
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/Element/Event/NostrFileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function NostrFileElement({ ev }: { ev: NostrEvent }) {

if (u && m) {
return (
<Reveal message={<FormattedMessage defaultMessage="Click to load content from {link}" id="lsNFM1" values={{ link: u }} />}>
<Reveal
message={
<FormattedMessage defaultMessage="Click to load content from {link}" id="lsNFM1" values={{ link: u }} />
}>
<MediaElement mime={m} url={u} sha256={x} magnet={magnet} blurHash={blurHash} />
</Reveal>
);
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/Element/Event/NoteBroadcaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,17 @@ export function NoteBroadcaster({
onClick={() => retryPublish(r)}
className="p4 br-compact flex items-center secondary"
title={formatMessage({
defaultMessage: "Retry publishing", id: '9kSari',
defaultMessage: "Retry publishing",
id: "9kSari",
})}>
<Icon name="refresh-ccw-01" />
</AsyncButton>
<AsyncButton
onClick={() => removeRelayFromResult(r)}
className="p4 br-compact flex items-center secondary"
title={formatMessage({
defaultMessage: "Remove from my relays", id: 'UJTWqI',
defaultMessage: "Remove from my relays",
id: "UJTWqI",
})}>
<Icon name="trash-01" className="trash-icon" />
</AsyncButton>
Expand Down
33 changes: 24 additions & 9 deletions packages/app/src/Element/Event/NoteCreator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export function NoteCreator() {
throw new Error(
formatMessage(
{
defaultMessage: "Failed to parse zap split: {input}", id: 'sZQzjQ',
defaultMessage: "Failed to parse zap split: {input}",
id: "sZQzjQ",
},
{
input: s.value,
Expand All @@ -69,7 +70,8 @@ export function NoteCreator() {
throw new Error(
formatMessage(
{
defaultMessage: "Failed to parse zap split: {input}", id: 'sZQzjQ',
defaultMessage: "Failed to parse zap split: {input}",
id: "sZQzjQ",
},
{
input: s.value,
Expand All @@ -81,7 +83,8 @@ export function NoteCreator() {
throw new Error(
formatMessage(
{
defaultMessage: "Invalid zap split: {input}", id: '8Y6bZQ',
defaultMessage: "Invalid zap split: {input}",
id: "8Y6bZQ",
},
{
input: s.value,
Expand Down Expand Up @@ -380,7 +383,7 @@ export function NoteCreator() {
v => (v.zapSplits = arr.map((vv, ii) => (ii === i ? { ...vv, value: e.target.value } : vv))),
)
}
placeholder={formatMessage({ defaultMessage: "npub / nprofile / nostr address", id: 'WvGmZT' })}
placeholder={formatMessage({ defaultMessage: "npub / nprofile / nostr address", id: "WvGmZT" })}
/>
</div>
<div className="flex flex-col f-1 g4">
Expand Down Expand Up @@ -419,14 +422,20 @@ export function NoteCreator() {
</button>
</div>
<span className="warning">
<FormattedMessage defaultMessage="Not all clients support this, you may still receive some zaps as if zap splits was not configured" id="6bgpn+" />
<FormattedMessage
defaultMessage="Not all clients support this, you may still receive some zaps as if zap splits was not configured"
id="6bgpn+"
/>
</span>
</div>
<div className="flex flex-col g8">
<h4>
<FormattedMessage defaultMessage="Sensitive Content" id="bQdA2k" />
</h4>
<FormattedMessage defaultMessage="Users must accept the content warning to show the content of your note." id="UUPFlt" />
<FormattedMessage
defaultMessage="Users must accept the content warning to show the content of your note."
id="UUPFlt"
/>
<input
className="w-max"
type="text"
Expand All @@ -435,7 +444,8 @@ export function NoteCreator() {
maxLength={50}
minLength={1}
placeholder={formatMessage({
defaultMessage: "Reason", id: 'AkCxS/',
defaultMessage: "Reason",
id: "AkCxS/",
})}
/>
<span className="warning">
Expand Down Expand Up @@ -486,7 +496,11 @@ export function NoteCreator() {
<FormattedMessage defaultMessage="Cancel" id="47FYwb" />
</button>
<AsyncButton onClick={onSubmit} className="primary">
{note.replyTo ? <FormattedMessage defaultMessage="Reply" id="9HU8vw" /> : <FormattedMessage defaultMessage="Send" id="9WRlF4" />}
{note.replyTo ? (
<FormattedMessage defaultMessage="Reply" id="9HU8vw" />
) : (
<FormattedMessage defaultMessage="Send" id="9WRlF4" />
)}
</AsyncButton>
</div>
</div>
Expand Down Expand Up @@ -597,7 +611,8 @@ export function NoteCreator() {
value={note.hashTags}
onChange={e => note.update(s => (s.hashTags = e))}
placeHolder={formatMessage({
defaultMessage: "Add up to 4 hashtags", id: 'AIgmDy',
defaultMessage: "Add up to 4 hashtags",
id: "AIgmDy",
})}
separators={["Enter", ","]}
/>
Expand Down
14 changes: 9 additions & 5 deletions packages/app/src/Element/Event/NoteFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ export default function NoteFooter(props: NoteFooterProps) {
const pow = findTag(ev, "nonce") ? countLeadingZeros(ev.id) : undefined;
if (pow) {
return (
<AsyncFooterIcon title={formatMessage({ defaultMessage: "Proof of Work", id: 'grQ+mI' })} iconName="diamond" value={pow} />
<AsyncFooterIcon
title={formatMessage({ defaultMessage: "Proof of Work", id: "grQ+mI" })}
iconName="diamond"
value={pow}
/>
);
}
}
Expand All @@ -199,7 +203,7 @@ export default function NoteFooter(props: NoteFooterProps) {
<AsyncFooterIcon
className={didZap ? "reacted text-nostr-orange" : "hover:text-nostr-orange"}
{...longPress()}
title={formatMessage({ defaultMessage: "Zap", id: 'fBI91o' })}
title={formatMessage({ defaultMessage: "Zap", id: "fBI91o" })}
iconName={canFastZap ? "zapFast" : "zap"}
value={zapTotal}
onClick={e => fastZap(e)}
Expand All @@ -217,7 +221,7 @@ export default function NoteFooter(props: NoteFooterProps) {
<AsyncFooterIcon
className={hasReposted() ? "reacted text-nostr-blue" : "hover:text-nostr-blue"}
iconName="repeat"
title={formatMessage({ defaultMessage: "Repost", id: 'JeoS4y' })}
title={formatMessage({ defaultMessage: "Repost", id: "JeoS4y" })}
value={reposts.length}
/>
}
Expand Down Expand Up @@ -258,7 +262,7 @@ export default function NoteFooter(props: NoteFooterProps) {
<AsyncFooterIcon
className={reacted ? "reacted text-nostr-red" : "hover:text-nostr-red"}
iconName={reacted ? "heart-solid" : "heart"}
title={formatMessage({ defaultMessage: "Like", id: 'qtWLmt' })}
title={formatMessage({ defaultMessage: "Like", id: "qtWLmt" })}
value={positive.length}
onClick={async () => {
if (readonly) return;
Expand All @@ -274,7 +278,7 @@ export default function NoteFooter(props: NoteFooterProps) {
<AsyncFooterIcon
className={note.show ? "reacted text-nostr-purple" : "hover:text-nostr-purple"}
iconName="reply"
title={formatMessage({ defaultMessage: "Reply", id: '9HU8vw' })}
title={formatMessage({ defaultMessage: "Reply", id: "9HU8vw" })}
value={props.replies ?? 0}
onClick={async () => handleReplyButtonClick()}
/>
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/Element/Event/NoteInner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export function NoteInner(props: NoteProps) {
message={
<>
<FormattedMessage
defaultMessage="The author has marked this note as a <i>sensitive topic</i>" id="StKzTE"
defaultMessage="The author has marked this note as a <i>sensitive topic</i>"
id="StKzTE"
values={{
i: c => <i>{c}</i>,
}}
Expand All @@ -127,7 +128,8 @@ export function NoteInner(props: NoteProps) {
<>
&nbsp;
<FormattedMessage
defaultMessage="Reason: <i>{reason}</i>" id="6OSOXl"
defaultMessage="Reason: <i>{reason}</i>"
id="6OSOXl"
values={{
i: c => <i>{c}</i>,
reason: contentWarning[1],
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/Element/Event/NoteReaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default function NoteReaction(props: NoteReactionProps) {
<div className="flex g4">
<Icon name="repeat" size={18} />
<FormattedMessage
defaultMessage="{name} reposted" id="+xliwN"
defaultMessage="{name} reposted"
id="+xliwN"
values={{
name: getDisplayName(profile, ev.pubkey),
}}
Expand Down
Loading

0 comments on commit 7c8fff9

Please sign in to comment.