npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@connectiv-ms/conflux

v1.2.13

Published

Preprocess webresource files before upload. Merge JS files using triple-slash references.

Downloads

3

Readme

conFlux

A convergence or moving gathering of forces, people, or things. [1]

Table of Contents

Usage

conFlux is the first tool in the legacy JS Buildchain at connectiv. It will make sure, that all of the source files end up in the right output directory and resolve all valid Triple-Slash Directives in JS files that it finds along the way.

Merging is required to avoid issues with the unordered loading of webresources in dynamics. Scripts that require their dependencies to be loaded before they are executed may run into issues if the dependencies are not yet fetched. To counteract this, all dependencies are bundled together with the script in a single file.

The JavaScriptMerger also handles other webresource filetypes (e.g. .htm, .html and .css), which are simply copied to the output directory.

Declaring Dependencies

Inside of JS files, you can use Triple-Slash Directives like this:

/// <reference path="path/to/your/dependency.js"/>

If you need to include a triple-slash directive that does not need merging, you can add an ignoreMerge="true" attribute to the reference.

/// <reference path="path/to/your/dependency.js" ignoreMerge="true"/>

Be aware, that there are a couple of caveats:

  • You can only link to other JS files.
  • References will only be resolved in your root script, meaning that if you declare a reference inside of a script that is a dependency, it will not be resolved. There is an option (-recursiveResolution) to change this behavior after version 1.1.
  • Reference paths will by default be resolved according to the <SourceDirectory>. This behavior can be overridden with the option -relativeReferences. This may become the default going forward, after it has been proven, that this behavior does not cause unwanted breaking side-effects in legacy projects.

Executing the Tool

You can run the tool through a terminal using the following syntax

conflux <SourceDirectory> <OutputDirectory> [Options]

You may use arguments and options to alter the default behavior.

conflux ./Scripts/src ./Scripts/bin/ -v --recursiveResolution --relativeReferences

conflux --legacy

For using this tool in a script, direct execution via npm is recommended.

npx @connectiv-ms/conflux <SourceDirectory> <OutputDirectory> [Options]

Arguments

| Argument | Position | Required | Description | Default | | ----------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | | <SourceDirectory> | 1 | Optional | Path to folder where the script files are located. Only files in this folder are taken into account.Files in nested folders can only be addressed through references. | Scripts | | <OutputDirectory> | 2 | Optional | Path to the folder where the output files should be placed.Be aware that using this argument makes the arguments with a lower position required. | Scripts/bin/Debug/Debug |

Options

The tool does not necessarily need options to run, but if you need to override the default behavior, you can do so by supplying the options described in the table below. Some options offer a shorthand, which can be used via -x <value>. The full option name can be supplied via --fullName <value>. For boolean options, the value can be omitted.

| Option | Shorthand | Type | Description | Default | | --------------------- | --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | verbose | v | boolean | Will print detailed information for each processed file if available. | false | | legacy | | boolean | In case the new version causes any issues, you can run the legacy v1.0 version instead. | false | | recursiveResolution | | boolean | By default, dependencies are only resolved for the top-level scripts. This flag enables the recursive resolution of dependencies. | false | | relativeReferences | | boolean | By default, dependencies are always resolved according to the <SourceDirectory>. Passing this flag, will base the resolution on the path of the currently processed file.This might change to default behavior if it can be proven that due to the single-level resolution this problem will never occur. | false |

Installation

This tool can either be installed as a dotnet tool or as an NPM package. Please make sure that you only install it via one of these two methods.

dotnet tool

This tool can be installed as a dotnet tool from the ConNuget Artifacts Feed via the following command:

dotnet tool install -g conflux

NPM

This tool can be installed as an NPM package via the following command:

npm install -g conflux