@absolutejs/absolute 0.1.5 → 0.1.7
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/dist/index.js +88 -88
- package/dist/src/core/build.d.ts +11 -1
- package/package.json +3 -2
- package/src/core/build.ts +14 -12
package/dist/src/core/build.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
type BuildConfig = {
|
|
2
|
+
buildDir?: string;
|
|
3
|
+
assetsDir?: string;
|
|
4
|
+
reactIndexDir?: string;
|
|
5
|
+
javascriptDir?: string;
|
|
6
|
+
typeScriptDir?: string;
|
|
7
|
+
reactPagesDir?: string;
|
|
8
|
+
htmlDir?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const build: ({ buildDir, assetsDir, reactIndexDir, javascriptDir, typeScriptDir, reactPagesDir, htmlDir }?: BuildConfig) => Promise<Record<string, string>>;
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/absolute",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A fullstack meta-framework for building web applications with TypeScript",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"build": "rm -rf dist && bun build src/index.ts --outdir dist --minify --splitting --target=bun && tsc --emitDeclarationOnly --project tsconfig.json",
|
|
15
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
16
16
|
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
|
|
17
|
-
"dev": "bun run --watch example/server.ts"
|
|
17
|
+
"dev": "bun run --watch example/server.ts",
|
|
18
|
+
"release": "bun run build && bun publish"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@elysiajs/static": "1.0.2",
|
package/src/core/build.ts
CHANGED
|
@@ -22,25 +22,27 @@ type BuildConfig = {
|
|
|
22
22
|
export const build = async ({
|
|
23
23
|
buildDir = "build",
|
|
24
24
|
assetsDir = "src/backend/assets",
|
|
25
|
-
reactIndexDir
|
|
26
|
-
javascriptDir
|
|
27
|
-
typeScriptDir
|
|
28
|
-
reactPagesDir
|
|
29
|
-
htmlDir
|
|
25
|
+
reactIndexDir,
|
|
26
|
+
javascriptDir,
|
|
27
|
+
typeScriptDir,
|
|
28
|
+
reactPagesDir,
|
|
29
|
+
htmlDir
|
|
30
30
|
}:BuildConfig = {}) => {
|
|
31
31
|
const start = performance.now();
|
|
32
32
|
|
|
33
33
|
const projectRoot = cwd();
|
|
34
34
|
const buildDirAbsolute = join(projectRoot, buildDir);
|
|
35
35
|
const assetsDirAbsolute = join(projectRoot, assetsDir);
|
|
36
|
-
const reactIndexDirAbsolute = join(projectRoot, reactIndexDir)
|
|
37
|
-
const javascriptDirAbsolute = join(projectRoot, javascriptDir);
|
|
38
|
-
const typeScriptDirAbsolute = join(projectRoot, typeScriptDir);
|
|
39
|
-
const reactPagesDirAbsolute = join(projectRoot, reactPagesDir);
|
|
40
|
-
const htmlDirAbsolute = join(projectRoot, htmlDir);
|
|
36
|
+
const reactIndexDirAbsolute = reactIndexDir && join(projectRoot, reactIndexDir)
|
|
37
|
+
const javascriptDirAbsolute = javascriptDir && join(projectRoot, javascriptDir);
|
|
38
|
+
const typeScriptDirAbsolute = typeScriptDir && join(projectRoot, typeScriptDir);
|
|
39
|
+
const reactPagesDirAbsolute = reactPagesDir && join(projectRoot, reactPagesDir);
|
|
40
|
+
const htmlDirAbsolute = htmlDir && join(projectRoot, htmlDir);
|
|
41
41
|
|
|
42
42
|
await rm(buildDirAbsolute, { force: true, recursive: true });
|
|
43
|
-
await
|
|
43
|
+
await mkdir(buildDirAbsolute);
|
|
44
|
+
|
|
45
|
+
(reactPagesDirAbsolute && reactIndexDirAbsolute) && await generateReactIndexFiles(
|
|
44
46
|
reactPagesDirAbsolute,
|
|
45
47
|
reactIndexDirAbsolute
|
|
46
48
|
);
|
|
@@ -122,7 +124,7 @@ export const build = async ({
|
|
|
122
124
|
return acc;
|
|
123
125
|
}, {});
|
|
124
126
|
|
|
125
|
-
await updateScriptTags(manifest, htmlDirAbsolute);
|
|
127
|
+
htmlDirAbsolute && await updateScriptTags(manifest, htmlDirAbsolute);
|
|
126
128
|
|
|
127
129
|
const end = performance.now();
|
|
128
130
|
const durationMs = end - start;
|