@vendure/ngx-translate-extract
Advanced tools
Comparing version 9.0.0 to 9.0.1
import { TranslationCollection } from '../utils/translation.collection.js'; | ||
import { stripBOM } from '../utils/utils.js'; | ||
import pkg from 'flat'; | ||
const { flatten } = pkg; | ||
import { flatten } from 'flat'; | ||
export class JsonCompiler { | ||
@@ -6,0 +5,0 @@ constructor(options) { |
import { TranslationCollection } from '../utils/translation.collection.js'; | ||
import { stripBOM } from '../utils/utils.js'; | ||
import pkg from 'flat'; | ||
const { flatten, unflatten } = pkg; | ||
import { flatten, unflatten } from 'flat'; | ||
export class NamespacedJsonCompiler { | ||
@@ -6,0 +5,0 @@ constructor(options) { |
@@ -0,7 +1,8 @@ | ||
import path from 'node:path'; | ||
import fs from 'node:fs'; | ||
import { resolveSync } from 'tsconfig'; | ||
import JSON5 from 'json5'; | ||
import { tsquery } from '@phenomnomnominal/tsquery'; | ||
import { TranslationCollection } from '../utils/translation.collection.js'; | ||
import { findClassDeclarations, findClassPropertiesByType, findPropertyCallExpressions, findMethodCallExpressions, getStringsFromExpression, findMethodParameterByType, findConstructorDeclaration, getSuperClassName, getImportPath } from '../utils/ast-helpers.js'; | ||
import * as path from 'path'; | ||
import * as fs from 'fs'; | ||
import { loadSync } from 'tsconfig'; | ||
const TRANSLATE_SERVICE_TYPE_REFERENCE = 'TranslateService'; | ||
@@ -70,8 +71,11 @@ const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream']; | ||
else { | ||
const config = loadSync(currDir); | ||
let baseUrl = config?.config?.compilerOptions?.baseUrl; | ||
if (baseUrl) { | ||
baseUrl = path.resolve(path.dirname(config.path), baseUrl); | ||
let baseUrl = currDir; | ||
const tsconfigFilePath = resolveSync(currDir); | ||
if (tsconfigFilePath) { | ||
const tsConfigFile = fs.readFileSync(tsconfigFilePath); | ||
const config = JSON5.parse(tsConfigFile.toString()); | ||
const compilerOptionsBaseUrl = config.compilerOptions?.baseUrl ?? ''; | ||
baseUrl = path.resolve(path.dirname(tsconfigFilePath), compilerOptionsBaseUrl); | ||
} | ||
superClassPath = path.resolve(baseUrl ?? currDir, importPath); | ||
superClassPath = path.resolve(baseUrl, importPath); | ||
} | ||
@@ -78,0 +82,0 @@ const superClassFile = superClassPath + '.ts'; |
@@ -1,8 +0,3 @@ | ||
declare module 'braces' { | ||
interface Options { | ||
keepEscaping?: boolean; | ||
} | ||
} | ||
export declare function normalizeHomeDir(path: string): string; | ||
export declare function expandPattern(pattern: string): string[]; | ||
export declare function normalizePaths(patterns: string[], defaultPatterns?: string[]): string[]; |
{ | ||
"name": "@vendure/ngx-translate-extract", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"description": "Extract strings from projects using ngx-translate", | ||
@@ -15,35 +15,31 @@ "author": "Kim Biesbjerg <kim@biesbjerg.com>", | ||
"dependencies": { | ||
"@phenomnomnominal/tsquery": "^5.0.1", | ||
"boxen": "^6.2.1", | ||
"@phenomnomnominal/tsquery": "^6.1.3", | ||
"braces": "^3.0.2", | ||
"colorette": "^2.0.16", | ||
"flat": "^5.0.2", | ||
"colorette": "^2.0.20", | ||
"flat": "^6.0.1", | ||
"gettext-parser": "^4.2.0", | ||
"glob": "^7.2.0", | ||
"path": "^0.12.7", | ||
"terminal-link": "^3.0.0", | ||
"glob": "^10.3.0", | ||
"json5": "^2.2.3", | ||
"tsconfig": "^7.0.0", | ||
"yargs": "^17.5.1" | ||
"yargs": "^17.7.2" | ||
}, | ||
"devDependencies": { | ||
"@angular/compiler": "^17.0.3", | ||
"@types/braces": "^3.0.1", | ||
"@types/chai": "^4.3.3", | ||
"@types/flat": "^5.0.2", | ||
"@types/gettext-parser": "4.0.1", | ||
"@angular/compiler": "^17.0.4", | ||
"@types/braces": "^3.0.4", | ||
"@types/chai": "^4.3.11", | ||
"@types/gettext-parser": "^4.0.4", | ||
"@types/glob": "^8.0.0", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^16", | ||
"@types/yargs": "^17.0.20", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^18", | ||
"@types/yargs": "^17.0.32", | ||
"@typescript-eslint/eslint-plugin": "^6.12.0", | ||
"@typescript-eslint/eslint-plugin-tslint": "^6.12.0", | ||
"@typescript-eslint/parser": "^6.12.0", | ||
"chai": "^4.3.6", | ||
"cross-env": "^7.0.3", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.32.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-import": "^2.29.0", | ||
"mocha": "^10.2.0", | ||
"prettier": "^2.7.1", | ||
"pretty-quick": "^3.1.3", | ||
"rimraf": "^3.0.2", | ||
"rimraf": "^5.0.5", | ||
"ts-mocha": "^10.0.0", | ||
@@ -50,0 +46,0 @@ "ts-node": "^10.4.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121396
11
21
4
1467
+ Addedjson5@^2.2.3
+ Added@angular/compiler@19.0.0(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@phenomnomnominal/tsquery@6.1.3(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@types/esquery@1.5.4(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedflat@6.0.1(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
- Removedboxen@^6.2.1
- Removedpath@^0.12.7
- Removedterminal-link@^3.0.0
- Removed@angular/compiler@19.0.1(transitive)
- Removed@phenomnomnominal/tsquery@5.0.1(transitive)
- Removedansi-align@3.0.1(transitive)
- Removedansi-escapes@5.0.0(transitive)
- Removedboxen@6.2.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcamelcase@6.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcli-boxes@3.0.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedflat@5.0.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.3(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath@0.12.7(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprocess@0.11.10(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsupports-hyperlinks@2.3.0(transitive)
- Removedterminal-link@3.0.0(transitive)
- Removedtype-fest@1.4.02.19.0(transitive)
- Removedutil@0.10.4(transitive)
- Removedwidest-line@4.0.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedcolorette@^2.0.20
Updatedflat@^6.0.1
Updatedglob@^10.3.0
Updatedyargs@^17.7.2