{"version":3,"file":"plugin.cjs","names":["normalizePath","resolvePreloadModuleId","createRequire","isInHiddenDirectory","relative","getConfiguration","getAlias","join","getAppLogger","getConfigEnvVars","getDictionaries","getUnusedNodeTypesAsync","formatNodeTypeToEnvVar","formatDictionarySelectorEnvVar","getHasDictionarySelector","resolvePackageExport","dirname","readFile","basename","createDynamicEntryFilter","addDynamicEntryPreload","prepareIntlayer","watch"],"sources":["../../../src/esbuild/plugin.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport { basename, dirname, join, relative } from 'node:path';\nimport {\n  addDynamicEntryPreload,\n  createDynamicEntryFilter,\n  resolvePreloadModuleId,\n} from '@intlayer/config/dictionaryPreload';\nimport {\n  formatDictionarySelectorEnvVar,\n  formatNodeTypeToEnvVar,\n  getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n  type GetConfigurationOptions,\n  getConfiguration,\n} from '@intlayer/config/node';\nimport {\n  getAlias,\n  getHasDictionarySelector,\n  getUnusedNodeTypesAsync,\n  normalizePath,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { logConfigDetails } from '@intlayer/engine/cli';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { isInHiddenDirectory } from './hiddenDirectory';\nimport { resolvePackageExport } from './resolvePackageExport';\n\n/**\n * Absolute id of the locale resolver the injected preamble imports.\n *\n * Resolved from this package, which declares `@intlayer/core` as a dependency,\n * rather than left bare in the emitted source: the importer is a generated\n * entry point under the application's `.intlayer` directory, and an application\n * only depends on `intlayer` and its framework binding, so the bare specifier\n * would resolve from a tree that need not contain the package at all.\n *\n * Always built from `import.meta.url`: the bundler shims it to `__filename` in\n * the CommonJS output, whereas a `typeof require` guard is unreliable here —\n * the ESM output rewrites `require` into an always-defined proxy that has no\n * `resolve` method.\n */\nconst preloadModuleId = normalizePath(\n  resolvePreloadModuleId(createRequire(import.meta.url))\n);\n\n/** Bare specifiers of the packages this plugin keeps inside its own build. */\nconst INTLAYER_PACKAGE_FILTER =\n  /^(?:intlayer|angular-intlayer|@intlayer\\/[^/]+)(?:\\/|$)/;\n\n/** Namespace of the re-export shims standing in for externalised packages. */\nconst INTLAYER_PACKAGE_NAMESPACE = 'intlayer-package';\n\n/** Matches a module that has a default export, on unminified sources. */\nconst DEFAULT_EXPORT_PATTERN =\n  /\\bexport\\s+default\\b|\\bas\\s+default\\b|\\{\\s*default\\s*[,}]/;\n\n// Minimal subset of the esbuild Plugin interface to avoid a hard dependency on\n// the `esbuild` package for type resolution. The shape is compatible with\n// esbuild >=0.17, `@angular-builders/custom-esbuild`, and NX esbuild builders.\nexport type EsbuildResolveArgs = {\n  path: string;\n  importer: string;\n  namespace: string;\n  resolveDir: string;\n  kind: string;\n  pluginData?: unknown;\n};\n\nexport type EsbuildResolveResult = {\n  path?: string;\n  namespace?: string;\n  external?: boolean;\n  sideEffects?: boolean;\n  pluginData?: unknown;\n  errors?: unknown[];\n  warnings?: unknown[];\n};\n\nexport type EsbuildLoadArgs = {\n  path: string;\n  namespace: string;\n  pluginData?: unknown;\n};\n\nexport type EsbuildLoadResult = {\n  contents: string;\n  loader?: string;\n  /** Directory relative imports of `contents` resolve from. */\n  resolveDir?: string;\n};\n\nexport interface EsbuildPluginBuild {\n  initialOptions: {\n    alias?: Record<string, string>;\n    define?: Record<string, string>;\n    minify?: boolean;\n    watch?: unknown;\n    /** Absolute working directory of the esbuild context (set by Angular's builder). */\n    absWorkingDir?: string;\n  };\n  onStart(callback: () => void | Promise<void>): void;\n  /** Intercept module resolution — works even for imports inside node_modules. */\n  onResolve(\n    options: { filter: RegExp; namespace?: string },\n    callback: (\n      args: EsbuildResolveArgs\n    ) =>\n      | EsbuildResolveResult\n      | null\n      | undefined\n      | Promise<EsbuildResolveResult | null | undefined>\n  ): void;\n  /** Run the remaining resolution pipeline (other plugins, then esbuild). */\n  resolve(\n    path: string,\n    options: Partial<Omit<EsbuildResolveArgs, 'path'>>\n  ): Promise<EsbuildResolveResult & { path: string; external: boolean }>;\n  /** Intercept module contents, so a resolved file can be rewritten. */\n  onLoad(\n    options: { filter: RegExp; namespace?: string },\n    callback: (\n      args: EsbuildLoadArgs\n    ) =>\n      | EsbuildLoadResult\n      | null\n      | undefined\n      | Promise<EsbuildLoadResult | null | undefined>\n  ): void;\n}\n\nexport interface EsbuildPlugin {\n  name: string;\n  setup(build: EsbuildPluginBuild): void | Promise<void>;\n}\n\nexport type IntlayerEsbuildPluginOptions = {\n  configOptions?: GetConfigurationOptions;\n  /**\n   * Whether to start the Intlayer file watcher for dictionary regeneration.\n   * - `true`: always start the watcher (useful for `ng serve`)\n   * - `false`: never start the watcher (useful for `ng build`)\n   * - `undefined` (default): auto-detect based on the build context\n   *   (skips the watcher when a production build is detected)\n   */\n  watch?: boolean;\n};\n\n/**\n * The dev server's file watcher skips dot-directories, so type declarations\n * generated there are never re-read: a key added to a dictionary stays unknown\n * to template type-checking until `ng serve` restarts. Nothing in the plugin\n * can reach that cache, so the fix is to generate the types elsewhere.\n */\nconst warnAboutHiddenTypesDirectory = (\n  configuration: IntlayerConfig,\n  appLogger: ReturnType<typeof getAppLogger>\n) => {\n  const { baseDir, typesDir, moduleAugmentationDir } = configuration.system;\n\n  const hiddenDirectories = [\n    ...new Set([typesDir, moduleAugmentationDir]),\n  ].filter((directory) => isInHiddenDirectory(baseDir, directory));\n\n  if (hiddenDirectories.length === 0) return;\n\n  appLogger(\n    [\n      `Type declarations are generated under ${hiddenDirectories.map((directory) => relative(baseDir, directory)).join(', ')}.`,\n      \"The Angular dev server does not watch dot-directories, so keys added to a dictionary stay unknown to template type-checking until 'ng serve' restarts.\",\n      \"Set 'system.typesDir' and 'system.moduleAugmentationDir' to a directory outside any dot-directory (e.g. 'intlayer-types') and point the tsconfig 'include' at it.\",\n    ].join(' '),\n    { level: 'warn' }\n  );\n};\n\n/**\n * esbuild plugin that integrates Intlayer into the Angular (or any esbuild-based) build process.\n *\n * Handles:\n * 1. Injecting `alias` entries so `@intlayer/dictionaries-entry` etc. resolve to\n *    the generated files under `.intlayer/`.\n * 2. Defining `process.env.*` tree-shaking constants for production builds.\n * 3. Running `prepareIntlayer` (dictionary generation) before the first build.\n * 4. Starting the chokidar file-watcher in dev / serve mode.\n *\n * Compatible with:\n * - `@angular-builders/custom-esbuild` (`application` or `browser-esbuild` builder)\n * - NX `@nx/angular:browser-esbuild`\n * - Any raw esbuild setup that accepts the standard `Plugin` interface\n *\n * @example\n * ```ts\n * // esbuild.plugins.ts  (referenced from angular.json \"plugins\" option)\n * import { intlayerEsbuildPlugin } from 'angular-intlayer/esbuild';\n * export default [intlayerEsbuildPlugin()];\n * ```\n */\nexport const intlayerEsbuildPlugin = (\n  options?: IntlayerEsbuildPluginOptions\n): EsbuildPlugin => {\n  // All Node.js-heavy initialization (getConfiguration, getAlias, …) is deferred\n  // into setup() so it runs in esbuild's Node.js context, not at module-evaluation\n  // time. @angular/build loads the plugin file through Vite's SSR module runner\n  // (ESM) where CommonJS globals like __filename are undefined. Calling\n  // getConfiguration() here would trigger: buildSync → worker threads →\n  // __filename → ReferenceError, crashing the plugin before setup() ever runs.\n  let config: ReturnType<typeof getConfiguration> | null = null;\n  let alias: Record<string, string> | null = null;\n\n  // Shared across parallel setup() calls (Angular spawns one per bundle context).\n  let preparePromise: Promise<void> | null = null;\n  let watcherStarted = false;\n  // Once any esbuild context (browser or server) detects a production build,\n  // suppress the watcher for all contexts so `ng build` can exit cleanly.\n  let isBuildMode = false;\n\n  return {\n    name: 'intlayer',\n\n    async setup(build) {\n      if (!config) {\n        const baseDir =\n          build.initialOptions.absWorkingDir ??\n          options?.configOptions?.baseDir ??\n          process.cwd();\n\n        config = getConfiguration({ baseDir, ...options?.configOptions });\n        logConfigDetails({ baseDir, ...options?.configOptions });\n\n        alias = getAlias({\n          configuration: config,\n          formatter: (value: string) => join(config!.system.baseDir, value),\n        });\n      }\n\n      const appLogger = getAppLogger(config);\n      const nodeEnvDefine =\n        build.initialOptions.define?.['process.env.NODE_ENV'];\n\n      // Angular's esbuild builder doesn't set `minify` or `process.env.NODE_ENV`\n      // on initialOptions — it handles optimisation through its own pipeline.\n      // Instead, Angular defines `ngDevMode` as `\"false\"` in production builds.\n      const isProduction =\n        nodeEnvDefine === '\"production\"' ||\n        nodeEnvDefine === \"'production'\" ||\n        build.initialOptions.minify === true ||\n        build.initialOptions.define?.['ngDevMode'] === 'false';\n\n      if (isProduction) {\n        isBuildMode = true;\n      }\n\n      const wrapKey = (key: string) => `process.env.${key}`;\n      const wrapValue = (value: string) => `\"${value}\"`;\n\n      const envVars: Record<string, string> = {\n        // Catch-all so that any `process.env.*` read NOT covered by a specific\n        // key below resolves to `undefined` instead of dereferencing a bare\n        // `process`, which is not defined in browser bundles and throws\n        // `process is not defined`. esbuild resolves the most specific define\n        // first, so the keys below keep their tree-shaking effect.\n        'process.env': '{}',\n        [wrapKey('INTLAYER')]: wrapValue('true'),\n        [wrapKey('NODE_ENV')]: wrapValue(\n          isProduction ? 'production' : 'development'\n        ),\n        // Tree shaking flags derived from the config (routing / storage /\n        // editor). Emitted in every mode so behaviour is consistent in dev.\n        ...getConfigEnvVars(config, wrapKey, wrapValue),\n      };\n\n      if (isProduction) {\n        const dictionaries = getDictionaries(config);\n        if (Object.keys(dictionaries).length === 0) {\n          appLogger('No dictionaries found. Please check your configuration.', {\n            isVerbose: true,\n          });\n        }\n\n        const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n        Object.assign(\n          envVars,\n          // Tree shaking based on unused node types\n          formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n          // Tree shaking the dictionary selector logic\n          // (collections / variants)\n          formatDictionarySelectorEnvVar(\n            getHasDictionarySelector(dictionaries),\n            wrapKey,\n            wrapValue\n          )\n        );\n      }\n\n      // Existing defines (Angular's own, or the user's angular.json `define`\n      // block) take precedence over the Intlayer ones.\n      build.initialOptions.define = {\n        ...envVars,\n        ...(build.initialOptions.define ?? {}),\n      };\n\n      build.initialOptions.alias = {\n        ...alias,\n        ...(build.initialOptions.alias ?? {}),\n      };\n\n      for (const [from, to] of Object.entries(alias!)) {\n        const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n        build.onResolve({ filter: new RegExp(`^${escapedFrom}$`) }, () => ({\n          path: to,\n        }));\n      }\n\n      // Angular's dev server marks every import that resolves under\n      // `node_modules` as external so Vite can pre-bundle it. Vite's\n      // pre-bundler runs without this plugin, so the aliases above never apply\n      // there and the real `@intlayer/config/built` — a Node config loader —\n      // ends up in the browser. Angular's externalising plugin is registered\n      // ahead of this one and only lets a resolution through when the path it\n      // gets back is outside `node_modules`; so in that mode an Intlayer\n      // package resolves to a re-export shim in its own namespace, whose\n      // relative import of the real file the pipeline then bundles as usual.\n      // Whether the pipeline externalises packages is probed once, at the\n      // first build, so production builds keep the bundler's own resolution.\n      let externalizesPackages: boolean | undefined;\n\n      build.onResolve({ filter: INTLAYER_PACKAGE_FILTER }, (args) => {\n        if (!externalizesPackages || !args.resolveDir) return null;\n\n        const importCondition = args.kind.startsWith('require')\n          ? 'require'\n          : 'import';\n        const resolved = resolvePackageExport(args.path, args.resolveDir, [\n          'browser',\n          'module',\n          importCondition,\n        ]);\n\n        if (!resolved) return null;\n\n        return {\n          // Neither a `node_modules` segment nor a script extension, which the\n          // externalising plugin and Angular's own JS loader key on. Ends with\n          // the specifier so a lazy chunk is named after it, and starts with\n          // the encoded directory so two copies of a package stay distinct.\n          path: `${encodeURIComponent(dirname(resolved.path))}/${args.path}`,\n          namespace: INTLAYER_PACKAGE_NAMESPACE,\n          pluginData: { realPath: resolved.path },\n          sideEffects: resolved.sideEffects,\n        };\n      });\n\n      build.onLoad(\n        { filter: /.*/, namespace: INTLAYER_PACKAGE_NAMESPACE },\n        async (args) => {\n          const { realPath } = args.pluginData as { realPath: string };\n          const source = await readFile(realPath, 'utf-8');\n          const specifier = JSON.stringify(`./${basename(realPath)}`);\n\n          const contents = [\n            `export * from ${specifier};`,\n            DEFAULT_EXPORT_PATTERN.test(source) &&\n              `export { default } from ${specifier};`,\n          ]\n            .filter(Boolean)\n            .join('\\n');\n\n          return { contents, loader: 'js', resolveDir: dirname(realPath) };\n        }\n      );\n\n      // Dictionaries load with the chunk that needs them rather than being\n      // fetched once that chunk renders: the entry point starts the browsing\n      // locale's load as it evaluates, so a lazily loaded route requests its\n      // content on `import()` instead of on first render. Without it every\n      // dictionary read renders an empty placeholder first and fills in a tick\n      // later.\n      //\n      // Not gated on the configured `importMode`: a `.content` file can set\n      // `importMode: 'dynamic'` on a single dictionary under a `static` or\n      // `fetch` global mode, and that dictionary needs the preload just the\n      // same. Only entry points the optimizer imported are ever loaded, so the\n      // path check below is the accurate gate.\n      if (config.build.dictionariesPreload) {\n        const dynamicDictionariesDir = normalizePath(\n          config.system.dynamicDictionariesDir\n        );\n\n        build.onLoad(\n          { filter: createDynamicEntryFilter(dynamicDictionariesDir) },\n          async ({ path }) => {\n            const posixPath = normalizePath(path);\n            if (!posixPath.startsWith(`${dynamicDictionariesDir}/`))\n              return null;\n\n            const code = await readFile(path, 'utf-8');\n            const result = addDynamicEntryPreload(code, preloadModuleId);\n\n            if (result.skipped) return null;\n\n            return { contents: result.code, loader: 'js' };\n          }\n        );\n      }\n\n      if (!preparePromise) {\n        preparePromise = prepareIntlayer(config, {\n          clean: isProduction,\n          cacheTimeoutMs: isProduction ? 1000 * 30 : 1000 * 60 * 60,\n          env: isProduction ? 'prod' : 'dev',\n        });\n      }\n\n      await preparePromise;\n\n      build.onStart(async () => {\n        // `@angular/core` is always installed and never worth excluding from\n        // pre-bundling, so its fate tells whether packages get externalised.\n        if (externalizesPackages === undefined) {\n          externalizesPackages = (\n            await build.resolve('@angular/core', {\n              kind: 'import-statement',\n              resolveDir: config!.system.baseDir,\n            })\n          ).external;\n\n          if (externalizesPackages) {\n            warnAboutHiddenTypesDirectory(config!, appLogger);\n          }\n        }\n\n        // Determine whether the watcher should run:\n        // 1. Explicit option from the caller takes precedence\n        // 2. If any esbuild context detected a production build, skip\n        // 3. esbuild's own watch mode is a positive signal\n        const shouldWatch = options?.watch ?? !isBuildMode;\n\n        if (shouldWatch && !watcherStarted) {\n          watcherStarted = true;\n\n          await watch({ configuration: config! });\n        }\n      });\n    },\n  };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAM,sBAAkBA,0CACtBC,+DAAuBC,wEAA6B,CAAC,CACvD;;AAGA,MAAM,0BACJ;;AAGF,MAAM,6BAA6B;;AAGnC,MAAM,yBACJ;;;;;;;AAmGF,MAAM,iCACJ,eACA,cACG;CACH,MAAM,EAAE,SAAS,UAAU,0BAA0B,cAAc;CAEnE,MAAM,oBAAoB,CACxB,mBAAG,IAAI,IAAI,CAAC,UAAU,qBAAqB,CAAC,CAC9C,CAAC,CAAC,QAAQ,cAAcC,oDAAoB,SAAS,SAAS,CAAC;CAE/D,IAAI,kBAAkB,WAAW,GAAG;CAEpC,UACE;EACE,yCAAyC,kBAAkB,KAAK,kBAAcC,oBAAS,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;EACvH;EACA;CACF,CAAC,CAAC,KAAK,GAAG,GACV,EAAE,OAAO,OAAO,CAClB;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,yBACX,YACkB;CAOlB,IAAI,SAAqD;CACzD,IAAI,QAAuC;CAG3C,IAAI,iBAAuC;CAC3C,IAAI,iBAAiB;CAGrB,IAAI,cAAc;CAElB,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,OAAO;GACjB,IAAI,CAAC,QAAQ;IACX,MAAM,UACJ,MAAM,eAAe,iBACrB,SAAS,eAAe,WACxB,QAAQ,IAAI;IAEd,aAASC,wCAAiB;KAAE;KAAS,GAAG,SAAS;IAAc,CAAC;IAChE,2CAAiB;KAAE;KAAS,GAAG,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