icu-minify 0.0.1 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,6 +20,9 @@ import format from 'icu-minify/format';
20
20
  // At build time
21
21
  const compiled = compile('Hello {name}!');
22
22
 
23
+ // ["Hello ", ["name"], "!"]
24
+ console.log(compiled);
25
+
23
26
  // At runtime
24
27
  format(compiled, 'en', {name: 'World'});
25
28
  ```
@@ -5,6 +5,7 @@ import { T as TYPE_POUND, c as TYPE_TIME, b as TYPE_DATE, a as TYPE_NUMBER, e as
5
5
  // Could potentially share this with `use-intl` if we had a shared package for both
6
6
 
7
7
  function format(message, locale, values = {}, options) {
8
+ // Hot path for plain strings
8
9
  if (typeof message === 'string') {
9
10
  return message;
10
11
  }
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "icu-minify",
3
- "version": "0.0.1",
3
+ "version": "4.8.1",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
+ "funding": [
7
+ {
8
+ "type": "individual",
9
+ "url": "https://github.com/sponsors/amannn"
10
+ }
11
+ ],
6
12
  "description": "ICU message format compiler with a <1KB runtime bundle footprint",
7
13
  "license": "MIT",
8
14
  "homepage": "https://next-intl.dev",
@@ -10,6 +16,16 @@
10
16
  "type": "git",
11
17
  "url": "git+https://github.com/amannn/next-intl.git"
12
18
  },
19
+ "scripts": {
20
+ "build": "rm -rf dist && rollup -c",
21
+ "test": "TZ=Europe/Berlin vitest",
22
+ "lint": "pnpm run lint:source && pnpm run lint:package",
23
+ "lint:source": "eslint src test && tsc --noEmit && pnpm run lint:prettier",
24
+ "lint:package": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm",
25
+ "lint:prettier": "prettier src --check",
26
+ "prepublishOnly": "turbo build",
27
+ "size": "size-limit"
28
+ },
13
29
  "type": "module",
14
30
  "exports": {
15
31
  "./compile": {
@@ -39,29 +55,5 @@
39
55
  "dependencies": {
40
56
  "@formatjs/icu-messageformat-parser": "^3.4.0"
41
57
  },
42
- "devDependencies": {
43
- "@arethetypeswrong/cli": "^0.17.4",
44
- "@size-limit/preset-small-lib": "^11.2.0",
45
- "@types/node": "^20.14.5",
46
- "eslint": "9.11.1",
47
- "eslint-config-molindo": "^8.0.0",
48
- "intl-messageformat": "^11.1.0",
49
- "prettier": "^3.3.3",
50
- "publint": "^0.2.8",
51
- "rollup": "^4.18.0",
52
- "size-limit": "^11.2.0",
53
- "typescript": "^5.5.3",
54
- "vitest": "^3.0.8",
55
- "tools": "^1.0.0"
56
- },
57
- "prettier": "eslint-config-molindo/.prettierrc.json",
58
- "scripts": {
59
- "build": "rm -rf dist && rollup -c",
60
- "test": "TZ=Europe/Berlin vitest",
61
- "lint": "pnpm run lint:source && pnpm run lint:package",
62
- "lint:source": "eslint src test && tsc --noEmit && pnpm run lint:prettier",
63
- "lint:package": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm",
64
- "lint:prettier": "prettier src --check",
65
- "size": "size-limit"
66
- }
67
- }
58
+ "gitHead": "95238a93ed16d79b854ee4a284ba8f40470084da"
59
+ }