Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .devcontainer/devcontainer.json

This file was deleted.

12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
- package-ecosystem: 'devcontainers'
directory: '/'
schedule:
interval: weekly
commit-message:
prefix: "chore(deps/devcon):"
prefix: 'chore(deps/devcon):'
open-pull-requests-limit: 4

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: daily
commit-message:
prefix: "chore(deps/actions):"
prefix: 'chore(deps/actions):'
open-pull-requests-limit: 4
28 changes: 18 additions & 10 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Node.js CI

on:
push:
branches: [ main ]
branches: [main]
paths:
- .github/workflows/node.yml
- libs/*
- package.json
- package-lock.json
pull_request:
branches: [ main ]
branches: [main]
paths:
- .github/workflows/node.yml
- libs/*
Expand All @@ -22,16 +22,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install Node.js (latest)
uses: actions/setup-node@v6
with:
node-version: latest
cache: 'npm'
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Lint
run: npm run lint
run: pnpm run lint

build-library:
name: build (${{ matrix.workspace }})
Expand Down Expand Up @@ -60,14 +64,18 @@ jobs:
- node-webpack-ts-esm
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install Node.js (latest)
uses: actions/setup-node@v6
with:
node-version: latest
cache: 'npm'
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Build library, run publint
working-directory: ./libs/${{ matrix.workspace }}
run: npm run publint
run: pnpm run publint
8 changes: 8 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [],
"useTabs": true,
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
144 changes: 144 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["unicorn", "typescript", "oxc"],
"categories": {},
"rules": {
"constructor-super": "warn",
"for-direction": "warn",
"no-async-promise-executor": "warn",
"no-caller": "warn",
"no-class-assign": "warn",
"no-compare-neg-zero": "warn",
"no-cond-assign": "warn",
"no-const-assign": "warn",
"no-constant-binary-expression": "warn",
"no-constant-condition": "warn",
"no-control-regex": "warn",
"no-debugger": "warn",
"no-delete-var": "warn",
"no-dupe-class-members": "warn",
"no-dupe-else-if": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-empty-character-class": "warn",
"no-empty-pattern": "warn",
"no-empty-static-block": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extra-boolean-cast": "warn",
"no-func-assign": "warn",
"no-global-assign": "warn",
"no-import-assign": "warn",
"no-invalid-regexp": "warn",
"no-irregular-whitespace": "warn",
"no-loss-of-precision": "warn",
"no-new-native-nonconstructor": "warn",
"no-nonoctal-decimal-escape": "warn",
"no-obj-calls": "warn",
"no-self-assign": "warn",
"no-setter-return": "warn",
"no-shadow-restricted-names": "warn",
"no-sparse-arrays": "warn",
"no-this-before-super": "warn",
"no-unassigned-vars": "warn",
"no-unsafe-finally": "warn",
"no-unsafe-negation": "warn",
"no-unsafe-optional-chaining": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-unused-private-class-members": "warn",
"no-unused-vars": "warn",
"no-useless-backreference": "warn",
"no-useless-catch": "warn",
"no-useless-escape": "warn",
"no-useless-rename": "warn",
"no-with": "warn",
"require-yield": "warn",
"use-isnan": "warn",
"valid-typeof": "warn",
"oxc/bad-array-method-on-arguments": "warn",
"oxc/bad-char-at-comparison": "warn",
"oxc/bad-comparison-sequence": "warn",
"oxc/bad-min-max-func": "warn",
"oxc/bad-object-literal-comparison": "warn",
"oxc/bad-replace-all-arg": "warn",
"oxc/const-comparisons": "warn",
"oxc/double-comparisons": "warn",
"oxc/erasing-op": "warn",
"oxc/missing-throw": "warn",
"oxc/number-arg-out-of-range": "warn",
"oxc/only-used-in-recursion": "warn",
"oxc/uninvoked-array-callback": "warn",
"typescript/await-thenable": "warn",
"typescript/no-array-delete": "warn",
"typescript/no-base-to-string": "warn",
"typescript/no-duplicate-enum-values": "warn",
"typescript/no-duplicate-type-constituents": "warn",
"typescript/no-extra-non-null-assertion": "warn",
"typescript/no-floating-promises": "warn",
"typescript/no-for-in-array": "warn",
"typescript/no-implied-eval": "warn",
"typescript/no-meaningless-void-operator": "warn",
"typescript/no-misused-new": "warn",
"typescript/no-misused-spread": "warn",
"typescript/no-non-null-asserted-optional-chain": "warn",
"typescript/no-redundant-type-constituents": "warn",
"typescript/no-this-alias": "warn",
"typescript/no-unnecessary-parameter-property-assignment": "warn",
"typescript/no-unsafe-declaration-merging": "warn",
"typescript/no-unsafe-unary-minus": "warn",
"typescript/no-useless-empty-export": "warn",
"typescript/no-wrapper-object-types": "warn",
"typescript/prefer-as-const": "warn",
"typescript/require-array-sort-compare": "warn",
"typescript/restrict-template-expressions": "warn",
"typescript/triple-slash-reference": "warn",
"typescript/unbound-method": "warn",
"unicorn/no-await-in-promise-methods": "warn",
"unicorn/no-empty-file": "warn",
"unicorn/no-invalid-fetch-options": "warn",
"unicorn/no-invalid-remove-event-listener": "warn",
"unicorn/no-new-array": "warn",
"unicorn/no-single-promise-in-promise-methods": "warn",
"unicorn/no-thenable": "warn",
"unicorn/no-unnecessary-await": "warn",
"unicorn/no-useless-fallback-in-spread": "warn",
"unicorn/no-useless-length-check": "warn",
"unicorn/no-useless-spread": "warn",
"unicorn/prefer-set-size": "warn",
"unicorn/prefer-string-starts-ends-with": "warn"
},
"settings": {
"jsx-a11y": {
"polymorphicPropName": null,
"components": {},
"attributes": {}
},
"next": {
"rootDir": []
},
"react": {
"formComponents": [],
"linkComponents": [],
"version": null
},
"jsdoc": {
"ignorePrivate": false,
"ignoreInternal": false,
"ignoreReplacesDocs": true,
"overrideReplacesDocs": true,
"augmentsExtendsReplacesDocs": false,
"implementsReplacesDocs": false,
"exemptDestructuredRootsFromChecks": false,
"tagNamePreference": {}
},
"vitest": {
"typecheck": false
}
},
"env": {
"builtin": true
},
"globals": {},
"ignorePatterns": []
}
27 changes: 7 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
# nodecitylights/ecosystem
# nc-js/ecosystem

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/neoncitylights/js-eco/.github%2Fworkflows%2Fnode.yml?style=flat-square)](https://github.com/neoncitylights/js-eco/blob/main/.github/workflows/node.yml)


A comparison of tools within the JS ecosystem. It aims to compare/evaluate the following:

- How the JavaScript ecosystem evolves over time
- The most reasonable, minimal configuration setup for a given toolchain
- A reasonable, minimal configuration setup for a given toolchain
- Compile & transpilation time
- Compression/minification of code, compression time
- For applications: Hot module reloading (HMR) time


## Develop locally

```shell
git clone https://github.com/neoncitylights/js-eco.git
git clone https://github.com/nc-js/ecosystem.git
cd js-eco
npm install --save-exact --save-dev
npm run build
pnpm install
pnpm run build
```

## Structure

At the moment, the top-level directories include:

- `/tests/unit/`: Comparison of unit testing frameworks
- `/tests/e2e/`: Comparison of e2e testing frameworks
- `/libs`: Comparison of build tools for creating distributable libraries
- `/apps`: Comparison of web frameworks for creating web applications
- `/fmtlint`: Comparison of formatting and linting tools

Each subdirectory name in the repository generally follows the naming convention below:

Expand All @@ -41,15 +37,6 @@ Each subdirectory name in the repository generally follows the naming convention
- `{{language}}`: JavaScript language. Choices: `ts`, `js`
- `{{module-system}}`: JavaScript module resolution strategy. Choices: `esm`, `cjs`, `umd`, `amd`

## Types of tools

- **Minifier**: A tool that optimizes source code through methods like removing whitespace, shortening names of variables and arguments, etc. A modern bundler will also automatically minify.
- **Bundler**: A tool that optimizes source code and its dependencies by turning it into a single file. Bundlers help performance by reducing the amount of network requests and reducing the request load size.
- **Transpiler**: A compiler that, given some source code, will apply certain transformations and reproduce source code in the same or different language. For example, Babel.js can transpile ES2022 code to an older ES-level for wider cross-browser compatibility, such as ES2015. TypeScript is also capable of transpiling.
- **Unit testing**: Unit testing involves ensuring a certain output for a given input, for the smallest testable parts of some code. Some popular testing frameworks include Vitest and Jest.
- **E2E testing**: E2E (end-to-end) testing involves testing an application from start to finish to simulate real-life user scenarios. In the JS context, this typically involves spinning up a headless browser instance and testing against the instance.
- **Benchmarking**: Benchmarking is another name for perfomance testing, which involves measuring the speed of some piece of code in a controlled environment. A benchmarker will typically include statistical measures such as standard deviations and regressions to make sure the benchmarks give accurate reports.

## Questions and answers

- **Why do pure JS libraries still include TypeScript as a developer dependency?**: While the source code may not be written in TypeScript, TypeScript is responsible for generating [declaration files](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction) (`.d.ts`) during the build process to provide types.
Expand Down
60 changes: 0 additions & 60 deletions eslint.config.js

This file was deleted.

Loading