Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: add NFT bundler #713

Merged
merged 11 commits into from
Oct 13, 2021
4 changes: 4 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
node-version: 10.18.0
fail-fast: false
steps:
# Increasing the maximum number of open files. See:
# https://github.com/actions/virtual-environments/issues/268
- name: Increase open file limit
run: sudo ulimit -Sn 65536
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this might need to have the shell specified sudo /bin/bash -c "ulimit -l 65536". it will only work if processes are started from same shell, which i think they will be cos it's inside the same job

- name: Git checkout
uses: actions/checkout@v2
- name: Node.js ${{ matrix.node }}
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,6 @@ JSON-formatted string with the following properties:

Maximum number of functions to bundle at the same time.

#### `repositoryRoot`

- _Type_: `string`
- _Default value_: The value of `basePath`

The path of the project's repository root. This defines the boundary where Node modules can be found. It usually is the
same value as the `basePath` property, but may be a parent directory in the case of a monorepo setup.

### Return value

This returns a `Promise` resolving to an array of objects describing each archive. Every object has the following
Expand Down
24 changes: 24 additions & 0 deletions benchmarks/nft.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { join } = require('path')

const { zipFunctions } = require('../dist/main')

const { timeFunction } = require('./helpers/main')

const BENCHMARK_OUTPUT = 'benchmarks/output'
const RUNS = 3

const runBenchmarks = async function () {
const func = join(__dirname, 'fixtures')

const largeDepsNft = await timeFunction(
() =>
zipFunctions(func, BENCHMARK_OUTPUT, {
config: { '*': { nodeBundler: 'nft' } },
}),
RUNS,
)

console.log(`${largeDepsNft}ms`)
}

runBenchmarks()
1 change: 1 addition & 0 deletions benchmarks/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
npm ci --prefix benchmarks/fixtures
npm run build
node benchmarks/nft.js > .delta.largeDepsNft
node benchmarks/zisi.js > .delta.largeDepsZisi
node benchmarks/esbuild.js > .delta.largeDepsEsbuild