{"version":3,"file":"pack-externals.mjs","names":["fse"],"sources":["../../src/pack-externals.ts"],"sourcesContent":["import assert from 'assert';\nimport path from 'path';\nimport fse from 'fs-extra';\nimport * as R from 'ramda';\n\nimport { getPackager } from './packagers';\nimport { findProjectRoot, findUp } from './utils';\nimport type SwcServerlessPlugin from './index';\nimport type { JSONObject, PackageJSON } from './types';\nimport { assertIsString } from './helper';\n\nfunction rebaseFileReferences(pathToPackageRoot: string, moduleVersion: string) {\n  if (/^(?:file:[^/]{2}|\\.\\/|\\.\\.\\/)/.test(moduleVersion)) {\n    const filePath = R.replace(/^file:/, '', moduleVersion);\n\n    return R.replace(\n      /\\\\/g,\n      '/',\n      `${R.startsWith('file:', moduleVersion) ? 'file:' : ''}${pathToPackageRoot}/${filePath}`\n    );\n  }\n\n  return moduleVersion;\n}\n\n/**\n * Add the given modules to a package json's dependencies.\n */\nfunction addModulesToPackageJson(externalModules: string[], packageJson: JSONObject, pathToPackageRoot: string) {\n  R.forEach((externalModule) => {\n    const splitModule = R.split('@', externalModule);\n\n    // If we have a scoped module we have to re-add the @\n    if (R.startsWith('@', externalModule)) {\n      splitModule.splice(0, 1);\n      splitModule[0] = `@${splitModule[0]}`;\n    }\n\n    const dependencyName = R.head(splitModule);\n\n    if (!dependencyName) {\n      return;\n    }\n\n    // We have to rebase file references to the target package.json\n    const moduleVersion = rebaseFileReferences(pathToPackageRoot, R.join('@', R.tail(splitModule)));\n\n    // eslint-disable-next-line no-param-reassign\n    packageJson.dependencies = packageJson.dependencies || {};\n    // eslint-disable-next-line no-param-reassign\n    packageJson.dependencies[dependencyName] = moduleVersion;\n  }, externalModules);\n}\n\n/**\n * Resolve the needed versions of production dependencies for external modules.\n * @this - The active plugin instance\n */\nfunction getProdModules(\n  this: SwcServerlessPlugin,\n  externalModules: { external: string }[],\n  packageJsonPath: string,\n  rootPackageJsonPath: string\n) {\n  const packageJson = this.serverless.utils.readFileSync(packageJsonPath) as PackageJSON;\n\n  // only process the module stated in dependencies section\n  if (!packageJson.dependencies) {\n    return [];\n  }\n\n  const prodModules: string[] = [];\n\n  // Get versions of all transient modules\n  // eslint-disable-next-line max-statements\n  R.forEach((externalModule) => {\n    // (1) If not present in Dev Dependencies or Dependencies\n    if (\n      !packageJson.dependencies?.[externalModule.external] &&\n      !packageJson.devDependencies?.[externalModule.external]\n    ) {\n      this.log.debug(\n        `INFO: Runtime dependency '${externalModule.external}' not found in dependencies or devDependencies. It has been excluded automatically.`\n      );\n\n      return;\n    }\n\n    // (2) If present in Dev Dependencies\n    if (\n      !packageJson.dependencies?.[externalModule.external] &&\n      packageJson.devDependencies?.[externalModule.external]\n    ) {\n      // To minimize the chance of breaking setups we whitelist packages available on AWS here. These are due to the previously missing check\n      // most likely set in devDependencies and should not lead to an error now.\n      const ignoredDevDependencies = ['aws-sdk'];\n\n      if (!R.includes(externalModule.external, ignoredDevDependencies)) {\n        // Runtime dependency found in devDependencies but not forcefully excluded\n        this.log.error(`ERROR: Runtime dependency '${externalModule.external}' found in devDependencies.`);\n\n        // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n        // @ts-ignore Serverless typings (as of v3.0.2) are incorrect\n        throw new this.serverless.classes.Error(`Serverless-webpack dependency error: ${externalModule.external}.`);\n      }\n\n      this.log.debug(\n        `INFO: Runtime dependency '${externalModule.external}' found in devDependencies. It has been excluded automatically.`\n      );\n\n      return;\n    }\n\n    // (3) otherwise let's get the version\n\n    // get module package - either from root or local node_modules - will be used for version and peer deps\n    const rootModulePackagePath = path.join(\n      path.dirname(rootPackageJsonPath),\n      'node_modules',\n      externalModule.external,\n      'package.json'\n    );\n\n    const localModulePackagePath = path.join(\n      process.cwd(),\n      path.dirname(packageJsonPath),\n      'node_modules',\n      externalModule.external,\n      'package.json'\n    );\n\n    // eslint-disable-next-line no-nested-ternary\n    const modulePackagePath = fse.pathExistsSync(localModulePackagePath)\n      ? localModulePackagePath\n      : fse.pathExistsSync(rootModulePackagePath)\n      ? rootModulePackagePath\n      : null;\n\n    const modulePackage: Partial<PackageJSON> = modulePackagePath ? require(modulePackagePath) : {};\n\n    // Get version\n    const moduleVersion = packageJson.dependencies?.[externalModule.external] || modulePackage.version;\n\n    // add dep with version if we have it - versionless otherwise\n    prodModules.push(moduleVersion ? `${externalModule.external}@${moduleVersion}` : externalModule.external);\n\n    // Check if the module has any peer dependencies and include them too\n    try {\n      // find peer dependencies but remove optional ones and excluded ones\n      const peerDependencies = modulePackage.peerDependencies as Record<string, string>;\n      const optionalPeerDependencies = Object.keys(\n        R.pickBy((val) => val.optional, modulePackage.peerDependenciesMeta || {})\n      );\n\n      assert(this.buildOptions, 'buildOptions not defined');\n\n      const peerDependenciesWithoutOptionals = R.omit(\n        [...optionalPeerDependencies, ...this.buildOptions.exclude],\n        peerDependencies\n      );\n\n      if (!R.isEmpty(peerDependenciesWithoutOptionals)) {\n        this.log.debug(`Adding explicit non-optionals peers for dependency ${externalModule.external}`);\n        const peerModules = getProdModules.call(\n          this,\n          R.compose(\n            R.map(([external]) => ({ external })),\n            R.toPairs\n          )(peerDependenciesWithoutOptionals),\n          packageJsonPath,\n          rootPackageJsonPath\n        );\n\n        Array.prototype.push.apply(prodModules, peerModules);\n      }\n    } catch (error) {\n      this.log.warning(`WARNING: Could not check for peer dependencies of ${externalModule.external}`);\n    }\n  }, externalModules);\n\n  return prodModules;\n}\n\nexport function nodeExternalsPluginUtilsPath(): string | undefined {\n  return undefined;\n}\n\n/**\n * We need a performant algorithm to install the packages for each single\n * function (in case we package individually).\n * (1) We fetch ALL packages needed by ALL functions in a first step\n * and use this as a base npm checkout. The checkout will be done to a\n * separate temporary directory with a package.json that contains everything.\n * (2) For each single compile we copy the whole node_modules to the compile\n * directory and create a (function) compile specific package.json and store\n * it in the compile directory. Now we start npm again there, and npm will just\n * remove the superfluous packages and optimize the remaining dependencies.\n * This will utilize the npm cache at its best and give us the needed results\n * and performance.\n */\n// eslint-disable-next-line max-statements\nexport async function packExternalModules(this: SwcServerlessPlugin) {\n  assert(this.buildOptions, 'buildOptions not defined');\n\n  const upperPackageJson = findUp('package.json');\n\n  const externals: string[] =\n    Array.isArray(this.buildOptions.external) &&\n    this.buildOptions.exclude !== '*' &&\n    !this.buildOptions.exclude.includes('*')\n      ? R.without(this.buildOptions.exclude, this.buildOptions.external)\n      : [];\n\n  if (!externals.length) {\n    return;\n  }\n\n  // Read plugin configuration\n  // get the root package.json by looking up until we hit a lockfile\n  // if this is a yarn workspace, it will be the monorepo package.json\n  const rootPackageJsonPath = path.join(findProjectRoot() || '', './package.json');\n  // get the local package.json by looking up until we hit a package.json file\n  // if this is *not* a yarn workspace, it will be the same as rootPackageJsonPath\n  const packageJsonPath =\n    this.buildOptions.packagePath ||\n    (upperPackageJson && path.relative(process.cwd(), path.join(upperPackageJson, './package.json')));\n\n  assert(packageJsonPath, 'packageJsonPath is not defined');\n\n  // Determine and create packager\n  const packager = await getPackager.call(this, this.buildOptions.packager, this.buildOptions.packagerOptions);\n\n  // Fetch needed original package.json sections\n  const sectionNames = packager.copyPackageSectionNames;\n\n  type ScriptsRecord = Record<`script${number}`, string>;\n\n  // Get scripts from packager options\n  const packagerScripts: ScriptsRecord =\n    typeof this.buildOptions.packagerOptions?.scripts !== 'undefined'\n      ? (Array.isArray(this.buildOptions.packagerOptions.scripts)\n          ? this.buildOptions.packagerOptions.scripts\n          : [this.buildOptions.packagerOptions.scripts]\n        ).reduce<ScriptsRecord>((scripts, script, index) => {\n          // eslint-disable-next-line no-param-reassign\n          scripts[`script${index}`] = script;\n\n          return scripts;\n        }, {})\n      : {};\n\n  const rootPackageJson: Record<string, unknown> = this.serverless.utils.readFileSync(rootPackageJsonPath);\n\n  const isWorkspace = !!rootPackageJson.workspaces;\n\n  const packageJson: Record<string, unknown> = isWorkspace\n    ? (packageJsonPath && this.serverless.utils.readFileSync(packageJsonPath)) || {}\n    : rootPackageJson;\n\n  const packageSections = R.pick(sectionNames, packageJson);\n\n  if (!R.isEmpty(packageSections)) {\n    this.log.debug(`Using package.json sections ${R.join(', ', R.keys(packageSections))}`);\n  }\n\n  // Get first level dependency graph\n  this.log.debug(`Fetch dependency graph from ${packageJson}`);\n\n  // (1) Generate dependency composition\n  const externalModules = R.map((external) => ({ external }), externals);\n  const compositeModules: JSONObject = R.uniq(\n    getProdModules.call(this, externalModules, packageJsonPath, rootPackageJsonPath)\n  );\n\n  if (R.isEmpty(compositeModules)) {\n    // The compiled code does not reference any external modules at all\n    this.log.warning('No external modules needed');\n\n    return;\n  }\n\n  // (1.a) Install all needed modules\n  const compositeModulePath = this.buildDirPath;\n\n  assertIsString(compositeModulePath, 'compositeModulePath is not a string');\n\n  const compositePackageJson = path.join(compositeModulePath, 'package.json');\n\n  // (1.a.1) Create a package.json\n  const compositePackage = R.mergeRight(\n    {\n      name: this.serverless.service.service,\n      version: '1.0.0',\n      description: `Packaged externals for ${this.serverless.service.service}`,\n      private: true,\n      scripts: packagerScripts,\n    },\n    packageSections\n  );\n  const relativePath = path.relative(compositeModulePath, path.dirname(packageJsonPath));\n\n  addModulesToPackageJson(compositeModules, compositePackage, relativePath);\n  this.serverless.utils.writeFileSync(compositePackageJson, JSON.stringify(compositePackage, null, 2));\n\n  // (1.a.2) Copy package-lock.json if it exists, to prevent unwanted upgrades\n  const packageLockPath = path.join(process.cwd(), path.dirname(packageJsonPath), packager.lockfileName);\n  const exists = await fse.pathExists(packageLockPath);\n\n  if (exists) {\n    this.log.verbose('Package lock found - Using locked versions');\n    try {\n      let packageLockFile = this.serverless.utils.readFileSync(packageLockPath);\n\n      packageLockFile = packager.rebaseLockfile(relativePath, packageLockFile);\n      if (R.is(Object)(packageLockFile)) {\n        packageLockFile = JSON.stringify(packageLockFile, null, 2);\n      }\n\n      this.serverless.utils.writeFileSync(\n        path.join(compositeModulePath, packager.lockfileName),\n        packageLockFile as string\n      );\n    } catch (error) {\n      this.log.warning(`Warning: Could not read lock file${error instanceof Error ? `: ${error.message}` : ''}`);\n    }\n  }\n\n  // GOOGLE: Copy modules only if not google-cloud-functions\n  // GCF Auto installs the package json\n  if (R.path(['service', 'provider', 'name'], this.serverless) === 'google') {\n    return;\n  }\n\n  const start = Date.now();\n\n  this.log.verbose(`Packing external modules: ${compositeModules.join(', ')}`);\n  const { installExtraArgs } = this.buildOptions;\n\n  await packager.install(compositeModulePath, installExtraArgs, exists);\n  this.log.debug(`Package took [${Date.now() - start} ms]`);\n\n  // Prune extraneous packages - removes not needed ones\n  const startPrune = Date.now();\n\n  await packager.prune(compositeModulePath);\n\n  this.log.debug(`Prune: ${compositeModulePath} [${Date.now() - startPrune} ms]`);\n\n  assertIsString(this.buildDirPath, 'buildDirPath is not a string');\n\n  // Run packager scripts\n  if (Object.keys(packagerScripts).length > 0) {\n    const startScripts = Date.now();\n\n    await packager.runScripts(this.buildDirPath, Object.keys(packagerScripts));\n\n    this.log.debug(\n      `Packager scripts took [${Date.now() - startScripts} ms].\\nExecuted scripts: ${Object.values(packagerScripts).map(\n        (script) => `\\n  ${script}`\n      )}`\n    );\n  }\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAS,qBAAqB,mBAA2B,eAAuB;AAC9E,KAAI,gCAAgC,KAAK,cAAc,EAAE;EACvD,MAAM,WAAW,EAAE,QAAQ,UAAU,IAAI,cAAc;AAEvD,SAAO,EAAE,QACP,OACA,KACA,GAAG,EAAE,WAAW,SAAS,cAAc,GAAG,UAAU,KAAK,kBAAkB,GAAG,WAC/E;;AAGH,QAAO;;;;;AAMT,SAAS,wBAAwB,iBAA2B,aAAyB,mBAA2B;AAC9G,GAAE,SAAS,mBAAmB;EAC5B,MAAM,cAAc,EAAE,MAAM,KAAK,eAAe;AAGhD,MAAI,EAAE,WAAW,KAAK,eAAe,EAAE;AACrC,eAAY,OAAO,GAAG,EAAE;AACxB,eAAY,KAAK,IAAI,YAAY;;EAGnC,MAAM,iBAAiB,EAAE,KAAK,YAAY;AAE1C,MAAI,CAAC,eACH;EAIF,MAAM,gBAAgB,qBAAqB,mBAAmB,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,CAAC,C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