@absolutejs/absolute 0.19.0-beta.212 → 0.19.0-beta.214
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/.absolutejs/cache/angular-linker/03f269392dcdbe53b0482927caa1ff17.js +33 -0
- package/.absolutejs/cache/angular-linker/341d75bd709b8e3da5e0191e3ae7ff34.js +2029 -0
- package/.absolutejs/cache/angular-linker/54161bce55bb149350556317e341619b.js +2872 -0
- package/.absolutejs/cache/angular-linker/58ef0a50d4370cda2b180a0e28ccc9a0.js +381 -0
- package/.absolutejs/cache/angular-linker/6d5602e0777a6bf3dc286d1418e37eeb.js +593 -0
- package/.absolutejs/cache/angular-linker/73f3352125fe12196d76075dab653b06.js +2836 -0
- package/.absolutejs/cache/angular-linker/8d0343b38de78de9075d2b7aaef4a0d6.js +693 -0
- package/.absolutejs/cache/angular-linker/cd4015dfcb0e8b06d279f929ba472d70.js +122 -0
- package/.absolutejs/cache/angular-linker/d7949b8b530e790ee1d7c5f4d9f4e561.js +314 -0
- package/.absolutejs/cache/angular-linker/e1bf85e34581dfb0ed6555e030c158e2.js +1351 -0
- package/.absolutejs/prettier.cache.json +236 -0
- package/.absolutejs/tsc.tsbuildinfo +1 -0
- package/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/.absolutejs/tsconfig.vue-check.json +6 -0
- package/.absolutejs/vue-tsc.tsbuildinfo +1 -1
- package/build/.cache/images/47f6059ee156360b7a041933b4978cbcb2011a1c9a67d833558d233472be079b.data +0 -0
- package/build/.cache/images/47f6059ee156360b7a041933b4978cbcb2011a1c9a67d833558d233472be079b.meta +1 -0
- package/build/.cache/images/5099ad2f32e4636aa812b97dd0dff1d1b439e24b5e97b2d55fe4f77367f461a4.data +0 -0
- package/build/.cache/images/5099ad2f32e4636aa812b97dd0dff1d1b439e24b5e97b2d55fe4f77367f461a4.meta +1 -0
- package/build/.cache/images/6ee00034d791ddd8b7f3ec800a222632adaf1e8c9fcedc480c773466fc10d1d5.data +0 -0
- package/build/.cache/images/6ee00034d791ddd8b7f3ec800a222632adaf1e8c9fcedc480c773466fc10d1d5.meta +1 -0
- package/build/.cache/images/70714161d457f1df2ede250334bd6060a38a652f10f043791c77d853f3005930.data +0 -0
- package/build/.cache/images/70714161d457f1df2ede250334bd6060a38a652f10f043791c77d853f3005930.meta +1 -0
- package/build/.cache/images/7eda684ed9d49b20bd3f8a52c1d2567c7c01a8b73fd7f880a103c0ec3c14f475.data +0 -0
- package/build/.cache/images/7eda684ed9d49b20bd3f8a52c1d2567c7c01a8b73fd7f880a103c0ec3c14f475.meta +1 -0
- package/build/.cache/images/926071f8d8f974eb91ccf882b478526c5926bc6693d663cdd304c57e7b3e0746.data +0 -0
- package/build/.cache/images/926071f8d8f974eb91ccf882b478526c5926bc6693d663cdd304c57e7b3e0746.meta +1 -0
- package/build/.cache/images/99fa4c4518e49ec0b205f2c67f9d535672053b80c8637540f9ce759ae5f6bbce.data +0 -0
- package/build/.cache/images/99fa4c4518e49ec0b205f2c67f9d535672053b80c8637540f9ce759ae5f6bbce.meta +1 -0
- package/build/.cache/images/d6ecd32c804dc52e56da07bd7d05876ff7f02e2e193baa94e15d1cf9022404d7.data +0 -0
- package/build/.cache/images/d6ecd32c804dc52e56da07bd7d05876ff7f02e2e193baa94e15d1cf9022404d7.meta +1 -0
- package/build/.cache/images/e68219762a1b21ec08ddaf67023cbd689c7f23ab406efa076007b36e4d5844d4.data +0 -0
- package/build/.cache/images/e68219762a1b21ec08ddaf67023cbd689c7f23ab406efa076007b36e4d5844d4.meta +1 -0
- package/build/.cache/images/e6c1d2e1ea4f97ba38de446e595eb7e0a54f50e282f4d3e02d94d9fd17057066.data +0 -0
- package/build/.cache/images/e6c1d2e1ea4f97ba38de446e595eb7e0a54f50e282f4d3e02d94d9fd17057066.meta +1 -0
- package/build/.cache/images/f422de3006871f116d1e262ada57671fd9a77d6922b565de81cdc7c574fdccb2.data +0 -0
- package/build/.cache/images/f422de3006871f116d1e262ada57671fd9a77d6922b565de81cdc7c574fdccb2.meta +1 -0
- package/build/assets/jpg/test.jpg +0 -0
- package/build/sitemap.xml +3 -0
- package/dist/{Image-599vc5xz.vue → Image-k52pzpdh.vue} +71 -37
- package/dist/angular/components/image.component.js +27 -19
- package/dist/angular/index.js.map +2 -2
- package/dist/build.js +6 -12
- package/dist/build.js.map +5 -5
- package/dist/cli/index.js +53 -11
- package/dist/image-client/imageClient.js +1 -10
- package/dist/index.js +6 -12
- package/dist/index.js.map +6 -6
- package/dist/react/components/browser/index.js +1 -10
- package/dist/react/components/index.js +6 -12
- package/dist/react/components/index.js.map +4 -4
- package/dist/svelte/components/Image.svelte +8 -5
- package/dist/vue/components/Image.vue +71 -37
- package/dist/vue/components/index.js +1 -1
- package/package.json +1 -1
- package/scripts/build.ts +308 -295
- package/types/metadata.ts +7 -1
package/scripts/build.ts
CHANGED
|
@@ -1,316 +1,329 @@
|
|
|
1
|
-
import { $ } from
|
|
2
|
-
import { rm, cp, mkdir, readdir, writeFile } from
|
|
3
|
-
import { join, dirname, basename, resolve, relative } from
|
|
4
|
-
import ts from
|
|
1
|
+
import { $ } from 'bun';
|
|
2
|
+
import { rm, cp, mkdir, readdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join, dirname, basename, resolve, relative } from 'node:path';
|
|
4
|
+
import ts from 'typescript';
|
|
5
5
|
|
|
6
|
-
const DIST =
|
|
6
|
+
const DIST = 'dist';
|
|
7
7
|
|
|
8
8
|
const SERVER_ENTRY_POINTS = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
'src/index.ts',
|
|
10
|
+
'src/build.ts',
|
|
11
|
+
'src/angular/index.ts',
|
|
12
|
+
'src/react/index.ts',
|
|
13
|
+
'src/react/components/index.ts',
|
|
14
|
+
'src/react/hooks/index.ts',
|
|
15
|
+
'src/svelte/index.ts',
|
|
16
|
+
'src/vue/index.ts',
|
|
17
|
+
'src/vue/components/index.ts'
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
const EXTERNALS = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
'react',
|
|
22
|
+
'react-dom',
|
|
23
|
+
'vue',
|
|
24
|
+
'@vue/compiler-sfc',
|
|
25
|
+
'vue/server-renderer',
|
|
26
|
+
'svelte',
|
|
27
|
+
'svelte/compiler',
|
|
28
|
+
'svelte/server',
|
|
29
|
+
'elysia',
|
|
30
|
+
'@elysiajs/static',
|
|
31
|
+
'@angular/compiler-cli',
|
|
32
|
+
'@angular/core',
|
|
33
|
+
'@angular/common',
|
|
34
|
+
'@angular/platform-browser',
|
|
35
|
+
'@angular/platform-server',
|
|
36
|
+
'@angular/ssr',
|
|
37
|
+
'zone.js',
|
|
38
|
+
'debug',
|
|
39
|
+
'sharp',
|
|
40
|
+
'@absolutejs/native-linux-x64',
|
|
41
|
+
'@absolutejs/native-linux-arm64',
|
|
42
|
+
'@absolutejs/native-darwin-x64',
|
|
43
|
+
'@absolutejs/native-darwin-arm64'
|
|
44
44
|
];
|
|
45
45
|
|
|
46
46
|
async function build() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
47
|
+
console.log('Cleaning dist/...');
|
|
48
|
+
await rm(DIST, { recursive: true, force: true });
|
|
49
|
+
|
|
50
|
+
console.log('Building server entry points...');
|
|
51
|
+
const serverBuild = await Bun.build({
|
|
52
|
+
entrypoints: SERVER_ENTRY_POINTS,
|
|
53
|
+
outdir: DIST,
|
|
54
|
+
sourcemap: 'linked',
|
|
55
|
+
target: 'bun',
|
|
56
|
+
external: EXTERNALS,
|
|
57
|
+
root: 'src'
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!serverBuild.success) {
|
|
61
|
+
console.error('Server build failed:');
|
|
62
|
+
for (const log of serverBuild.logs) console.error(log);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
console.log('Building image client (browser target)...');
|
|
67
|
+
const imageBuild = await Bun.build({
|
|
68
|
+
entrypoints: ['src/utils/imageClient.ts'],
|
|
69
|
+
outdir: join(DIST, 'image-client'),
|
|
70
|
+
target: 'browser'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (!imageBuild.success) {
|
|
74
|
+
console.error('Image client build failed:');
|
|
75
|
+
for (const log of imageBuild.logs) console.error(log);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log('Building React components (browser target)...');
|
|
80
|
+
const reactBrowserBuild = await Bun.build({
|
|
81
|
+
entrypoints: ['src/react/components/index.ts'],
|
|
82
|
+
outdir: join(DIST, 'react', 'components', 'browser'),
|
|
83
|
+
target: 'browser',
|
|
84
|
+
root: 'src/react/components',
|
|
85
|
+
external: [
|
|
86
|
+
'react',
|
|
87
|
+
'react-dom',
|
|
88
|
+
'react/jsx-runtime',
|
|
89
|
+
'react/jsx-dev-runtime'
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (!reactBrowserBuild.success) {
|
|
94
|
+
console.error('React browser build failed:');
|
|
95
|
+
for (const log of reactBrowserBuild.logs) console.error(log);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
console.log('Building CLI...');
|
|
100
|
+
const cliBuild = await Bun.build({
|
|
101
|
+
entrypoints: ['src/cli/index.ts'],
|
|
102
|
+
outdir: join(DIST, 'cli'),
|
|
103
|
+
target: 'bun'
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (!cliBuild.success) {
|
|
107
|
+
console.error('CLI build failed:');
|
|
108
|
+
for (const log of cliBuild.logs) console.error(log);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
console.log('Generating type declarations...');
|
|
113
|
+
await $`tsc --emitDeclarationOnly --project tsconfig.build.json`;
|
|
114
|
+
|
|
115
|
+
console.log('Copying static assets...');
|
|
116
|
+
|
|
117
|
+
await mkdir(join(DIST, 'dev'), { recursive: true });
|
|
118
|
+
await cp('src/dev/client', join(DIST, 'dev', 'client'), {
|
|
119
|
+
recursive: true
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
await mkdir(join(DIST, 'svelte', 'components'), { recursive: true });
|
|
123
|
+
const svelteFiles = await readdir('src/svelte/components');
|
|
124
|
+
for (const file of svelteFiles.filter((f) => f.endsWith('.svelte'))) {
|
|
125
|
+
await cp(
|
|
126
|
+
join('src', 'svelte', 'components', file),
|
|
127
|
+
join(DIST, 'svelte', 'components', file)
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
await mkdir(join(DIST, 'vue', 'components'), { recursive: true });
|
|
132
|
+
const vueFiles = await readdir('src/vue/components');
|
|
133
|
+
for (const file of vueFiles.filter((f) => f.endsWith('.vue'))) {
|
|
134
|
+
await cp(
|
|
135
|
+
join('src', 'vue', 'components', file),
|
|
136
|
+
join(DIST, 'vue', 'components', file)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Generate .d.ts files for SFC components so consumers get type safety
|
|
141
|
+
console.log('Generating SFC type declarations...');
|
|
142
|
+
await generateSfcDeclarations();
|
|
143
|
+
|
|
144
|
+
// Compile Angular components with partial compilation (ɵɵngDeclareComponent)
|
|
145
|
+
// so they work in both AOT (via linker) and JIT (via runtime fallback)
|
|
146
|
+
console.log('Compiling Angular components (partial)...');
|
|
147
|
+
await compileAngularComponentsPartial();
|
|
148
|
+
|
|
149
|
+
console.log('Verifying exports...');
|
|
150
|
+
await verifyExports();
|
|
151
|
+
|
|
152
|
+
console.log('Build complete.');
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
async function generateSfcDeclarations() {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
156
|
+
// Svelte component declarations
|
|
157
|
+
const svelteComponentDir = join(DIST, 'svelte', 'components');
|
|
158
|
+
const svelteFiles = await readdir(svelteComponentDir);
|
|
159
|
+
for (const file of svelteFiles.filter((f) => f.endsWith('.svelte'))) {
|
|
160
|
+
const content = await Bun.file(join(svelteComponentDir, file)).text();
|
|
161
|
+
const propsMatch = content.match(/\}:\s*(\w+)\s*=\s*\$props\(\)/);
|
|
162
|
+
const propsType = propsMatch?.[1];
|
|
163
|
+
const name = file.replace(/\.svelte$/, '');
|
|
164
|
+
|
|
165
|
+
let dts: string;
|
|
166
|
+
if (propsType === 'ImageProps') {
|
|
167
|
+
dts = `import type { ImageProps } from '../../types/image';\nimport { SvelteComponent } from 'svelte';\ndeclare const __propDef: { props: ImageProps };\ntype Props = typeof __propDef.props;\nexport default class ${name} extends SvelteComponent<Props> {}\n`;
|
|
168
|
+
} else if (propsType) {
|
|
169
|
+
dts = `import type { ${propsType} } from '../../types/metadata';\nimport { SvelteComponent } from 'svelte';\ndeclare const __propDef: { props: ${propsType} };\ntype Props = typeof __propDef.props;\nexport default class ${name} extends SvelteComponent<Props> {}\n`;
|
|
170
|
+
} else {
|
|
171
|
+
dts = `import { SvelteComponent } from 'svelte';\nexport default class ${name} extends SvelteComponent {}\n`;
|
|
172
|
+
}
|
|
173
|
+
await writeFile(join(svelteComponentDir, `${file}.d.ts`), dts);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Vue component declarations
|
|
177
|
+
const vueComponentDir = join(DIST, 'vue', 'components');
|
|
178
|
+
const vueFiles = await readdir(vueComponentDir);
|
|
179
|
+
for (const file of vueFiles.filter((f) => f.endsWith('.vue'))) {
|
|
180
|
+
const content = await Bun.file(join(vueComponentDir, file)).text();
|
|
181
|
+
const name = file.replace(/\.vue$/, '');
|
|
182
|
+
|
|
183
|
+
// Check if it uses defineProps<ImageProps> or inline props
|
|
184
|
+
const hasImageProps =
|
|
185
|
+
content.includes('ImageProps') || content.includes('defineProps<{');
|
|
186
|
+
let dts: string;
|
|
187
|
+
if (name === 'Image' || hasImageProps) {
|
|
188
|
+
dts = `import type { ImageProps } from '../../types/image';\nimport { DefineComponent } from 'vue';\ndeclare const _default: DefineComponent<ImageProps>;\nexport default _default;\n`;
|
|
189
|
+
} else {
|
|
190
|
+
dts = `import { DefineComponent } from 'vue';\ndeclare const _default: DefineComponent;\nexport default _default;\n`;
|
|
191
|
+
}
|
|
192
|
+
await writeFile(join(vueComponentDir, `${file}.d.ts`), dts);
|
|
193
|
+
}
|
|
186
194
|
}
|
|
187
195
|
|
|
188
196
|
async function compileAngularComponentsPartial() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
197
|
+
const { readConfiguration, performCompilation, EmitFlags } = await import(
|
|
198
|
+
'@angular/compiler-cli'
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
const finalDir = join(DIST, 'angular', 'components');
|
|
202
|
+
await mkdir(finalDir, { recursive: true });
|
|
203
|
+
|
|
204
|
+
// Use a temp output dir outside dist/ to avoid conflicts with existing compiled files
|
|
205
|
+
const tmpDir = '.angular-partial-tmp';
|
|
206
|
+
const outDir = join(tmpDir, 'out');
|
|
207
|
+
const srcDir = join(tmpDir, 'src');
|
|
208
|
+
await mkdir(outDir, { recursive: true });
|
|
209
|
+
await mkdir(srcDir, { recursive: true });
|
|
210
|
+
|
|
211
|
+
const srcFiles = await readdir('src/angular/components');
|
|
212
|
+
for (const file of srcFiles.filter((f) => f.endsWith('.ts'))) {
|
|
213
|
+
let content = await Bun.file(
|
|
214
|
+
join('src', 'angular', 'components', file)
|
|
215
|
+
).text();
|
|
216
|
+
content = content.replace(
|
|
217
|
+
/from\s+(['"])\.\.\/\.\.\/utils\/imageProcessing['"]/g,
|
|
218
|
+
'from $1@absolutejs/absolute/image$1'
|
|
219
|
+
);
|
|
220
|
+
await Bun.write(join(srcDir, file), content);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const config = readConfiguration('./tsconfig.json');
|
|
224
|
+
const options = {
|
|
225
|
+
...config.options,
|
|
226
|
+
compilationMode: 'partial' as const,
|
|
227
|
+
declaration: false,
|
|
228
|
+
emitDecoratorMetadata: true,
|
|
229
|
+
experimentalDecorators: true,
|
|
230
|
+
module: ts.ModuleKind.ESNext,
|
|
231
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
232
|
+
newLine: ts.NewLineKind.LineFeed,
|
|
233
|
+
outDir,
|
|
234
|
+
rootDir: resolve('.'),
|
|
235
|
+
skipLibCheck: true,
|
|
236
|
+
suppressOutputPathCheck: true,
|
|
237
|
+
target: ts.ScriptTarget.ES2022
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const host = ts.createCompilerHost(options);
|
|
241
|
+
|
|
242
|
+
// Capture only files emitted from our source dir (not external deps like imageClient)
|
|
243
|
+
const emitted: Record<string, string> = {};
|
|
244
|
+
const resolvedSrcInOut = resolve(
|
|
245
|
+
outDir,
|
|
246
|
+
relative(resolve('.'), resolve(srcDir))
|
|
247
|
+
);
|
|
248
|
+
host.writeFile = (fileName, text) => {
|
|
249
|
+
const absFileName = resolve(fileName);
|
|
250
|
+
if (!absFileName.startsWith(resolvedSrcInOut)) return;
|
|
251
|
+
const rel = absFileName.substring(resolvedSrcInOut.length + 1);
|
|
252
|
+
emitted[rel] = text;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const rootNames = srcFiles
|
|
256
|
+
.filter((f) => f.endsWith('.ts'))
|
|
257
|
+
.map((f) => resolve(srcDir, f));
|
|
258
|
+
|
|
259
|
+
const { diagnostics } = performCompilation({
|
|
260
|
+
emitFlags: EmitFlags.Default,
|
|
261
|
+
host,
|
|
262
|
+
options,
|
|
263
|
+
rootNames
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const errors = diagnostics.filter(
|
|
267
|
+
(d: ts.Diagnostic) => d.category === ts.DiagnosticCategory.Error
|
|
268
|
+
);
|
|
269
|
+
if (errors.length > 0) {
|
|
270
|
+
console.error('Angular partial compilation errors:');
|
|
271
|
+
for (const d of errors) {
|
|
272
|
+
console.error(ts.flattenDiagnosticMessageText(d.messageText, '\n'));
|
|
273
|
+
}
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Copy emitted JS files to final dir, adding .js extensions to relative imports
|
|
278
|
+
for (const [fileName, content] of Object.entries(emitted)) {
|
|
279
|
+
if (!fileName.endsWith('.js')) continue;
|
|
280
|
+
const processed = content.replace(
|
|
281
|
+
/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g,
|
|
282
|
+
(match, quote, path) => {
|
|
283
|
+
if (!path.match(/\.(js|ts|mjs|cjs)$/)) {
|
|
284
|
+
return `from ${quote}${path}.js${quote}`;
|
|
285
|
+
}
|
|
286
|
+
return match;
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
await writeFile(join(finalDir, fileName), processed);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Clean up temp dir
|
|
293
|
+
await rm(tmpDir, { recursive: true, force: true });
|
|
281
294
|
}
|
|
282
295
|
|
|
283
296
|
async function verifyExports() {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
297
|
+
const pkg = await Bun.file('package.json').json();
|
|
298
|
+
const exports = pkg.exports as Record<
|
|
299
|
+
string,
|
|
300
|
+
{ import?: string; types?: string }
|
|
301
|
+
>;
|
|
302
|
+
const missing: string[] = [];
|
|
303
|
+
|
|
304
|
+
for (const [key, value] of Object.entries(exports)) {
|
|
305
|
+
if (value.import) {
|
|
306
|
+
const path = value.import.replace('./', '');
|
|
307
|
+
const file = Bun.file(path);
|
|
308
|
+
if (!(await file.exists())) {
|
|
309
|
+
missing.push(`${key} → ${value.import}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (pkg.main) {
|
|
315
|
+
const mainPath = pkg.main.replace('./', '');
|
|
316
|
+
const file = Bun.file(mainPath);
|
|
317
|
+
if (!(await file.exists())) {
|
|
318
|
+
missing.push(`main → ${pkg.main}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (missing.length > 0) {
|
|
323
|
+
console.error('\nExport verification failed! Missing files:');
|
|
324
|
+
for (const m of missing) console.error(` ${m}`);
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
314
327
|
}
|
|
315
328
|
|
|
316
329
|
build();
|
package/types/metadata.ts
CHANGED
|
@@ -35,7 +35,13 @@ export type RobotsDirective = {
|
|
|
35
35
|
export type MetaTag = {
|
|
36
36
|
name?: string;
|
|
37
37
|
property?: string;
|
|
38
|
-
httpEquiv?:
|
|
38
|
+
httpEquiv?:
|
|
39
|
+
| 'accept-ch'
|
|
40
|
+
| 'content-security-policy'
|
|
41
|
+
| 'content-type'
|
|
42
|
+
| 'default-style'
|
|
43
|
+
| 'refresh'
|
|
44
|
+
| 'x-ua-compatible';
|
|
39
45
|
content: string;
|
|
40
46
|
};
|
|
41
47
|
|