@websolutespa/bom-compiler 3.0.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -1,55 +1,81 @@
1
- # @websolutespa/bom-compiler
2
-
3
- ## 3.0.0
4
-
5
- ### Major Changes
6
-
7
- - Release: Bom 3.0
8
-
9
- ## 0.2.3
10
-
11
- ### Patch Changes
12
-
13
- - 08b39f1: Modified: compiler added css modules
14
-
15
- ## 0.2.3-next.0
16
-
17
- ### Patch Changes
18
-
19
- - Modified: compiler added css modules
20
-
21
- ## 0.2.2
22
-
23
- ### Patch Changes
24
-
25
- - Fixing: downgrading eslint to v8.56.0
26
-
27
- ## 0.2.1
28
-
29
- ### Patch Changes
30
-
31
- - Updating: dependencies
32
-
33
- ## 0.2.0
34
-
35
- ### Minor Changes
36
-
37
- - Updating: next 13.
38
-
39
- ## 0.1.1
40
-
41
- ### Patch Changes
42
-
43
- - Modified: dependencies.
44
-
45
- ## 0.1.0
46
-
47
- ### Minor Changes
48
-
49
- - Added: splat routes.
50
-
51
- ## 0.0.1
52
-
53
- ### Patch Changes
54
-
55
- - Added: first release.
1
+ # @websolutespa/bom-compiler
2
+
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3f7c21b: - Payload 3.91.0 and Next.js 16.4.2 (React 19.2.9): peer dependencies are now ranges, `payload` / `@payloadcms/*` `^3.91.0`, `next` `^16.3.3`, `react` / `react-dom` `^19.2.1`
8
+ - payload-plugin-bowl: the mixer context is built only for reads by an authenticated user (payload 3.90+ resolves the jwt user with the request query, populating tenants before `req.user` is set); email options typed with payload `SendEmailOptions`, no direct nodemailer dependency
9
+ - payload-plugin-storage: `AZURE_STORAGE_CONTAINER_ACCESS` (`private` default since payload 3.90, `blob`, `container`) for containers created by the plugin
10
+ - mixer web: `images.qualities` includes `IMAGE_QUALITY` (next 16 defaults to `[75]`)
11
+ - 7788ed2: - bom-compiler: `bom compile` builds with tsdown (unbundled esm in `dist/esm`, declarations in `dist/types`), the babel / rollup / svgr / postcss stack is removed: svg and scss imports are no longer transformed
12
+ - bom-llm: umd (`llm` global) and esm bundles and declarations built with tsdown instead of rollup, babel and tsup
13
+ - bom-cli: `compile` awaits the async build steps; prompts typed for @clack/prompts 1
14
+
15
+ ### Patch Changes
16
+
17
+ - 306fd9f: - tsdown 0.21 (output names and extensions unchanged, `fixedExtension: false`), tsup 9, swc 1.16; declarations now emitted at the paths referenced by the published exports (`dist/index.d.ts`, `dist/exports/*.d.ts`)
18
+ - e96a9d6: - tsconfig: TypeScript 6, `types: ["node"]` (no longer implicit) and `noUncheckedSideEffectImports: false` in the base config; drop `baseUrl` in consumers (deprecated)
19
+ - test: vitest 5 / vite 8 (native tsconfig paths, `vite-tsconfig-paths` removed), build outputs excluded from the test run, jsdom 30, testing-library jest-dom 7
20
+ - bom-mixer-llm: `isChunkType` guard, narrowing of unknown chunk items under typescript 6
21
+ - node 24 (engines >= 22.13)
22
+
23
+ ## 3.0.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updating: dependencies
28
+
29
+ ## 3.0.0
30
+
31
+ ### Major Changes
32
+
33
+ - Release: Bom 3.0
34
+
35
+ ## 0.2.3
36
+
37
+ ### Patch Changes
38
+
39
+ - 08b39f1: Modified: compiler added css modules
40
+
41
+ ## 0.2.3-next.0
42
+
43
+ ### Patch Changes
44
+
45
+ - Modified: compiler added css modules
46
+
47
+ ## 0.2.2
48
+
49
+ ### Patch Changes
50
+
51
+ - Fixing: downgrading eslint to v8.56.0
52
+
53
+ ## 0.2.1
54
+
55
+ ### Patch Changes
56
+
57
+ - Updating: dependencies
58
+
59
+ ## 0.2.0
60
+
61
+ ### Minor Changes
62
+
63
+ - Updating: next 13.
64
+
65
+ ## 0.1.1
66
+
67
+ ### Patch Changes
68
+
69
+ - Modified: dependencies.
70
+
71
+ ## 0.1.0
72
+
73
+ ### Minor Changes
74
+
75
+ - Added: splat routes.
76
+
77
+ ## 0.0.1
78
+
79
+ ### Patch Changes
80
+
81
+ - Added: first release.
package/index.js CHANGED
@@ -1,89 +1,84 @@
1
-
2
- const spawn = require('cross-spawn');
3
- const path = require('path');
4
- const fs = require('fs');
5
- const rimraf = require('rimraf');
6
-
7
- function resolveDirname(pathname) {
8
- if (!/\.(t|j)s$/.test(pathname)) {
9
- return pathname;
10
- }
11
- return path.dirname(pathname);
12
- }
13
-
14
- function clean() {
15
- try {
16
- const cwd = process.cwd();
17
- const distPath = path.join(cwd, 'dist');
18
- rimraf.sync(distPath);
19
- } catch (error) {
20
- console.log('BomCompiler.clean', error);
21
- }
22
- }
23
-
24
- function build() {
25
- try {
26
- const rollupConfigPath = path.join(__dirname, 'rollup.config.js');
27
- spawn.sync(
28
- 'rollup',
29
- ['-c', rollupConfigPath, '--bundleConfigAsCjs'],
30
- {
31
- stdio: 'inherit',
32
- }
33
- );
34
- } catch (error) {
35
- console.log('BomCompiler.build', error);
36
- }
37
- }
38
-
39
- function emitDeclaration() {
40
- const cwd = process.cwd();
41
- const tsConfigPath = path.join(cwd, 'tsconfig.declaration.json');
42
- try {
43
- console.log('emitDeclaration', tsConfigPath);
44
- const tsConfigData = getDeclarationConfig();
45
- fs.writeFileSync(tsConfigPath, tsConfigData, 'utf-8');
46
- spawn.sync(
47
- 'tsc',
48
- ['--project', tsConfigPath, '--emitDeclarationOnly'],
49
- {
50
- stdio: 'inherit',
51
- });
52
- } catch (error) {
53
- console.log('BomCompiler.emitDeclaration', error);
54
- } finally {
55
- if (fs.statSync(tsConfigPath, { throwIfNoEntry: false })) {
56
- fs.unlinkSync(tsConfigPath);
57
- }
58
- }
59
- }
60
-
61
- function getDeclarationConfig() {
62
- return /* javascript */`
63
- {
64
- "extends": "./tsconfig.json",
65
- "exclude": [
66
- "jest.config.ts",
67
- "tsup.config.ts",
68
- "**/*.test.ts",
69
- "**/*.test.tsx",
70
- "node_modules",
71
- "dist"
72
- ],
73
- "compilerOptions": {
74
- "rootDir": "./src",
75
- "sourceMap": true,
76
- "resolveJsonModule": true,
77
- "emitDeclarationOnly": true,
78
- "declaration": true,
79
- "declarationDir": "./dist/types"
80
- }
81
- }`;
82
- }
83
-
84
- module.exports = {
85
- resolveDirname,
86
- clean,
87
- build,
88
- emitDeclaration,
89
- };
1
+
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+
5
+ function resolveDirname(pathname) {
6
+ if (!/\.(t|j)s$/.test(pathname)) {
7
+ return pathname;
8
+ }
9
+ return path.dirname(pathname);
10
+ }
11
+
12
+ async function clean() {
13
+ try {
14
+ const cwd = process.cwd();
15
+ const distPath = path.join(cwd, 'dist');
16
+ fs.rmSync(distPath, { recursive: true, force: true });
17
+ } catch (error) {
18
+ console.log('BomCompiler.clean', error);
19
+ }
20
+ }
21
+
22
+ function escapeRegExp(text) {
23
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
24
+ }
25
+
26
+ /**
27
+ * Shared tsdown options: unbundled modules from `src/index.ts`, dependencies and peerDependencies
28
+ * of the compiled package kept external (and devDependencies for declarations, that reference them).
29
+ */
30
+ function getOptions(withDevDependencies = false) {
31
+ const cwd = process.cwd();
32
+ const packageJson = JSON.parse(fs.readFileSync(path.join(cwd, 'package.json'), 'utf-8'));
33
+ const externals = [
34
+ ...Object.keys(packageJson.dependencies || {}),
35
+ ...Object.keys(packageJson.peerDependencies || {}),
36
+ ...(withDevDependencies ? Object.keys(packageJson.devDependencies || {}) : []),
37
+ ].map(name => new RegExp(`^${escapeRegExp(name)}(/|$)`));
38
+ const tsconfig = path.join(cwd, 'tsconfig.json');
39
+ return {
40
+ config: false,
41
+ cwd,
42
+ entry: ['src/index.ts'],
43
+ deps: { neverBundle: externals },
44
+ format: 'esm',
45
+ outExtensions: () => ({ dts: '.d.ts', js: '.js' }),
46
+ platform: 'neutral',
47
+ tsconfig: fs.existsSync(tsconfig) ? tsconfig : false,
48
+ unbundle: true,
49
+ };
50
+ }
51
+
52
+ async function build() {
53
+ try {
54
+ const { build: tsdown } = await import('tsdown');
55
+ await tsdown({
56
+ ...getOptions(),
57
+ dts: false,
58
+ outDir: 'dist/esm',
59
+ sourcemap: true,
60
+ });
61
+ } catch (error) {
62
+ console.log('BomCompiler.build', error);
63
+ }
64
+ }
65
+
66
+ async function emitDeclaration() {
67
+ try {
68
+ const { build: tsdown } = await import('tsdown');
69
+ await tsdown({
70
+ ...getOptions(true),
71
+ dts: { emitDtsOnly: true },
72
+ outDir: 'dist/types',
73
+ });
74
+ } catch (error) {
75
+ console.log('BomCompiler.emitDeclaration', error);
76
+ }
77
+ }
78
+
79
+ module.exports = {
80
+ resolveDirname,
81
+ clean,
82
+ build,
83
+ emitDeclaration,
84
+ };
package/package.json CHANGED
@@ -1,58 +1,31 @@
1
- {
2
- "name": "@websolutespa/bom-compiler",
3
- "version": "3.0.0",
4
- "description": "Compiler helper of the BOM Repository",
5
- "keywords": [
6
- "bom",
7
- "compiler"
8
- ],
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "git://github.com/websolutespa/bom.git"
13
- },
14
- "dependencies": {
15
- "@babel/core": "^7.24.4",
16
- "@babel/preset-env": "^7.24.4",
17
- "@babel/preset-react": "^7.24.1",
18
- "@babel/preset-typescript": "^7.24.1",
19
- "@rollup/plugin-babel": "^6.0.4",
20
- "@rollup/plugin-commonjs": "^25.0.7",
21
- "@rollup/plugin-json": "^6.1.0",
22
- "@rollup/plugin-node-resolve": "^15.2.3",
23
- "@rollup/plugin-terser": "^0.4.4",
24
- "@rollup/plugin-typescript": "^11.1.6",
25
- "@svgr/rollup": "^8.1.0",
26
- "autoprefixer": "^10.4.19",
27
- "babel-loader": "^9.1.3",
28
- "cross-spawn": "latest",
29
- "postcss-modules": "4.3.1",
30
- "postcss-modules-scope": "3.2.0",
31
- "rimraf": "3.0.2",
32
- "rollup-plugin-copy": "^3.5.0",
33
- "rollup-plugin-peer-deps-external": "^2.2.4",
34
- "rollup-plugin-postcss": "^4.0.2",
35
- "rollup-plugin-typescript2": "^0.36.0",
36
- "rollup": "^4.14.1",
37
- "sass-loader": "^14.1.1",
38
- "sass": "1.54.0"
39
- },
40
- "peerDependencies": {
41
- "react": "19.2.3",
42
- "react-dom": "19.2.3"
43
- },
44
- "devDependencies": {
45
- "@types/cross-spawn": "latest",
46
- "@types/react": "19.2.10",
47
- "@types/react-dom": "19.2.3",
48
- "@websolutespa/tsconfig": "*",
49
- "@websolutespa/eslint-config": "*",
50
- "typescript": "5.8.3"
51
- },
52
- "publishConfig": {
53
- "access": "public"
54
- },
55
- "sideEffects": false,
56
- "main": "./index.js",
57
- "types": "./index.d.ts"
58
- }
1
+ {
2
+ "name": "@websolutespa/bom-compiler",
3
+ "version": "3.1.0",
4
+ "description": "Compiler helper of the BOM Repository",
5
+ "keywords": [
6
+ "bom",
7
+ "compiler"
8
+ ],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git://github.com/websolutespa/bom.git"
13
+ },
14
+ "dependencies": {
15
+ "tsdown": "0.21.0"
16
+ },
17
+ "peerDependencies": {
18
+ "typescript": "^6.0.3"
19
+ },
20
+ "devDependencies": {
21
+ "@websolutespa/eslint-config": "^3.1.0",
22
+ "@websolutespa/tsconfig": "^3.1.0",
23
+ "typescript": "6.0.3"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "sideEffects": false,
29
+ "main": "./index.js",
30
+ "types": "./index.d.ts"
31
+ }
package/babel.config.js DELETED
@@ -1,35 +0,0 @@
1
- // @ts-check
2
- const test = process.env.NODE_ENV === 'test';
3
- const prod = process.env.NODE_ENV === 'production';
4
-
5
- /** @type {import("@babel/core").ParserOptions} */
6
- module.exports = {
7
- presets: [
8
- [
9
- '@babel/preset-env',
10
- {
11
- loose: true,
12
- targets: test ?
13
- { node: 'current' } :
14
- { browsers: 'defaults, not IE 11' },
15
- },
16
- ],
17
- [
18
- '@babel/preset-react',
19
- {
20
- runtime: 'automatic',
21
- },
22
- ],
23
- '@babel/preset-typescript',
24
- ],
25
- /*
26
- plugins: [
27
- false && [
28
- 'babel-plugin-styled-components',
29
- {
30
- 'ssr': true
31
- }
32
- ],
33
- ].filter(Boolean),
34
- */
35
- };
package/rollup.config.js DELETED
@@ -1,161 +0,0 @@
1
- import { babel } from '@rollup/plugin-babel';
2
- import json from '@rollup/plugin-json';
3
- import terser from '@rollup/plugin-terser';
4
- import typescript from '@rollup/plugin-typescript';
5
- import svgr from '@svgr/rollup';
6
- import autoprefixer from 'autoprefixer';
7
- import * as path from 'path';
8
- import peerDepsExternal from 'rollup-plugin-peer-deps-external';
9
- import postcss from 'rollup-plugin-postcss';
10
- // import { nodeResolve } from '@rollup/plugin-node-resolve';
11
- // import typescript from 'rollup-plugin-typescript2';
12
-
13
- const DEBUG = true;
14
- const TERSER = false;
15
-
16
- const extensions = ['.ts', '.tsx', '.js', '.jsx', '.json', '.scss', '.css'];
17
-
18
- const cwd = process.cwd();
19
-
20
- const packagePath = path.join(cwd, 'package.json');
21
-
22
- const packageJson = require(packagePath);
23
- const outputCjs = './dist/cjs/index.js'; // packageJson.main;
24
- const outputEsm = './dist/esm'; // path.dirname(packageJson.module);
25
-
26
- function getBabelConfigFile() {
27
- return path.resolve(__dirname, 'babel.config.js');
28
- }
29
-
30
- const cssExportMap = {};
31
-
32
- /** @type {import('rollup').RollupOptions} */
33
- const rollupConfig = {
34
- input: 'src/index.ts',
35
- makeAbsoluteExternalsRelative: true,
36
- output: [
37
- /*
38
- {
39
- format: 'cjs',
40
- file: outputCjs,
41
- sourcemap: true,
42
- interop: 'auto',
43
- exports: 'named',
44
- hoistTransitiveImports: false,
45
- dynamicImportInCjs: true,
46
- },
47
- */
48
- {
49
- format: 'esm',
50
- dir: outputEsm,
51
- sourcemap: true,
52
- interop: 'auto',
53
- hoistTransitiveImports: false,
54
- preserveModules: true,
55
- preserveModulesRoot: 'src',
56
- },
57
- ],
58
- plugins: [
59
- peerDepsExternal({
60
- includeDependencies: true,
61
- }),
62
- // nodeResolve({ extensions, preferBuiltins: false }),
63
- // resolve(),
64
- // commonjs({ include: /node_modules/ }),
65
- json(),
66
- svgr({
67
- icon: true,
68
- replaceAttrValues: {
69
- fill: 'currentColor',
70
- stroke: 'currentColor',
71
- },
72
- }),
73
- postcss({
74
- modules: true,
75
- autoModules: true,
76
- extract: false,
77
- use: ['sass'],
78
- extensions: ['.css', '.scss'],
79
- inject: true,
80
- plugins: [
81
- autoprefixer(),
82
- /*
83
- postcssModules({
84
- getJSON: function(cssFileName, json, outputFileName) {
85
- // nope
86
- },
87
- exportGlobals: true,
88
- }),
89
- */
90
- ],
91
- }),
92
- /*
93
- scss({
94
- fileName: 'index.css',
95
- }),
96
- */
97
- typescript({
98
- compilerOptions: {
99
- baseUrl: '.',
100
- rootDir: './src',
101
- sourceMap: true,
102
- composite: false,
103
- declaration: false,
104
- declarationMap: false,
105
- allowSyntheticDefaultImports: true,
106
- },
107
- /*
108
- compilerOptions: {
109
- baseUrl: '.',
110
- rootDir: './src',
111
- sourceMap: true,
112
- allowSyntheticDefaultImports: true,
113
- declarationDir: './dist/types',
114
- ...(DEBUG && TERSER && {
115
- composite: false,
116
- declaration: false,
117
- declarationMap: false,
118
- })
119
- },
120
- */
121
- /*
122
- compilerOptions: {
123
- declaration: true,
124
- declarationDir: './types',
125
- },
126
- */
127
- exclude: [
128
- 'node_modules',
129
- 'dist',
130
- 'types',
131
- '**/*.test.ts',
132
- '**/*.test.tsx',
133
- ],
134
- /*
135
- clean: true,
136
- useTsconfigDeclarationDir: true,
137
- tsconfigOverride: {
138
- declaration: false,
139
- exclude: [
140
- '***.test.ts',
141
- '***.test.tsx',
142
- ],
143
- },
144
- */
145
- }),
146
- babel({
147
- configFile: getBabelConfigFile(),
148
- extensions,
149
- babelHelpers: 'bundled',
150
- exclude: [
151
- 'node_modules',
152
- ],
153
- }),
154
- !DEBUG && terser({
155
- compress: false,
156
- mangle: false,
157
- }),
158
- ].filter(Boolean),
159
- };
160
-
161
- export default rollupConfig;