@pezkuwi/dev-test 0.85.1 → 0.85.3

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.
Files changed (127) hide show
  1. package/.skip-deno +0 -0
  2. package/package.json +9 -199
  3. package/tsconfig.build.json +16 -0
  4. package/tsconfig.build.tsbuildinfo +1 -0
  5. package/tsconfig.spec.json +16 -0
  6. package/tsconfig.spec.tsbuildinfo +1 -0
  7. package/LICENSE +0 -201
  8. package/browser.d.ts +0 -1
  9. package/browser.js +0 -2
  10. package/cjs/browser.d.ts +0 -1
  11. package/cjs/browser.js +0 -4
  12. package/cjs/detectOther.d.ts +0 -2
  13. package/cjs/detectOther.js +0 -3
  14. package/cjs/env/browser.d.ts +0 -313
  15. package/cjs/env/browser.js +0 -98
  16. package/cjs/env/expect.d.ts +0 -297
  17. package/cjs/env/expect.js +0 -213
  18. package/cjs/env/index.d.ts +0 -4
  19. package/cjs/env/index.js +0 -20
  20. package/cjs/env/jest.d.ts +0 -127
  21. package/cjs/env/jest.js +0 -56
  22. package/cjs/env/lifecycle.d.ts +0 -12
  23. package/cjs/env/lifecycle.js +0 -17
  24. package/cjs/env/suite.d.ts +0 -16
  25. package/cjs/env/suite.js +0 -35
  26. package/cjs/index.d.ts +0 -1
  27. package/cjs/index.js +0 -1
  28. package/cjs/node.d.ts +0 -1
  29. package/cjs/node.js +0 -4
  30. package/cjs/package.json +0 -3
  31. package/cjs/packageInfo.d.ts +0 -6
  32. package/cjs/packageInfo.js +0 -4
  33. package/cjs/root.d.ts +0 -2
  34. package/cjs/root.js +0 -6
  35. package/cjs/rootJs/Clazz.d.ts +0 -18
  36. package/cjs/rootJs/Clazz.js +0 -36
  37. package/cjs/rootJs/Jsx.d.ts +0 -5
  38. package/cjs/rootJs/Jsx.js +0 -16
  39. package/cjs/rootJs/JsxChild.d.ts +0 -9
  40. package/cjs/rootJs/JsxChild.js +0 -9
  41. package/cjs/rootJs/augmented.d.ts +0 -8
  42. package/cjs/rootJs/augmented.js +0 -3
  43. package/cjs/rootJs/index.d.ts +0 -19
  44. package/cjs/rootJs/index.js +0 -51
  45. package/cjs/rootTests.d.ts +0 -2
  46. package/cjs/rootTests.js +0 -44
  47. package/cjs/sample.d.ts +0 -1
  48. package/cjs/sample.js +0 -4
  49. package/cjs/types.d.ts +0 -15
  50. package/cjs/types.js +0 -2
  51. package/cjs/util.d.ts +0 -20
  52. package/cjs/util.js +0 -51
  53. package/config/eslint.js +0 -160
  54. package/config/eslint.rules.js +0 -214
  55. package/config/prettier.cjs +0 -22
  56. package/config/rollup.js +0 -113
  57. package/config/tsconfig.json +0 -32
  58. package/config/typedoc.cjs +0 -18
  59. package/detectOther.d.ts +0 -2
  60. package/detectOther.js +0 -1
  61. package/env/browser.d.ts +0 -313
  62. package/env/browser.js +0 -95
  63. package/env/expect.d.ts +0 -297
  64. package/env/expect.js +0 -210
  65. package/env/index.d.ts +0 -4
  66. package/env/index.js +0 -17
  67. package/env/jest.d.ts +0 -127
  68. package/env/jest.js +0 -53
  69. package/env/lifecycle.d.ts +0 -12
  70. package/env/lifecycle.js +0 -14
  71. package/env/suite.d.ts +0 -16
  72. package/env/suite.js +0 -32
  73. package/globals.cjs +0 -4
  74. package/globals.d.cts +0 -1
  75. package/globals.d.ts +0 -32
  76. package/index.d.ts +0 -1
  77. package/index.js +0 -1
  78. package/node.d.ts +0 -1
  79. package/node.js +0 -2
  80. package/packageInfo.d.ts +0 -6
  81. package/packageInfo.js +0 -1
  82. package/root.d.ts +0 -2
  83. package/root.js +0 -2
  84. package/rootJs/Clazz.d.ts +0 -18
  85. package/rootJs/Clazz.js +0 -32
  86. package/rootJs/Jsx.d.ts +0 -5
  87. package/rootJs/Jsx.js +0 -13
  88. package/rootJs/JsxChild.d.ts +0 -9
  89. package/rootJs/JsxChild.js +0 -6
  90. package/rootJs/augmented.d.ts +0 -8
  91. package/rootJs/augmented.js +0 -2
  92. package/rootJs/dynamic.d.mts +0 -8
  93. package/rootJs/dynamic.mjs +0 -13
  94. package/rootJs/index.d.ts +0 -19
  95. package/rootJs/index.js +0 -39
  96. package/rootJs/testJson.json +0 -5
  97. package/rootStatic/zagros.svg +0 -1
  98. package/rootTests.d.ts +0 -2
  99. package/rootTests.js +0 -41
  100. package/scripts/pezkuwi-ci-ghact-build.mjs +0 -536
  101. package/scripts/pezkuwi-ci-ghact-docs.mjs +0 -14
  102. package/scripts/pezkuwi-ci-ghpages-force.mjs +0 -43
  103. package/scripts/pezkuwi-dev-build-docs.mjs +0 -19
  104. package/scripts/pezkuwi-dev-build-ts.mjs +0 -1518
  105. package/scripts/pezkuwi-dev-circular.mjs +0 -29
  106. package/scripts/pezkuwi-dev-clean-build.mjs +0 -61
  107. package/scripts/pezkuwi-dev-contrib.mjs +0 -74
  108. package/scripts/pezkuwi-dev-copy-dir.mjs +0 -44
  109. package/scripts/pezkuwi-dev-copy-to.mjs +0 -53
  110. package/scripts/pezkuwi-dev-deno-map.mjs +0 -35
  111. package/scripts/pezkuwi-dev-run-lint.mjs +0 -40
  112. package/scripts/pezkuwi-dev-run-node-ts.mjs +0 -9
  113. package/scripts/pezkuwi-dev-run-test.mjs +0 -163
  114. package/scripts/pezkuwi-dev-version.mjs +0 -143
  115. package/scripts/pezkuwi-dev-yarn-only.mjs +0 -11
  116. package/scripts/pezkuwi-exec-eslint.mjs +0 -7
  117. package/scripts/pezkuwi-exec-ghpages.mjs +0 -11
  118. package/scripts/pezkuwi-exec-ghrelease.mjs +0 -7
  119. package/scripts/pezkuwi-exec-node-test.mjs +0 -368
  120. package/scripts/pezkuwi-exec-rollup.mjs +0 -7
  121. package/scripts/pezkuwi-exec-tsc.mjs +0 -7
  122. package/scripts/pezkuwi-exec-webpack.mjs +0 -7
  123. package/scripts/util.mjs +0 -540
  124. package/types.d.ts +0 -15
  125. package/types.js +0 -1
  126. package/util.d.ts +0 -20
  127. package/util.js +0 -46
package/config/eslint.js DELETED
@@ -1,160 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // @ts-expect-error No definition for this one
5
- import eslintJs from '@eslint/js';
6
- import tsPlugin from '@typescript-eslint/eslint-plugin';
7
- import tsParser from '@typescript-eslint/parser';
8
- // @ts-expect-error No definition for this one
9
- import standardConfig from 'eslint-config-standard';
10
- import deprecationPlugin from 'eslint-plugin-deprecation';
11
- // @ts-expect-error No definition for this one
12
- import headerPlugin from 'eslint-plugin-header';
13
- // @ts-expect-error No definition for this one
14
- import importPlugin from 'eslint-plugin-import';
15
- // @ts-expect-error No definition for this one
16
- import importNewlinesPlugin from 'eslint-plugin-import-newlines';
17
- // @ts-expect-error No definition for this one
18
- import jestPlugin from 'eslint-plugin-jest';
19
- // @ts-expect-error No definition for this one
20
- import nPlugin from 'eslint-plugin-n';
21
- // @ts-expect-error No definition for this one
22
- import promisePlugin from 'eslint-plugin-promise';
23
- // @ts-expect-error No definition for this one
24
- import reactPlugin from 'eslint-plugin-react';
25
- // @ts-expect-error No definition for this one
26
- import reactHooksPlugin from 'eslint-plugin-react-hooks';
27
- // @ts-expect-error No definition for this one
28
- import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
29
- // @ts-expect-error No definition for this one
30
- import sortDestructureKeysPlugin from 'eslint-plugin-sort-destructure-keys';
31
- import globals from 'globals';
32
-
33
- import { overrideAll, overrideJs, overrideJsx, overrideSpec } from './eslint.rules.js';
34
-
35
- const EXT_JS = ['.cjs', '.js', '.mjs'];
36
- const EXT_TS = ['.ts', '.tsx'];
37
- const EXT_ALL = [...EXT_JS, ...EXT_TS];
38
-
39
- /**
40
- * @internal
41
- * Converts a list of EXT_* defined above to globs
42
- * @param {string[]} exts
43
- * @returns {string[]}
44
- */
45
- function extsToGlobs (exts) {
46
- return exts.map((e) => `**/*${e}`);
47
- }
48
-
49
- export default [
50
- {
51
- ignores: [
52
- '**/.github/',
53
- '**/.vscode/',
54
- '**/.yarn/',
55
- '**/build/',
56
- '**/build-*/',
57
- '**/coverage/'
58
- ]
59
- },
60
- {
61
- languageOptions: {
62
- globals: {
63
- ...globals.browser,
64
- ...globals.node
65
- },
66
- parser: tsParser,
67
- parserOptions: {
68
- ecmaVersion: 'latest',
69
- project: './tsconfig.eslint.json',
70
- sourceType: 'module',
71
- warnOnUnsupportedTypeScriptVersion: false
72
- }
73
- },
74
- plugins: {
75
- '@typescript-eslint': tsPlugin,
76
- deprecation: deprecationPlugin,
77
- header: headerPlugin,
78
- import: importPlugin,
79
- 'import-newlines': importNewlinesPlugin,
80
- n: nPlugin,
81
- promise: promisePlugin,
82
- 'simple-import-sort': simpleImportSortPlugin,
83
- 'sort-destructure-keys': sortDestructureKeysPlugin
84
- },
85
- settings: {
86
- 'import/extensions': EXT_ALL,
87
- 'import/parsers': {
88
- '@typescript-eslint/parser': EXT_TS,
89
- espree: EXT_JS
90
- },
91
- 'import/resolver': {
92
- node: {
93
- extensions: EXT_ALL
94
- },
95
- typescript: {
96
- project: './tsconfig.eslint.json'
97
- }
98
- }
99
- }
100
- },
101
- {
102
- files: extsToGlobs(EXT_ALL),
103
- rules: {
104
- ...eslintJs.configs.recommended.rules,
105
- ...standardConfig.rules,
106
- ...tsPlugin.configs['recommended-type-checked'].rules,
107
- ...tsPlugin.configs['stylistic-type-checked'].rules,
108
- ...overrideAll
109
- }
110
- },
111
- {
112
- files: extsToGlobs(EXT_JS),
113
- rules: {
114
- ...overrideJs
115
- }
116
- },
117
- {
118
- files: [
119
- '**/*.tsx',
120
- '**/use*.ts'
121
- ],
122
- plugins: {
123
- react: reactPlugin,
124
- 'react-hooks': reactHooksPlugin
125
- },
126
- rules: {
127
- ...reactPlugin.configs.recommended.rules,
128
- ...reactHooksPlugin.configs.recommended.rules,
129
- ...overrideJsx
130
- },
131
- settings: {
132
- react: {
133
- version: 'detect'
134
- }
135
- }
136
- },
137
- {
138
- files: [
139
- '**/*.spec.ts',
140
- '**/*.spec.tsx'
141
- ],
142
- languageOptions: {
143
- globals: {
144
- ...globals.jest
145
- }
146
- },
147
- plugins: {
148
- jest: jestPlugin
149
- },
150
- rules: {
151
- ...jestPlugin.configs.recommended.rules,
152
- ...overrideSpec
153
- },
154
- settings: {
155
- jest: {
156
- version: 27
157
- }
158
- }
159
- }
160
- ];
@@ -1,214 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import JSON5 from 'json5';
5
- import fs from 'node:fs';
6
- import path from 'node:path';
7
- import process from 'node:process';
8
-
9
- const FIXME = {
10
- // This is in the new 6.0.0 and we should switch this on
11
- // at some point. For a first iteration we keep as-is
12
- '@typescript-eslint/prefer-nullish-coalescing': 'off'
13
- };
14
-
15
- /**
16
- * Returns a copyright header pattern (using tsconfig.base.json)
17
- *
18
- * @returns {string}
19
- */
20
- function getHeaderPattern () {
21
- const tsPath = path.join(process.cwd(), 'tsconfig.base.json');
22
-
23
- if (!fs.existsSync(tsPath)) {
24
- throw new Error(`Unable to load ${tsPath}`);
25
- }
26
-
27
- const tsConfig = JSON5.parse(fs.readFileSync(tsPath, 'utf-8'));
28
-
29
- if (!tsConfig?.compilerOptions?.paths) {
30
- throw new Error(`Unable to extract compilerOptions.paths structure from ${tsPath}`);
31
- }
32
-
33
- const paths = Object.keys(tsConfig.compilerOptions.paths);
34
-
35
- if (!paths.length) {
36
- throw new Error(`No keys found in compilerOptions.paths from ${tsPath}`);
37
- }
38
-
39
- const packages = paths.reduce((packages, k) => {
40
- const [pd, pk] = k.split('/');
41
-
42
- if (pd !== '@pezkuwi' || !pk) {
43
- throw new Error(`Non @pezkuwi path in ${tsPath}`);
44
- }
45
-
46
- return packages.length
47
- ? `${packages}|${pk}`
48
- : pk;
49
- }, '');
50
- const fullyear = new Date().getFullYear();
51
- const years = [];
52
-
53
- for (let i = 17, last = fullyear - 2000; i < last; i++) {
54
- years.push(`${i}`);
55
- }
56
-
57
- return ` Copyright 20(${years.join('|')})(-${fullyear})? @pezkuwi/(${packages})`;
58
- }
59
-
60
- export const overrideAll = {
61
- ...FIXME,
62
- // the next 2 enforce isolatedModules & verbatimModuleSyntax
63
- '@typescript-eslint/consistent-type-exports': 'error',
64
- '@typescript-eslint/consistent-type-imports': 'error',
65
- '@typescript-eslint/dot-notation': 'error',
66
- '@typescript-eslint/indent': ['error', 2],
67
- '@typescript-eslint/no-non-null-assertion': 'error',
68
- // ts itself checks and ignores those starting with _, align the linting
69
- '@typescript-eslint/no-unused-vars': ['error', {
70
- args: 'all',
71
- argsIgnorePattern: '^_',
72
- caughtErrors: 'all',
73
- caughtErrorsIgnorePattern: '^_',
74
- destructuredArrayIgnorePattern: '^_',
75
- vars: 'all',
76
- varsIgnorePattern: '^_'
77
- }],
78
- '@typescript-eslint/type-annotation-spacing': 'error',
79
- 'arrow-parens': ['error', 'always'],
80
- 'brace-style': ['error', '1tbs'],
81
- curly: ['error', 'all'],
82
- 'default-param-last': 'off', // conflicts with TS version
83
- 'deprecation/deprecation': 'error',
84
- 'dot-notation': 'off', // conflicts with TS version
85
- 'func-style': ['error', 'declaration', {
86
- allowArrowFunctions: true
87
- }],
88
- // this does help with declarations, but also
89
- // applies to invocations, which is an issue...
90
- // 'function-paren-newline': ['error', 'never'],
91
- 'function-call-argument-newline': ['error', 'consistent'],
92
- 'header/header': ['error', 'line', [
93
- { pattern: getHeaderPattern() },
94
- ' SPDX-License-Identifier: Apache-2.0'
95
- ], 2],
96
- 'import-newlines/enforce': ['error', {
97
- forceSingleLine: true,
98
- items: 2048
99
- }],
100
- 'import/export': 'error',
101
- 'import/extensions': ['error', 'ignorePackages', {
102
- cjs: 'always',
103
- js: 'always',
104
- json: 'always',
105
- jsx: 'never',
106
- mjs: 'always',
107
- ts: 'never',
108
- tsx: 'never'
109
- }],
110
- 'import/first': 'error',
111
- 'import/newline-after-import': 'error',
112
- 'import/no-duplicates': 'error',
113
- 'import/order': 'off', // conflicts with simple-import-sort
114
- indent: 'off', // required as 'off' since typescript-eslint has own versions
115
- 'no-extra-semi': 'error',
116
- 'no-unused-vars': 'off',
117
- 'no-use-before-define': 'off',
118
- 'object-curly-newline': ['error', {
119
- ExportDeclaration: { minProperties: 2048 },
120
- ImportDeclaration: { minProperties: 2048 },
121
- ObjectPattern: { minProperties: 2048 }
122
- }],
123
- 'padding-line-between-statements': [
124
- 'error',
125
- { blankLine: 'always', next: '*', prev: ['const', 'let', 'var'] },
126
- { blankLine: 'any', next: ['const', 'let', 'var'], prev: ['const', 'let', 'var'] },
127
- { blankLine: 'always', next: 'block-like', prev: '*' },
128
- { blankLine: 'always', next: '*', prev: 'block-like' },
129
- { blankLine: 'always', next: 'function', prev: '*' },
130
- { blankLine: 'always', next: '*', prev: 'function' },
131
- { blankLine: 'always', next: 'try', prev: '*' },
132
- { blankLine: 'always', next: '*', prev: 'try' },
133
- { blankLine: 'always', next: 'return', prev: '*' },
134
- { blankLine: 'always', next: 'import', prev: '*' },
135
- { blankLine: 'always', next: '*', prev: 'import' },
136
- { blankLine: 'any', next: 'import', prev: 'import' }
137
- ],
138
- semi: ['error', 'always'],
139
- 'simple-import-sort/exports': 'error',
140
- 'simple-import-sort/imports': ['error', {
141
- groups: [
142
- ['^\u0000'], // all side-effects (0 at start)
143
- ['\u0000$', '^@pezkuwi.*\u0000$', '^\\..*\u0000$'], // types (0 at end)
144
- // ['^node:'], // node
145
- ['^[^/\\.]'], // non-pezkuwi
146
- ['^@pezkuwi'], // pezkuwi
147
- ['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'] // local (. last)
148
- ]
149
- }],
150
- 'sort-destructure-keys/sort-destructure-keys': ['error', {
151
- caseSensitive: true
152
- }],
153
- 'sort-keys': 'error',
154
- 'spaced-comment': ['error', 'always', {
155
- block: {
156
- // pure export helpers
157
- markers: ['#__PURE__']
158
- },
159
- line: {
160
- // TS reference types
161
- markers: ['/ <reference']
162
- }
163
- }]
164
- };
165
-
166
- export const overrideJsx = {
167
- 'jsx-quotes': ['error', 'prefer-single'],
168
- // swap from recommended warning to error
169
- 'react-hooks/exhaustive-deps': 'error',
170
- 'react/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
171
- 'react/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
172
- 'react/jsx-fragments': 'error',
173
- 'react/jsx-max-props-per-line': ['warn', {
174
- maximum: 1,
175
- when: 'always'
176
- }],
177
- 'react/jsx-newline': ['error', {
178
- prevent: true
179
- }],
180
- 'react/jsx-no-bind': 'error',
181
- 'react/jsx-props-no-multi-spaces': 'error',
182
- 'react/jsx-sort-props': ['warn', {
183
- noSortAlphabetically: false
184
- }],
185
- 'react/jsx-tag-spacing': ['error', {
186
- afterOpening: 'never',
187
- beforeClosing: 'never',
188
- beforeSelfClosing: 'always',
189
- closingSlash: 'never'
190
- }],
191
- 'react/prop-types': 'off' // this is a completely broken rule
192
- };
193
-
194
- export const overrideJs = {
195
- '@typescript-eslint/explicit-function-return-type': 'off',
196
- '@typescript-eslint/no-unsafe-argument': 'off',
197
- '@typescript-eslint/no-unsafe-assignment': 'off',
198
- '@typescript-eslint/no-unsafe-call': 'off',
199
- '@typescript-eslint/no-unsafe-member-access': 'off',
200
- '@typescript-eslint/no-unsafe-return': 'off',
201
- '@typescript-eslint/no-var-requires': 'off',
202
- '@typescript-eslint/restrict-plus-operands': 'off',
203
- '@typescript-eslint/restrict-template-expressions': 'off'
204
- };
205
-
206
- export const overrideSpec = {
207
- // in the specs we are a little less worried about
208
- // specific correctness, i.e. we can have dangling bits
209
- '@typescript-eslint/no-unsafe-call': 'off',
210
- '@typescript-eslint/no-unsafe-member-access': 'off',
211
- 'jest/expect-expect': ['warn', {
212
- assertFunctionNames: ['assert', 'expect']
213
- }]
214
- };
@@ -1,22 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- module.exports = {
5
- arrowParens: 'always',
6
- bracketSpacing: true,
7
- embeddedLanguageFormatting: 'off',
8
- endOfLine: 'lf',
9
- htmlWhitespaceSensitivity: 'ignore',
10
- jsxBracketSameLine: false,
11
- jsxSingleQuote: true,
12
- parser: 'typescript',
13
- printWidth: 2048,
14
- proseWrap: 'preserve',
15
- quoteProps: 'as-needed',
16
- requirePragma: true, // only on those files explicitly asked for
17
- semi: true,
18
- singleQuote: true,
19
- tabWidth: 2,
20
- trailingComma: 'none',
21
- useTabs: false
22
- };
package/config/rollup.js DELETED
@@ -1,113 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import pluginAlias from '@rollup/plugin-alias';
5
- import pluginCommonjs from '@rollup/plugin-commonjs';
6
- import pluginDynamicImportVars from '@rollup/plugin-dynamic-import-vars';
7
- import pluginInject from '@rollup/plugin-inject';
8
- import pluginJson from '@rollup/plugin-json';
9
- import { nodeResolve as pluginResolve } from '@rollup/plugin-node-resolve';
10
- import fs from 'node:fs';
11
- import path from 'node:path';
12
- import pluginCleanup from 'rollup-plugin-cleanup';
13
-
14
- /** @typedef {{ entries?: Record<string, string>; external: string[]; globals?: Record<string, string>; index?: string; inject?: Record<string, string>; pkg: string; }} BundleDef */
15
- /** @typedef {{ file: string; format: 'umd'; generatedCode: Record<string, unknown>; globals: Record<string, string>; inlineDynamicImports: true; intro: string; name: string; }} BundleOutput */
16
- /** @typedef {{ context: 'global'; external: string[]; input: string; output: BundleOutput; plugins: any[]; }} Bundle */
17
-
18
- /**
19
- * @param {string} pkg
20
- * @returns {string}
21
- */
22
- function sanitizePkg (pkg) {
23
- return pkg.replace('@pezkuwi/', '');
24
- }
25
-
26
- /**
27
- * @param {string} input
28
- * @returns {string}
29
- */
30
- function createName (input) {
31
- return `pezkuwi-${sanitizePkg(input)}`
32
- .toLowerCase()
33
- .replace(/[^a-zA-Z0-9]+(.)/g, (_, c) => c.toUpperCase());
34
- }
35
-
36
- /**
37
- * @param {string} pkg
38
- * @param {string} [index]
39
- * @returns {string}
40
- */
41
- export function createInput (pkg, index) {
42
- const partialPath = `packages/${sanitizePkg(pkg)}/build`;
43
-
44
- return `${partialPath}/${
45
- index ||
46
- fs.existsSync(path.join(process.cwd(), partialPath, 'bundle.js'))
47
- ? 'bundle.js'
48
- : (
49
- JSON.parse(fs.readFileSync(path.join(process.cwd(), partialPath, 'package.json'), 'utf8')).browser ||
50
- 'index.js'
51
- )
52
- }`;
53
- }
54
-
55
- /**
56
- *
57
- * @param {string} pkg
58
- * @param {string[]} external
59
- * @param {Record<string, string>} globals
60
- * @returns {BundleOutput}
61
- */
62
- export function createOutput (pkg, external, globals) {
63
- const name = sanitizePkg(pkg);
64
-
65
- return {
66
- file: `packages/${name}/build/bundle-pezkuwi-${name}.js`,
67
- format: 'umd',
68
- generatedCode: {
69
- constBindings: true
70
- },
71
- globals: external.reduce((all, p) => ({
72
- [p]: createName(p),
73
- ...all
74
- }), { ...globals }),
75
- // combine multi-chunk builds with dynamic imports
76
- inlineDynamicImports: true,
77
- // this is a mini x-global, determine where our context lies
78
- intro: 'const global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : window;',
79
- name: createName(pkg)
80
- };
81
- }
82
-
83
- /**
84
- *
85
- * @param {BundleDef} param0
86
- * @returns {Bundle}
87
- */
88
- export function createBundle ({ entries = {}, external, globals = {}, index, inject = {}, pkg }) {
89
- return {
90
- // specify this (we define global in the output intro as globalThis || self || window)
91
- context: 'global',
92
- external,
93
- input: createInput(pkg, index),
94
- output: createOutput(pkg, external, globals),
95
- // NOTE The expect-error directives are due to rollup plugins, see
96
- // - https://github.com/rollup/plugins/issues/1488
97
- // - https://github.com/rollup/plugins/issues/1329
98
- plugins: [
99
- // @ts-expect-error See the linked rollup issues above
100
- pluginAlias({ entries }),
101
- // @ts-expect-error See the linked rollup issues above
102
- pluginJson(),
103
- // @ts-expect-error See the linked rollup issues above
104
- pluginCommonjs(),
105
- // @ts-expect-error See the linked rollup issues above
106
- pluginDynamicImportVars(),
107
- // @ts-expect-error See the linked rollup issues above
108
- pluginInject(inject),
109
- pluginResolve({ browser: true }),
110
- pluginCleanup()
111
- ]
112
- };
113
- }
@@ -1,32 +0,0 @@
1
- {
2
- /**
3
- * There uses the strictest configs as the base
4
- * https://github.com/tsconfig/bases/blob/f674fa6cbca17062ff02511b02872f8729a597ec/bases/strictest.json
5
- */
6
- "extends": "@tsconfig/strictest/tsconfig.json",
7
- "compilerOptions": {
8
- /**
9
- * Aligns with packages/dev/scripts/pezkuwi-dev-build-ts & packages/dev-ts/src/loader
10
- * (target here is specifically tied to the minimum supported Node version)
11
- */
12
- "module": "nodenext",
13
- "moduleResolution": "nodenext",
14
- "target": "es2022",
15
-
16
- /**
17
- * Specific compilation configs for pezkuwi-js projects as it is used
18
- * (we only compile *.d.ts via the tsc command-line)
19
- */
20
- "declaration": true,
21
- "emitDeclarationOnly": true,
22
- "jsx": "preserve",
23
- "verbatimModuleSyntax": true,
24
-
25
- /**
26
- * These appear in strictest, however we don't (yet) use them. For the most part it means
27
- * that we actually do have a large number of these lurking (especially on index checks)
28
- */
29
- "exactOptionalPropertyTypes": false,
30
- "noUncheckedIndexedAccess": false,
31
- }
32
- }
@@ -1,18 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- module.exports = {
5
- exclude: '**/*+(index|e2e|spec|types).ts',
6
- excludeExternals: true,
7
- excludeNotExported: true,
8
- excludePrivate: true,
9
- excludeProtected: true,
10
- hideGenerator: true,
11
- includeDeclarations: false,
12
- module: 'commonjs',
13
- moduleResolution: 'node',
14
- name: 'pezkuwi{.js}',
15
- out: 'docs',
16
- stripInternal: 'true',
17
- theme: 'markdown'
18
- };
package/detectOther.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: never[];
2
- export default _default;
package/detectOther.js DELETED
@@ -1 +0,0 @@
1
- export default [];