aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
commit6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch)
treec1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js95
1 files changed, 0 insertions, 95 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js b/sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js
deleted file mode 100644
index 0d3a00d9..00000000
--- a/sandbox/testAppNevena/Front/node_modules/pacote/lib/dir.js
+++ /dev/null
@@ -1,95 +0,0 @@
-const Fetcher = require('./fetcher.js')
-const FileFetcher = require('./file.js')
-const cacache = require('cacache')
-const Minipass = require('minipass')
-const { promisify } = require('util')
-const readPackageJson = require('read-package-json-fast')
-const tarCreateOptions = require('./util/tar-create-options.js')
-const packlist = require('npm-packlist')
-const tar = require('tar')
-const _prepareDir = Symbol('_prepareDir')
-const { resolve } = require('path')
-
-const runScript = require('@npmcli/run-script')
-
-const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved')
-class DirFetcher extends Fetcher {
- constructor (spec, opts) {
- super(spec, opts)
- // just the fully resolved filename
- this.resolved = this.spec.fetchSpec
- }
-
- // exposes tarCreateOptions as public API
- static tarCreateOptions (manifest) {
- return tarCreateOptions(manifest)
- }
-
- get types () {
- return ['directory']
- }
-
- [_prepareDir] () {
- return this.manifest().then(mani => {
- if (!mani.scripts || !mani.scripts.prepare)
- return
-
- // we *only* run prepare.
- // pre/post-pack is run by the npm CLI for publish and pack,
- // but this function is *also* run when installing git deps
- const stdio = this.opts.foregroundScripts ? 'inherit' : 'pipe'
-
- // hide the banner if loglevel is silent, or if prepare running
- // in the background.
- const banner = this.opts.log && this.opts.log.level === 'silent' ? false
- : stdio === 'inherit'
-
- return runScript({
- pkg: mani,
- event: 'prepare',
- path: this.resolved,
- stdioString: true,
- stdio,
- banner,
- env: {
- npm_package_resolved: this.resolved,
- npm_package_integrity: this.integrity,
- npm_package_json: resolve(this.resolved, 'package.json'),
- },
- })
- })
- }
-
- [_tarballFromResolved] () {
- const stream = new Minipass()
- stream.resolved = this.resolved
- stream.integrity = this.integrity
-
- // run the prepare script, get the list of files, and tar it up
- // pipe to the stream, and proxy errors the chain.
- this[_prepareDir]()
- .then(() => packlist({ path: this.resolved }))
- .then(files => tar.c(tarCreateOptions(this.package), files)
- .on('error', er => stream.emit('error', er)).pipe(stream))
- .catch(er => stream.emit('error', er))
- return stream
- }
-
- manifest () {
- if (this.package)
- return Promise.resolve(this.package)
-
- return readPackageJson(this.resolved + '/package.json')
- .then(mani => this.package = {
- ...mani,
- _integrity: this.integrity && String(this.integrity),
- _resolved: this.resolved,
- _from: this.from,
- })
- }
-
- packument () {
- return FileFetcher.prototype.packument.apply(this)
- }
-}
-module.exports = DirFetcher