update at 2026-10-12 18:55:48
This commit is contained in:
22
figma/node_modules/oxfmt/LICENSE
generated
vendored
Normal file
22
figma/node_modules/oxfmt/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
||||
Copyright (c) 2023 Boshen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
40
figma/node_modules/oxfmt/README.md
generated
vendored
Normal file
40
figma/node_modules/oxfmt/README.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<p align="center">
|
||||
<img alt="OXC Logo" src="https://raw.githubusercontent.com/oxc-project/oxc-assets/main/preview-universal.png" width="600">
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![MIT licensed][license-badge]][license-url]
|
||||
[![Build Status][ci-badge]][ci-url]
|
||||
[![Code Coverage][code-coverage-badge]][code-coverage-url]
|
||||
[![Sponsors][sponsors-badge]][sponsors-url]
|
||||
|
||||
[![Discord chat][discord-badge]][discord-url]
|
||||
[![Playground][playground-badge]][playground-url]
|
||||
|
||||
[discord-badge]: https://img.shields.io/discord/1079625926024900739?logo=discord&label=Discord
|
||||
[discord-url]: https://discord.gg/9uXCAwqQZW
|
||||
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
||||
[license-url]: https://github.com/oxc-project/oxc/blob/main/LICENSE
|
||||
[ci-badge]: https://github.com/oxc-project/oxc/actions/workflows/ci.yml/badge.svg?event=push&branch=main
|
||||
[ci-url]: https://github.com/oxc-project/oxc/actions/workflows/ci.yml?query=event%3Apush+branch%3Amain
|
||||
[npm-badge]: https://img.shields.io/npm/v/oxfmt/latest?color=brightgreen
|
||||
[npm-url]: https://www.npmjs.com/package/oxfmt/v/latest
|
||||
[code-size-badge]: https://img.shields.io/github/languages/code-size/oxc-project/oxc
|
||||
[code-size-url]: https://github.com/oxc-project/oxc
|
||||
[code-coverage-badge]: https://codecov.io/github/oxc-project/oxc/branch/main/graph/badge.svg
|
||||
[code-coverage-url]: https://codecov.io/gh/oxc-project/oxc
|
||||
[sponsors-badge]: https://img.shields.io/github/sponsors/Boshen
|
||||
[sponsors-url]: https://github.com/sponsors/Boshen
|
||||
[playground-badge]: https://img.shields.io/badge/Playground-blue?color=9BE4E0
|
||||
[playground-url]: https://oxc-playground.netlify.app
|
||||
|
||||
</div>
|
||||
|
||||
# ⚓ Oxc
|
||||
|
||||
The Oxidation Compiler is creating a suite of high-performance tools for JavaScript and TypeScript.
|
||||
|
||||
## Oxfmt
|
||||
|
||||
This is the formatter for oxc.
|
||||
149
figma/node_modules/oxfmt/bin/oxfmt
generated
vendored
Executable file
149
figma/node_modules/oxfmt/bin/oxfmt
generated
vendored
Executable file
@@ -0,0 +1,149 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const isMusl = () => {
|
||||
let musl = false;
|
||||
if (process.platform === "linux") {
|
||||
musl = isMuslFromFilesystem();
|
||||
if (musl === null) {
|
||||
musl = isMuslFromReport();
|
||||
}
|
||||
if (musl === null) {
|
||||
musl = isMuslFromChildProcess();
|
||||
}
|
||||
}
|
||||
return musl;
|
||||
};
|
||||
|
||||
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
||||
|
||||
const isMuslFromFilesystem = () => {
|
||||
const { readFileSync } = require("fs");
|
||||
try {
|
||||
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
||||
} catch(_error) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const isMuslFromReport = () => {
|
||||
const report =
|
||||
typeof process.report.getReport === "function"
|
||||
? process.report.getReport()
|
||||
: null;
|
||||
if (!report) {
|
||||
return null;
|
||||
}
|
||||
if (report.header && report.header.glibcVersionRuntime) {
|
||||
return false;
|
||||
}
|
||||
if (Array.isArray(report.sharedObjects)) {
|
||||
if (report.sharedObjects.some(isFileMusl)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const isMuslFromChildProcess = () => {
|
||||
try {
|
||||
return require("child_process")
|
||||
.execSync("ldd --version", { encoding: "utf8" })
|
||||
.includes("musl");
|
||||
} catch (e) {
|
||||
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const { platform, arch, env, version, release } = process;
|
||||
|
||||
const PLATFORMS = {
|
||||
win32: {
|
||||
x64: {
|
||||
musl: "@oxfmt/win32-x64/oxfmt.exe",
|
||||
gnu: "@oxfmt/win32-x64/oxfmt.exe",
|
||||
},
|
||||
arm64: {
|
||||
musl: "@oxfmt/win32-arm64/oxfmt.exe",
|
||||
gnu: "@oxfmt/win32-arm64/oxfmt.exe",
|
||||
},
|
||||
},
|
||||
darwin: {
|
||||
x64: {
|
||||
musl: "@oxfmt/darwin-x64/oxfmt",
|
||||
gnu: "@oxfmt/darwin-x64/oxfmt",
|
||||
},
|
||||
arm64: {
|
||||
musl: "@oxfmt/darwin-arm64/oxfmt",
|
||||
gnu: "@oxfmt/darwin-arm64/oxfmt",
|
||||
},
|
||||
},
|
||||
linux: {
|
||||
x64: {
|
||||
musl: "@oxfmt/linux-x64-musl/oxfmt",
|
||||
gnu: "@oxfmt/linux-x64-gnu/oxfmt",
|
||||
},
|
||||
arm64: {
|
||||
musl: "@oxfmt/linux-arm64-musl/oxfmt",
|
||||
gnu: "@oxfmt/linux-arm64-gnu/oxfmt",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
let binPath = (
|
||||
PLATFORMS &&
|
||||
PLATFORMS[platform] &&
|
||||
PLATFORMS[platform][arch] &&
|
||||
PLATFORMS[platform][arch][isMusl() ? "musl" : "gnu"]
|
||||
) || null;
|
||||
|
||||
if (binPath) {
|
||||
const result = require("child_process").spawnSync(
|
||||
require.resolve(binPath),
|
||||
process.argv.slice(2),
|
||||
{
|
||||
shell: false,
|
||||
stdio: "inherit",
|
||||
env: Object.assign({}, env, {
|
||||
JS_RUNTIME_VERSION: version,
|
||||
JS_RUNTIME_NAME: release.name,
|
||||
NODE_PACKAGE_MANAGER: detectPackageManager(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
process.exitCode = result.status;
|
||||
} else {
|
||||
let target = `${platform}-${arch}`;
|
||||
if (isMusl()) {
|
||||
target = `${target}-musl`;
|
||||
}
|
||||
console.error(
|
||||
`The oxfmt CLI package doesn't ship with prebuilt binaries for your platform (${target}) yet. ` +
|
||||
"You can create an issue at https://github.com/oxc-project/oxc/issues for support."
|
||||
);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* NPM, Yarn, and other package manager set the `npm_config_user_agent`. It has the following format:
|
||||
*
|
||||
* ```
|
||||
* "npm/8.3.0 node/v16.13.2 win32 x64 workspaces/false
|
||||
* ```
|
||||
*
|
||||
* @returns The package manager string (`npm/8.3.0`) or null if the user agent string isn't set.
|
||||
*/
|
||||
function detectPackageManager() {
|
||||
const userAgent = env.npm_config_user_agent;
|
||||
|
||||
if (userAgent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return userAgent.split(" ")[0];
|
||||
}
|
||||
39
figma/node_modules/oxfmt/package.json
generated
vendored
Normal file
39
figma/node_modules/oxfmt/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "oxfmt",
|
||||
"version": "0.2.0",
|
||||
"type": "commonjs",
|
||||
"description": "Formatter for the JavaScript Oxidation Compiler",
|
||||
"keywords": [],
|
||||
"author": "Boshen and oxc contributors",
|
||||
"license": "MIT",
|
||||
"homepage": "https://oxc.rs",
|
||||
"bugs": "https://github.com/oxc-project/oxc/issues",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/oxc-project/oxc",
|
||||
"directory": "npm/oxfmt"
|
||||
},
|
||||
"bin": {
|
||||
"oxfmt": "bin/oxfmt"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/Boshen"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.*"
|
||||
},
|
||||
"files": [
|
||||
"bin/oxfmt",
|
||||
"README.md"
|
||||
],
|
||||
"optionalDependencies": {
|
||||
"@oxfmt/win32-x64": "0.2.0",
|
||||
"@oxfmt/win32-arm64": "0.2.0",
|
||||
"@oxfmt/linux-x64-gnu": "0.2.0",
|
||||
"@oxfmt/linux-arm64-gnu": "0.2.0",
|
||||
"@oxfmt/linux-x64-musl": "0.2.0",
|
||||
"@oxfmt/linux-arm64-musl": "0.2.0",
|
||||
"@oxfmt/darwin-x64": "0.2.0",
|
||||
"@oxfmt/darwin-arm64": "0.2.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user