mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
Move locale pack from private/ to @uppy/locales (#5801)
This commit is contained in:
parent
36097dc67e
commit
bfb4b5c9cf
7 changed files with 19 additions and 39 deletions
|
|
@ -24,7 +24,7 @@
|
|||
"build:css": "yarn node ./bin/build-css.js && yarn workspace @uppy/components build:tailwind && yarn node ./bin/copy-tailwind-css.mjs",
|
||||
"build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle",
|
||||
"build:js:typeless": "npm-run-all build:companion build:svelte",
|
||||
"build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && yarn workspace @uppy-dev/locale-pack test unused",
|
||||
"build:locale-pack": "yarn workspace @uppy/locales build && yarn workspace @uppy/locales test",
|
||||
"build:svelte": "yarn workspace @uppy/svelte build",
|
||||
"check": "yarn exec biome check --write",
|
||||
"check:ci": "yarn exec biome ci",
|
||||
|
|
@ -41,12 +41,10 @@
|
|||
"size": "echo 'JS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.css | gzip | wc -c",
|
||||
"start:companion": "bash bin/companion.sh",
|
||||
"start:companion:with-loadbalancer": "e2e/start-companion-with-load-balancer.mjs",
|
||||
"test": "npm-run-all lint test:locale-packs:unused test:unit test:companion",
|
||||
"test": "npm-run-all lint test:locale-pack test:unit test:companion",
|
||||
"test:companion": "yarn workspace @uppy/companion test",
|
||||
"test:companion:watch": "yarn workspace @uppy/companion test --watch",
|
||||
"test:locale-packs": "yarn locale-packs:unused && yarn locale-packs:warnings",
|
||||
"test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused",
|
||||
"test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings",
|
||||
"test:locale-pack": "yarn workspace @uppy/locales test",
|
||||
"test:ts": "yarn tsc -b && yarn workspace @uppy/svelte check",
|
||||
"test:unit": "yarn run build && yarn test:watch --run",
|
||||
"test:watch": "vitest --environment jsdom --dir packages/@uppy",
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
"version": "4.6.0",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"main": "locale-pack/index.mjs",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
"build": "yarn node script/build-en_US.mjs && tsc --build tsconfig.build.json && yarn format",
|
||||
"format": "cd ../../ && yarn check packages/@uppy/locales/src/en_US.ts",
|
||||
"test": "yarn node script/test.mjs unused"
|
||||
},
|
||||
"keywords": [
|
||||
"uppy",
|
||||
|
|
@ -21,7 +24,10 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/utils": "workspace:^"
|
||||
"@uppy/utils": "workspace:^",
|
||||
"chalk": "^5.0.0",
|
||||
"dedent": "^1.0.0",
|
||||
"glob": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-disable no-console, prefer-arrow-callback */
|
||||
// We use locale.ts in all packages.
|
||||
// They need to be combined into a single file (en_US.ts).
|
||||
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
|
|
@ -6,7 +7,7 @@ import { fileURLToPath } from 'node:url'
|
|||
|
||||
import { getLocales, sortObjectAlphabetically } from './helpers.mjs'
|
||||
|
||||
const root = fileURLToPath(new URL('../../', import.meta.url))
|
||||
const root = fileURLToPath(new URL('../../../../', import.meta.url))
|
||||
|
||||
const localesPath = path.join(root, 'packages', '@uppy', 'locales')
|
||||
const templatePath = path.join(localesPath, 'template.ts')
|
||||
|
|
@ -44,5 +45,5 @@ await Promise.all([
|
|||
'en_US.strings = {}',
|
||||
`en_US.strings = ${formattedLocale}`,
|
||||
),
|
||||
).then(() => console.log(`✅ Generated '${englishLocalePath}'`)),
|
||||
),
|
||||
])
|
||||
|
|
@ -9,7 +9,7 @@ import glob from 'glob'
|
|||
|
||||
import { getLocales, getPaths, omit } from './helpers.mjs'
|
||||
|
||||
const root = fileURLToPath(new URL('../../', import.meta.url))
|
||||
const root = fileURLToPath(new URL('../../../../', import.meta.url))
|
||||
const leadingLocaleName = 'en_US'
|
||||
const mode = process.argv[2]
|
||||
const pluginLocaleDependencies = {
|
||||
|
|
@ -143,5 +143,3 @@ function test() {
|
|||
}
|
||||
|
||||
await test()
|
||||
console.log('\n')
|
||||
console.log('No blocking issues found')
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "@uppy-dev/locale-pack",
|
||||
"author": "Merlijn Vos <merlijn@transloadit.com>",
|
||||
"description": "Generate locale pack, types, and documentation",
|
||||
"main": "index.mjs",
|
||||
"scripts": {
|
||||
"build": "yarn node index.mjs",
|
||||
"test": "yarn node test.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^5.0.0",
|
||||
"dedent": "^1.0.0",
|
||||
"glob": "^8.0.0"
|
||||
}
|
||||
}
|
||||
13
yarn.lock
13
yarn.lock
|
|
@ -11085,16 +11085,6 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy-dev/locale-pack@workspace:private/locale-pack":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy-dev/locale-pack@workspace:private/locale-pack"
|
||||
dependencies:
|
||||
chalk: "npm:^5.0.0"
|
||||
dedent: "npm:^1.0.0"
|
||||
glob: "npm:^8.0.0"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy-dev/release@workspace:private/release":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy-dev/release@workspace:private/release"
|
||||
|
|
@ -11888,6 +11878,9 @@ __metadata:
|
|||
resolution: "@uppy/locales@workspace:packages/@uppy/locales"
|
||||
dependencies:
|
||||
"@uppy/utils": "workspace:^"
|
||||
chalk: "npm:^5.0.0"
|
||||
dedent: "npm:^1.0.0"
|
||||
glob: "npm:^8.0.0"
|
||||
typescript: "npm:^5.8.3"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue