@node-3d/addon-tools 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/include.d.ts +12 -0
- package/dist/include.js +43 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/utils/action-pack.d.ts +1 -0
- package/dist/utils/action-pack.js +16 -0
- package/dist/utils/check-gypi.d.ts +1 -0
- package/dist/utils/check-gypi.js +10 -0
- package/dist/utils/cpbin.d.ts +1 -0
- package/dist/utils/cpbin.js +18 -0
- package/dist/utils/cpclangformat.d.ts +1 -0
- package/dist/utils/cpclangformat.js +11 -0
- package/dist/utils/cpcpplint.d.ts +1 -0
- package/dist/utils/cpcpplint.js +12 -0
- package/dist/utils/download.d.ts +1 -0
- package/dist/utils/download.js +6 -0
- package/dist/utils/files.d.ts +8 -0
- package/dist/utils/files.js +57 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/install.d.ts +1 -0
- package/dist/utils/install.js +43 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.js +62 -0
- package/dist/utils/oxfmt.d.ts +3 -0
- package/dist/utils/oxfmt.js +29 -0
- package/dist/utils/oxlint.d.ts +141 -0
- package/dist/utils/oxlint.js +215 -0
- package/include/addon-tools.hpp +895 -0
- package/package.json +100 -0
- package/tsconfig.json +27 -0
- package/utils/.clang-format +30 -0
- package/utils/CPPLINT.cfg +18 -0
- package/utils/common.gypi +32 -0
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@node-3d/addon-tools",
|
|
3
|
+
"version": "10.0.0",
|
|
4
|
+
"description": "Helpers for Node.js addons and dependency packages",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"addon",
|
|
7
|
+
"bindings",
|
|
8
|
+
"c++",
|
|
9
|
+
"events",
|
|
10
|
+
"gyp",
|
|
11
|
+
"headers",
|
|
12
|
+
"include",
|
|
13
|
+
"napi",
|
|
14
|
+
"native",
|
|
15
|
+
"utils"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/node-3d/node-3d#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/node-3d/node-3d/issues"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Luis Blanco <luisblanco1337@gmail.com>",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/node-3d/addon-tools.git"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"include",
|
|
30
|
+
"utils",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"tsconfig.json",
|
|
33
|
+
"package.json"
|
|
34
|
+
],
|
|
35
|
+
"type": "module",
|
|
36
|
+
"main": "dist/index.js",
|
|
37
|
+
"types": "dist/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./oxlint": {
|
|
44
|
+
"types": "./dist/utils/oxlint.d.ts",
|
|
45
|
+
"default": "./dist/utils/oxlint.js"
|
|
46
|
+
},
|
|
47
|
+
"./oxfmt": {
|
|
48
|
+
"types": "./dist/utils/oxfmt.d.ts",
|
|
49
|
+
"default": "./dist/utils/oxfmt.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build:ci": "rslib build",
|
|
57
|
+
"build:watch": "rslib build --watch",
|
|
58
|
+
"build:test-addon": "cd test-addon && node-gyp rebuild -j max --silent",
|
|
59
|
+
"lint:ts": "tsgo -p tsconfig.json --noEmit",
|
|
60
|
+
"lint:oxlint": "oxlint .",
|
|
61
|
+
"format:ts": "oxfmt -c ./oxfmt.config.ts --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx}\"",
|
|
62
|
+
"format:ts:ci": "oxfmt -c ./oxfmt.config.ts --check --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx}\"",
|
|
63
|
+
"lint:all": "npm run lint:ts && npm run lint:oxlint",
|
|
64
|
+
"prepare": "npm run build:ci",
|
|
65
|
+
"test:watch": "node --test --watch \"ts/**/*.test.ts\"",
|
|
66
|
+
"test:ci": "node --test \"ts/**/*.test.ts\"",
|
|
67
|
+
"test:test-addon": "npm run build:test-addon && node --test \"test-addon/**/*.test.ts\""
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@rslib/core": "0.23.2",
|
|
71
|
+
"@types/node": "24.13.2",
|
|
72
|
+
"@typescript/native-preview": "7.0.0-dev.20260704.1",
|
|
73
|
+
"clang-format-node": "3.0.7",
|
|
74
|
+
"node-addon-api": "8.9.0",
|
|
75
|
+
"oxfmt": "0.57.0",
|
|
76
|
+
"oxlint": "1.72.0",
|
|
77
|
+
"tslib": "2.8.1",
|
|
78
|
+
"typescript": "6.0.3"
|
|
79
|
+
},
|
|
80
|
+
"peerDependencies": {
|
|
81
|
+
"node-addon-api": "8.9.0",
|
|
82
|
+
"oxfmt": "0.57.0",
|
|
83
|
+
"oxlint": "1.72.0"
|
|
84
|
+
},
|
|
85
|
+
"peerDependenciesMeta": {
|
|
86
|
+
"node-addon-api": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"oxfmt": {
|
|
90
|
+
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"oxlint": {
|
|
93
|
+
"optional": true
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=24.13.0",
|
|
98
|
+
"npm": ">=11.6.2"
|
|
99
|
+
}
|
|
100
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2024",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"allowImportingTsExtensions": true,
|
|
8
|
+
"rewriteRelativeImportExtensions": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": false,
|
|
11
|
+
"sourceMap": false,
|
|
12
|
+
"rootDir": ".",
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"exactOptionalPropertyTypes": true,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"types": [
|
|
19
|
+
"node"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"*.ts",
|
|
24
|
+
"ts/**/*.ts",
|
|
25
|
+
"test-addon/**/*.ts"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
BasedOnStyle: LLVM
|
|
2
|
+
Language: Cpp
|
|
3
|
+
Standard: c++17
|
|
4
|
+
UseTab: ForIndentation
|
|
5
|
+
TabWidth: 4
|
|
6
|
+
IndentWidth: 4
|
|
7
|
+
ContinuationIndentWidth: 4
|
|
8
|
+
ColumnLimit: 110
|
|
9
|
+
NamespaceIndentation: None
|
|
10
|
+
BreakBeforeBraces: Attach
|
|
11
|
+
AllowShortBlocksOnASingleLine: Empty
|
|
12
|
+
AllowShortFunctionsOnASingleLine: Empty
|
|
13
|
+
AllowShortIfStatementsOnASingleLine: Never
|
|
14
|
+
AllowShortLoopsOnASingleLine: false
|
|
15
|
+
PointerAlignment: Right
|
|
16
|
+
ReferenceAlignment: Pointer
|
|
17
|
+
AlignAfterOpenBracket: BlockIndent
|
|
18
|
+
AlignArrayOfStructures: None
|
|
19
|
+
AlignConsecutiveAssignments: None
|
|
20
|
+
AlignConsecutiveDeclarations: None
|
|
21
|
+
AlignOperands: DontAlign
|
|
22
|
+
BinPackArguments: false
|
|
23
|
+
BinPackParameters: false
|
|
24
|
+
Cpp11BracedListStyle: false
|
|
25
|
+
IndentCaseLabels: true
|
|
26
|
+
IndentPPDirectives: None
|
|
27
|
+
KeepEmptyLinesAtTheStartOfBlocks: false
|
|
28
|
+
MaxEmptyLinesToKeep: 2
|
|
29
|
+
SortIncludes: Never
|
|
30
|
+
SpaceBeforeParens: ControlStatements
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
set noparent
|
|
2
|
+
linelength=110
|
|
3
|
+
filter=-build/header_guard
|
|
4
|
+
filter=-build/include
|
|
5
|
+
filter=-build/include_order
|
|
6
|
+
filter=-build/include_what_you_use
|
|
7
|
+
filter=-build/namespaces
|
|
8
|
+
filter=-legal/copyright
|
|
9
|
+
filter=-readability/todo
|
|
10
|
+
filter=-runtime/indentation_namespace
|
|
11
|
+
filter=-whitespace/blank_line
|
|
12
|
+
filter=-whitespace/braces
|
|
13
|
+
filter=-whitespace/comments
|
|
14
|
+
filter=-whitespace/end_of_line
|
|
15
|
+
filter=-whitespace/indent
|
|
16
|
+
filter=-whitespace/operators
|
|
17
|
+
filter=-whitespace/parens
|
|
18
|
+
filter=-whitespace/tab
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
'defines': ['UNICODE', '_UNICODE'],
|
|
3
|
+
'conditions': [
|
|
4
|
+
['OS=="linux"', {
|
|
5
|
+
'defines': ['__linux__'],
|
|
6
|
+
'cflags_cc': ['-std=c++20', '-fno-exceptions'],
|
|
7
|
+
}],
|
|
8
|
+
['OS=="mac"', {
|
|
9
|
+
'MACOSX_DEPLOYMENT_TARGET': '10.9',
|
|
10
|
+
'defines': ['__APPLE__'],
|
|
11
|
+
'CLANG_CXX_LIBRARY': 'libc++',
|
|
12
|
+
'OTHER_CFLAGS': ['-std=c++20', '-fno-exceptions'],
|
|
13
|
+
}],
|
|
14
|
+
['OS=="win"', {
|
|
15
|
+
'defines': ['WIN32_LEAN_AND_MEAN', 'VC_EXTRALEAN', '_WIN32', '_HAS_EXCEPTIONS=0'],
|
|
16
|
+
}],
|
|
17
|
+
],
|
|
18
|
+
'msvs_settings': {
|
|
19
|
+
'VCCLCompilerTool': {
|
|
20
|
+
'RuntimeLibrary': 2,
|
|
21
|
+
'BufferSecurityCheck': 'false',
|
|
22
|
+
'AdditionalOptions!' : ['/MT'],
|
|
23
|
+
'AdditionalOptions' : [
|
|
24
|
+
'/O2', '/GL', '/GS-', '/GR-', '/Gd', '/EHa-s-c-', '/MD',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
'VCLinkerTool': {
|
|
28
|
+
'AdditionalOptions!' : ['/LTCG:INCREMENTAL'],
|
|
29
|
+
'AdditionalOptions' : ['/DEBUG:NONE', '/LTCG', '/OPT:REF', '/OPT:ICF'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
}
|