@superblocksteam/sabs-client 0.127.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/.prettierignore +3 -0
- package/.prettierrc +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/sabs.d.ts +43 -0
- package/dist/sabs.d.ts.map +1 -0
- package/dist/sabs.js +110 -0
- package/dist/sabs.js.map +1 -0
- package/dist/sabs.test.d.ts +2 -0
- package/dist/sabs.test.d.ts.map +1 -0
- package/dist/sabs.test.js +404 -0
- package/dist/sabs.test.js.map +1 -0
- package/eslint.config.mjs +261 -0
- package/jest.config.js +13 -0
- package/package.json +59 -0
- package/src/index.ts +1 -0
- package/src/sabs.test.ts +423 -0
- package/src/sabs.ts +203 -0
- package/tsconfig.json +24 -0
- package/tsconfig.test.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
2
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
3
|
+
import js from '@eslint/js';
|
|
4
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
5
|
+
import tsParser from '@typescript-eslint/parser';
|
|
6
|
+
import _import from 'eslint-plugin-import';
|
|
7
|
+
import prettier from 'eslint-plugin-prettier';
|
|
8
|
+
import globals from 'globals';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default [
|
|
21
|
+
{
|
|
22
|
+
// Ignore Jest configuration file (it's excluded from tsconfig.json, so it's problematic!)
|
|
23
|
+
ignores: [
|
|
24
|
+
'coverage/*',
|
|
25
|
+
'dist/*',
|
|
26
|
+
'eslint.config.mjs',
|
|
27
|
+
'**/jest.config.js'
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
...fixupConfigRules(
|
|
31
|
+
compat.extends(
|
|
32
|
+
'eslint:recommended',
|
|
33
|
+
'plugin:@typescript-eslint/eslint-recommended',
|
|
34
|
+
'plugin:@typescript-eslint/recommended',
|
|
35
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
36
|
+
'plugin:import/typescript',
|
|
37
|
+
'prettier',
|
|
38
|
+
'plugin:prettier/recommended'
|
|
39
|
+
)
|
|
40
|
+
),
|
|
41
|
+
{
|
|
42
|
+
plugins: {
|
|
43
|
+
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
|
44
|
+
import: fixupPluginRules(_import),
|
|
45
|
+
prettier: fixupPluginRules(prettier)
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
languageOptions: {
|
|
49
|
+
globals: {
|
|
50
|
+
...globals.jest,
|
|
51
|
+
...globals.node
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
parser: tsParser,
|
|
55
|
+
ecmaVersion: 2020,
|
|
56
|
+
sourceType: 'commonjs',
|
|
57
|
+
|
|
58
|
+
parserOptions: {
|
|
59
|
+
impliedStrict: true,
|
|
60
|
+
project: './**/tsconfig.json'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
settings: {
|
|
65
|
+
'import/parsers': {
|
|
66
|
+
'@typescript-eslint/parser': ['.ts', '.tsx']
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
'import/resolver': {
|
|
70
|
+
node: {},
|
|
71
|
+
|
|
72
|
+
typescript: {
|
|
73
|
+
project: './**/tsconfig.json'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// Custom Configurations
|
|
79
|
+
rules: {
|
|
80
|
+
'prettier/prettier': ['error'],
|
|
81
|
+
|
|
82
|
+
'@typescript-eslint/array-type': [
|
|
83
|
+
'error',
|
|
84
|
+
{
|
|
85
|
+
default: 'array-simple',
|
|
86
|
+
readonly: 'array-simple'
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
|
|
90
|
+
'@typescript-eslint/await-thenable': ['error'],
|
|
91
|
+
'@typescript-eslint/explicit-module-boundary-types': ['off'],
|
|
92
|
+
'@typescript-eslint/explicit-member-accessibility': ['error'],
|
|
93
|
+
|
|
94
|
+
'@typescript-eslint/member-ordering': [
|
|
95
|
+
'error',
|
|
96
|
+
{
|
|
97
|
+
default: ['static-field', 'static-method', 'instance-field', 'constructor', 'instance-method']
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
|
|
101
|
+
'@typescript-eslint/no-empty-function': [
|
|
102
|
+
'error',
|
|
103
|
+
{
|
|
104
|
+
allow: ['constructors']
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
|
|
108
|
+
'@typescript-eslint/no-floating-promises': ['error'],
|
|
109
|
+
'@typescript-eslint/no-for-in-array': ['error'],
|
|
110
|
+
'@typescript-eslint/no-misused-promises': ['error'],
|
|
111
|
+
'@typescript-eslint/no-require-imports': ['error'],
|
|
112
|
+
'@typescript-eslint/no-unsafe-assignment': ['off'],
|
|
113
|
+
'@typescript-eslint/no-unsafe-call': ['off'],
|
|
114
|
+
'@typescript-eslint/no-unsafe-member-access': ['off'],
|
|
115
|
+
'@typescript-eslint/no-unsafe-return': ['off'],
|
|
116
|
+
|
|
117
|
+
'@typescript-eslint/no-unused-vars': [
|
|
118
|
+
'error',
|
|
119
|
+
{
|
|
120
|
+
args: 'all',
|
|
121
|
+
argsIgnorePattern: '^_',
|
|
122
|
+
caughtErrors: 'all',
|
|
123
|
+
vars: 'all',
|
|
124
|
+
varsIgnorePattern: '^_'
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
|
|
128
|
+
'@typescript-eslint/no-useless-constructor': ['error'],
|
|
129
|
+
'@typescript-eslint/prefer-for-of': ['error'],
|
|
130
|
+
|
|
131
|
+
'@typescript-eslint/prefer-nullish-coalescing': [
|
|
132
|
+
'error',
|
|
133
|
+
{
|
|
134
|
+
ignoreMixedLogicalExpressions: true
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
|
|
138
|
+
'@typescript-eslint/prefer-readonly': ['error'],
|
|
139
|
+
|
|
140
|
+
'@typescript-eslint/promise-function-async': [
|
|
141
|
+
'error',
|
|
142
|
+
{
|
|
143
|
+
checkArrowFunctions: false
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
|
|
147
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
148
|
+
'error',
|
|
149
|
+
{
|
|
150
|
+
allowNumber: true,
|
|
151
|
+
allowBoolean: true,
|
|
152
|
+
allowAny: true,
|
|
153
|
+
allowNullish: true
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
|
|
157
|
+
'@typescript-eslint/require-await': ['error'],
|
|
158
|
+
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
159
|
+
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
|
|
160
|
+
complexity: ['off'],
|
|
161
|
+
'dot-notation': ['error'],
|
|
162
|
+
|
|
163
|
+
eqeqeq: [
|
|
164
|
+
'error',
|
|
165
|
+
'always',
|
|
166
|
+
{
|
|
167
|
+
null: 'ignore'
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
|
|
171
|
+
'import/no-duplicates': ['error'],
|
|
172
|
+
|
|
173
|
+
'import/no-extraneous-dependencies': [
|
|
174
|
+
'error',
|
|
175
|
+
{
|
|
176
|
+
devDependencies: ['**/test/**', '**/*.test.ts'], // Only allow importing devDependencies from tests
|
|
177
|
+
optionalDependencies: false, // Disallow importing optional dependencies (those shouldn't be used here)
|
|
178
|
+
peerDependencies: false // Disallow importing peer dependencies (those shouldn't be used here)
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
|
|
182
|
+
'import/no-unresolved': [
|
|
183
|
+
'error',
|
|
184
|
+
{
|
|
185
|
+
ignore: [
|
|
186
|
+
'@jsii/check-node/run', // @jsii/check-node uses an export map, which import/resolver does not (yet) support (https://github.com/import-js/eslint-plugin-import/issues/1868)
|
|
187
|
+
'worker_threads' // This isn't supported in all node versions (import is always guarded)
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
|
|
192
|
+
'import/order': [
|
|
193
|
+
'error',
|
|
194
|
+
{
|
|
195
|
+
alphabetize: {
|
|
196
|
+
order: 'asc',
|
|
197
|
+
caseInsensitive: true
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
groups: [
|
|
201
|
+
['builtin', 'external'],
|
|
202
|
+
['parent', 'sibling'],
|
|
203
|
+
['index', 'unknown']
|
|
204
|
+
],
|
|
205
|
+
'newlines-between': 'always'
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
|
|
209
|
+
'no-alert': ['error'],
|
|
210
|
+
'no-await-in-loop': ['error'],
|
|
211
|
+
'no-caller': ['error'],
|
|
212
|
+
|
|
213
|
+
'no-else-return': [
|
|
214
|
+
'error',
|
|
215
|
+
{
|
|
216
|
+
allowElseIf: true
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
|
|
220
|
+
'no-eval': ['error'],
|
|
221
|
+
'no-extra-bind': ['error'],
|
|
222
|
+
'no-implied-eval': ['error'],
|
|
223
|
+
'no-lone-blocks': ['error'],
|
|
224
|
+
'no-new-symbol': ['error'],
|
|
225
|
+
'no-proto': ['error'],
|
|
226
|
+
|
|
227
|
+
'no-restricted-properties': [
|
|
228
|
+
'error',
|
|
229
|
+
{
|
|
230
|
+
property: 'substr',
|
|
231
|
+
message: 'Use .slice instead of .substr.'
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
|
|
235
|
+
'no-return-await': ['error'],
|
|
236
|
+
'no-unused-expressions': ['error'],
|
|
237
|
+
'no-useless-call': ['error'],
|
|
238
|
+
'no-var': ['error'],
|
|
239
|
+
'prefer-const': ['error'],
|
|
240
|
+
'prefer-template': ['error'],
|
|
241
|
+
'eol-last': ['error', 'always'],
|
|
242
|
+
// Disabled rules
|
|
243
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
244
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
245
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
246
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
247
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
248
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
249
|
+
'no-case-declarations': 'off',
|
|
250
|
+
'require-atomic-updates': 'off',
|
|
251
|
+
// This is not a bad rule but it got sprung on us and our code loudly fails it
|
|
252
|
+
// Disable to get the eslint upgrade to pass.
|
|
253
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
254
|
+
// 'consistent-return' actually decreases safety. Its use will enforce useless `throws`
|
|
255
|
+
// statements, forcing a runtime error that occlude cases where the TypeScript type
|
|
256
|
+
// checker would actually have caught something like a non-exhaustive `switch` statement
|
|
257
|
+
// at compile time.
|
|
258
|
+
'consistent-return': 'off'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
];
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
roots: ['<rootDir>/'],
|
|
3
|
+
transform: {
|
|
4
|
+
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.test.json' }],
|
|
5
|
+
},
|
|
6
|
+
testRegex: '(/__tests__/.*|(\\.)(test|spec))\\.tsx?$',
|
|
7
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'css'],
|
|
8
|
+
moduleDirectories: ['node_modules', 'src'],
|
|
9
|
+
transformIgnorePatterns: [],
|
|
10
|
+
modulePathIgnorePatterns: ['<rootDir>/dist/__mocks__/'],
|
|
11
|
+
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.{js,jsx,ts,tsx}'],
|
|
12
|
+
testEnvironment: 'node'
|
|
13
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@superblocksteam/sabs-client",
|
|
3
|
+
"version": "v0.127.0",
|
|
4
|
+
"description": "Superblocks Application Build System Client for TypeScript",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/superblocksteam/sabs.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"registry": "https://registry.npmjs.org/"
|
|
13
|
+
},
|
|
14
|
+
"license": "Superblocks Community Software License",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "pnpm install && pnpm run lint:fix && tsc",
|
|
17
|
+
"clean": "npx rimraf ./dist ./coverage *tsbuildinfo",
|
|
18
|
+
"lint": "eslint . --ext ts --max-warnings 0 --cache --cache-strategy content --cache-location ~/.cache/eslint/",
|
|
19
|
+
"lint:fix": "eslint . --ext ts --fix --cache --cache-strategy content --cache-location ~/.cache/eslint/",
|
|
20
|
+
"lint:precommit": "eslint --ext ts --fix --cache --cache-strategy content --cache-location ~/.cache/eslint/",
|
|
21
|
+
"test": "echo $SPEC_PATH && echo $TEST_NAME && jest -i ./${SPEC_PATH} -t ${TEST_NAME}",
|
|
22
|
+
"test:coverage": "echo $SPEC_PATH && echo $TEST_NAME && jest --coverage --coverageReporters=text-summary json-summary lcov -i ./${SPEC_PATH} -t ${TEST_NAME}"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@superblocksteam/sabs-types": "^0.127.0",
|
|
26
|
+
"axios": "^1.8.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
30
|
+
"@eslint/compat": "^1.2.7",
|
|
31
|
+
"@eslint/eslintrc": "3.3.1",
|
|
32
|
+
"@eslint/js": "^9.22.0",
|
|
33
|
+
"@side/jest-runtime": "^1.1.0",
|
|
34
|
+
"@types/jest": "^29.2.6",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
36
|
+
"@typescript-eslint/parser": "^8.26.1",
|
|
37
|
+
"eslint": "^9.22.0",
|
|
38
|
+
"eslint-plugin-import": "2.31.0",
|
|
39
|
+
"eslint-plugin-prettier": "5.2.3",
|
|
40
|
+
"globals": "16.0.0",
|
|
41
|
+
"jest": "^29.7.0",
|
|
42
|
+
"prettier": "^3.5.3",
|
|
43
|
+
"rimraf": "6.0.1",
|
|
44
|
+
"ts-jest": "^29.2.6",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
46
|
+
"typescript": "5.8.3",
|
|
47
|
+
"typescript-eslint": "^8.26.1"
|
|
48
|
+
},
|
|
49
|
+
"lint-staged": {
|
|
50
|
+
"*.{ts,js}": [
|
|
51
|
+
"pnpm lint:precommit"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": "^20.11.1",
|
|
56
|
+
"pnpm": "^10.6.2"
|
|
57
|
+
},
|
|
58
|
+
"packageManager": "pnpm@10.6.3+sha512.bb45e34d50a9a76e858a95837301bfb6bd6d35aea2c5d52094fa497a467c43f5c440103ce2511e9e0a2f89c3d6071baac3358fc68ac6fb75e2ceb3d2736065e6"
|
|
59
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sabs';
|