@sse-ui/builder 1.0.0 → 1.0.1
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/babel-VTL3CZAT.js +110 -0
- package/dist/babel-config.d.ts +23 -0
- package/{src/babel-config.ts → dist/babel-config.js} +157 -189
- package/dist/build-DZbrXe0V.d.ts +3 -0
- package/{src/utils/build.ts → dist/chunk-5S2N5WDQ.js} +401 -609
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2628 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.js +7 -0
- package/dist/typescript-CS6YZCMJ.js +217 -0
- package/package.json +2 -1
- package/src/cli.ts +0 -44
- package/src/config.ts +0 -10
- package/src/core/build.ts +0 -621
- package/src/core/check-exports.ts +0 -88
- package/src/core/clean.ts +0 -32
- package/src/core/info.ts +0 -65
- package/src/core/link.ts +0 -44
- package/src/core/pack.ts +0 -43
- package/src/core/packageJson.d.ts +0 -740
- package/src/core/publish.ts +0 -96
- package/src/core/typecheck.ts +0 -28
- package/src/core/version.ts +0 -45
- package/src/core/watch.ts +0 -50
- package/src/untyped-plugins.d.ts +0 -66
- package/src/utils/babel.ts +0 -167
- package/src/utils/loadConfig.ts +0 -22
- package/src/utils/typescript.ts +0 -330
- package/tsconfig.json +0 -18
- package/tsup.config.ts +0 -9
package/src/core/clean.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { PackageJson } from "./packageJson";
|
|
5
|
-
|
|
6
|
-
export const cleanCommand = new Command("clean")
|
|
7
|
-
.description(
|
|
8
|
-
"Removes the build directory specified in package.json to start fresh",
|
|
9
|
-
)
|
|
10
|
-
.action(async () => {
|
|
11
|
-
const cwd = process.cwd();
|
|
12
|
-
const pkgJsonPath = path.join(cwd, "package.json");
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const packageJsonContent = await fs.readFile(pkgJsonPath, {
|
|
16
|
-
encoding: "utf8",
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const packageJson: PackageJson = JSON.parse(packageJsonContent);
|
|
20
|
-
const buildDirBase = packageJson.publishConfig?.directory || "build";
|
|
21
|
-
const buildDir = path.join(cwd, buildDirBase);
|
|
22
|
-
console.log(`🧹 Cleaning build directory: ${buildDirBase}...`);
|
|
23
|
-
await fs.rm(buildDir, { recursive: true, force: true });
|
|
24
|
-
console.log("✨ Cleaned successfully!");
|
|
25
|
-
} catch (error) {
|
|
26
|
-
console.error("❌ Error executing clean command:");
|
|
27
|
-
if (error instanceof Error) {
|
|
28
|
-
console.error(error.message);
|
|
29
|
-
}
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
});
|
package/src/core/info.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { PackageJson } from "./packageJson";
|
|
5
|
-
|
|
6
|
-
// Helper to recursively calculate directory size
|
|
7
|
-
async function getDirSize(dirPath: string): Promise<number> {
|
|
8
|
-
let size = 0;
|
|
9
|
-
const files = await fs.readdir(dirPath, { withFileTypes: true });
|
|
10
|
-
|
|
11
|
-
for (const file of files) {
|
|
12
|
-
const fullPath = path.join(dirPath, file.name);
|
|
13
|
-
if (file.isDirectory()) {
|
|
14
|
-
size += await getDirSize(fullPath);
|
|
15
|
-
} else {
|
|
16
|
-
const stats = await fs.stat(fullPath);
|
|
17
|
-
size += stats.size;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return size;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const infoCommand = new Command("info")
|
|
24
|
-
.description("Displays size and file statistics of the built package")
|
|
25
|
-
.action(async () => {
|
|
26
|
-
const cwd = process.cwd();
|
|
27
|
-
const pkgJsonPath = path.join(cwd, "package.json");
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const packageJsonContent = await fs.readFile(pkgJsonPath, {
|
|
31
|
-
encoding: "utf8",
|
|
32
|
-
});
|
|
33
|
-
const packageJson: PackageJson = JSON.parse(packageJsonContent);
|
|
34
|
-
|
|
35
|
-
const publishDirBase = packageJson.publishConfig?.directory;
|
|
36
|
-
if (!publishDirBase) {
|
|
37
|
-
throw new Error(`No publish directory specified in package.json.`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const publishDir = path.join(cwd, publishDirBase);
|
|
41
|
-
|
|
42
|
-
const sizeBytes = await getDirSize(publishDir);
|
|
43
|
-
const sizeKB = (sizeBytes / 1024).toFixed(2);
|
|
44
|
-
const sizeMB = (sizeBytes / (1024 * 1024)).toFixed(2);
|
|
45
|
-
|
|
46
|
-
console.log(`\n📊 Package Info: ${packageJson.name}`);
|
|
47
|
-
console.log(`================================`);
|
|
48
|
-
console.log(`Version: ${packageJson.version}`);
|
|
49
|
-
console.log(`Build Folder: ./${publishDirBase}`);
|
|
50
|
-
|
|
51
|
-
if (sizeBytes > 1024 * 1024) {
|
|
52
|
-
console.log(
|
|
53
|
-
`Total Size: ${sizeMB} MB ⚠️ (Consider keeping packages under 1MB)`,
|
|
54
|
-
);
|
|
55
|
-
} else {
|
|
56
|
-
console.log(`Total Size: ${sizeKB} KB ✅`);
|
|
57
|
-
}
|
|
58
|
-
console.log(`================================\n`);
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.error(
|
|
61
|
-
"❌ Error fetching package info. Did you build the project first?",
|
|
62
|
-
);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
});
|
package/src/core/link.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { $ } from "execa";
|
|
5
|
-
import { PackageJson } from "./packageJson";
|
|
6
|
-
|
|
7
|
-
export const linkCommand = new Command("link")
|
|
8
|
-
.description(
|
|
9
|
-
"Symlinks the built package directory so it can be tested in other local projects",
|
|
10
|
-
)
|
|
11
|
-
.action(async () => {
|
|
12
|
-
const cwd = process.cwd();
|
|
13
|
-
const pkgJsonPath = path.join(cwd, "package.json");
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const packageJsonContent = await fs.readFile(pkgJsonPath, {
|
|
17
|
-
encoding: "utf8",
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const packageJson: PackageJson = JSON.parse(packageJsonContent);
|
|
21
|
-
const publishDirBase = packageJson.publishConfig?.directory;
|
|
22
|
-
if (!publishDirBase) {
|
|
23
|
-
throw new Error(`No publish directory specified in package.json.`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const publishDir = path.join(cwd, publishDirBase);
|
|
27
|
-
console.log(`🔗 Linking package from: ./${publishDirBase}...`);
|
|
28
|
-
|
|
29
|
-
await $({
|
|
30
|
-
stdio: "inherit",
|
|
31
|
-
cwd: publishDir,
|
|
32
|
-
})`npm link`;
|
|
33
|
-
|
|
34
|
-
console.log(`\n✅ Successfully linked!`);
|
|
35
|
-
console.log(
|
|
36
|
-
`To use this in another project, go to that project and run:`,
|
|
37
|
-
);
|
|
38
|
-
console.log(`👉 npm link ${packageJson.name}`);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error("❌ Error executing link command:");
|
|
41
|
-
if (error instanceof Error) console.error(error.message);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
});
|
package/src/core/pack.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { $ } from "execa";
|
|
5
|
-
import { PackageJson } from "./packageJson";
|
|
6
|
-
|
|
7
|
-
export const packCommand = new Command("pack")
|
|
8
|
-
.description(
|
|
9
|
-
"Creates a tarball (.tgz) of the built package to inspect before publishing",
|
|
10
|
-
)
|
|
11
|
-
.action(async () => {
|
|
12
|
-
const cwd = process.cwd();
|
|
13
|
-
const pkgJsonPath = path.join(cwd, "package.json");
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const packageJsonContent = await fs.readFile(pkgJsonPath, {
|
|
17
|
-
encoding: "utf8",
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const packageJson: PackageJson = JSON.parse(packageJsonContent);
|
|
21
|
-
const publishDirBase = packageJson.publishConfig?.directory;
|
|
22
|
-
if (!publishDirBase) {
|
|
23
|
-
throw new Error(`No publish directory specified in package.json.`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const publishDir = path.join(cwd, publishDirBase);
|
|
27
|
-
console.log(`📦 Packing package from directory: ${publishDirBase}...`);
|
|
28
|
-
|
|
29
|
-
// Run npm pack inside the build directory
|
|
30
|
-
await $({
|
|
31
|
-
stdio: "inherit",
|
|
32
|
-
cwd: publishDir,
|
|
33
|
-
})`npm pack`;
|
|
34
|
-
|
|
35
|
-
console.log(
|
|
36
|
-
"✅ Pack successful! You can inspect the generated .tgz file.",
|
|
37
|
-
);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error("❌ Error executing pack command:");
|
|
40
|
-
if (error instanceof Error) console.error(error.message);
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
});
|