@tnet-store/i18n-stock 1.0.0

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/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@tnet-store/i18n-stock",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+ssh://git@github.com/trinitynet666/tnet-i18n.git"
8
+ },
9
+ "author": "mbao-tnet <mangbao@trinitynet.vn>",
10
+ "packageManager": "yarn@4.9.4",
11
+ "bugs": {
12
+ "url": "https://github.com/trinitynet666/tnet-i18n/issues"
13
+ },
14
+ "homepage": "https://github.com/trinitynet666/tnet-i18n#readme",
15
+ "type": "module",
16
+ "sideEffects": false,
17
+ "main": "dist/index.js",
18
+ "module": "dist/index.js",
19
+ "types": "dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "react-native": "./dist/index.js",
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "locales",
31
+ "README.md",
32
+ "LICENSE",
33
+ "scripts/postinstall-safe.cjs"
34
+ ],
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/",
37
+ "access": "public"
38
+ },
39
+ "scripts": {
40
+ "postinstall": "node scripts/postinstall-safe.cjs",
41
+ "gen:keys": "tsx scripts/gen-keys.ts",
42
+ "build": "yarn gen:keys && tsc -p tsconfig.json && node scripts/copy-locales.js",
43
+ "check:i18n": "tsx scripts/check-i18n.ts",
44
+ "check:placeholders": "tsx scripts/check-placeholders.ts",
45
+ "check:i18n:all": "cross-env BASE_LOCALE=en LOCALES=\"zh-CN zh-TW zh-HK\" STRICT_EXTRA=0 ALLOW_MISSING_LOCALE=0 yarn run -T check:i18n && cross-env BASE_LOCALE=en LOCALES=\"zh-CN zh-TW zh-HK\" STRICT_EXTRA=0 ALLOW_MISSING_LOCALE=0 yarn run -T check:placeholders",
46
+ "prepublishOnly": "yarn build && yarn run -T check:placeholders",
47
+ "release": "semantic-release",
48
+ "release:local": "SR_NO_GH=1 semantic-release --no-ci --dry-run"
49
+ },
50
+ "dependencies": {
51
+ "i18next": "^25.4.2"
52
+ },
53
+ "peerDependencies": {
54
+ "react": ">=17 || >=18",
55
+ "react-native": ">=0.71 || >=0.72"
56
+ },
57
+ "devDependencies": {
58
+ "@semantic-release/changelog": "^6.0.3",
59
+ "@semantic-release/commit-analyzer": "^13.0.1",
60
+ "@semantic-release/exec": "^7.1.0",
61
+ "@semantic-release/git": "^10.0.1",
62
+ "@semantic-release/github": "^11.0.5",
63
+ "@semantic-release/npm": "^12.0.2",
64
+ "@semantic-release/release-notes-generator": "^14.0.3",
65
+ "@types/node": "^24.3.0",
66
+ "@types/react": "^19.1.12",
67
+ "cross-env": "^7.0.3",
68
+ "semantic-release": "^24.2.7",
69
+ "tsx": "^4.20.5",
70
+ "typescript": "^5.9.2"
71
+ }
72
+ }
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const CWD = process.cwd();
6
+ const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
7
+
8
+ // Có đang ở node_modules không?
9
+ const inNodeModules =
10
+ CWD.includes(`${path.sep}node_modules${path.sep}`) ||
11
+ /node_modules$/.test(CWD);
12
+
13
+ // Tìm .git ở CWD hoặc cha
14
+ let dir = CWD;
15
+ let foundGit = false;
16
+ for (let i = 0; i < 6; i++) {
17
+ if (fs.existsSync(path.join(dir, ".git"))) {
18
+ foundGit = true;
19
+ break;
20
+ }
21
+ const parent = path.dirname(dir);
22
+ if (parent === dir) break;
23
+ dir = parent;
24
+ }
25
+
26
+ if (inNodeModules || isCI || !foundGit) {
27
+ console.log("[i18n] postinstall skipped (dependency/CI mode).");
28
+ process.exit(0);
29
+ }
30
+
31
+ try {
32
+ console.log("[i18n] postinstall repo mode: install husky hooks");
33
+ require('child_process').execSync('husky install', { stdio: 'inherit' });
34
+ console.log("[i18n] husky installed.");
35
+ } catch (e) {
36
+ console.warn("[i18n] postinstall dev setup failed:", e?.message || e);
37
+ // Không làm fail cài đặt của người dùng thư viện
38
+ process.exit(0);
39
+ }