fullstacked 1.0.0-alpha.1696 → 1.0.0-alpha.1706

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/index.js CHANGED
@@ -90,9 +90,11 @@ var Stream = 1;
90
90
  var Path = 4;
91
91
  var Os = 5;
92
92
  var Bundle = 9;
93
+ var Plugin = 15;
93
94
  var CoreResponseError = 0;
94
95
  var CoreResponseData = 1;
95
96
  var CoreResponseStream = 2;
97
+ var PluginTypeBuild = "build";
96
98
  var UNDEFINED = 0;
97
99
  var BOOLEAN = 1;
98
100
  var STRING = 2;
@@ -624,8 +626,8 @@ function createWebSocketServer(core3, ctx, server, close) {
624
626
  webSockets.add(ws);
625
627
  ws.on("close", () => onClose(ws));
626
628
  };
627
- const onUpgrade = (...args3) => {
628
- wss.handleUpgrade(...args3, handleUpgrade);
629
+ const onUpgrade = (...args2) => {
630
+ wss.handleUpgrade(...args2, handleUpgrade);
629
631
  };
630
632
  server.on("upgrade", onUpgrade);
631
633
  return webSockets;
@@ -773,6 +775,12 @@ async function BridgeAppleInit() {
773
775
  clipboardResponsePromises.set(id2, resolve2);
774
776
  });
775
777
  };
778
+ globalThis.copy = function(text) {
779
+ globalThis.webkit.messageHandlers.clipboard.postMessage({
780
+ action: "copy",
781
+ text
782
+ });
783
+ };
776
784
  }
777
785
  if (globalThis.webkit.messageHandlers.resize) {
778
786
  const resizeResponsePromises = [];
@@ -1048,8 +1056,8 @@ function createEventEmitter(duplex) {
1048
1056
  let listeners = eventListeners.get(event);
1049
1057
  listeners?.delete(callback);
1050
1058
  },
1051
- writeEvent(event, ...args3) {
1052
- duplex.writeEvent(event, ...args3);
1059
+ writeEvent(event, ...args2) {
1060
+ duplex.writeEvent(event, ...args2);
1053
1061
  }
1054
1062
  };
1055
1063
  }
@@ -1228,25 +1236,36 @@ function createDuplex(id2, bridgeFn) {
1228
1236
  data: [id2, data]
1229
1237
  });
1230
1238
  };
1231
- stream.writeEvent = async (event, ...args3) => {
1239
+ stream.writeEvent = async (event, ...args2) => {
1232
1240
  if (!duplex.open) {
1233
1241
  await open2();
1234
1242
  }
1235
1243
  return bridgeFn({
1236
1244
  mod: Stream,
1237
1245
  fn: WriteEvent,
1238
- data: [id2, event, ...args3]
1246
+ data: [id2, event, ...args2]
1239
1247
  });
1240
1248
  };
1241
1249
  stream.end = async () => {
1242
1250
  if (!duplex.open) {
1243
1251
  await open2();
1244
1252
  }
1245
- return bridgeFn({
1253
+ const res = await bridgeFn({
1246
1254
  mod: Stream,
1247
1255
  fn: Close,
1248
1256
  data: [id2]
1249
1257
  });
1258
+ if (duplex.done) {
1259
+ return res;
1260
+ }
1261
+ await new Promise((resolve2) => {
1262
+ const onClose = () => {
1263
+ duplex.listeners.close.delete(onClose);
1264
+ resolve2();
1265
+ };
1266
+ duplex.listeners.close.add(onClose);
1267
+ });
1268
+ return res;
1250
1269
  };
1251
1270
  stream.promise = async () => {
1252
1271
  let data = new Uint8Array();
@@ -1294,6 +1313,9 @@ function bridge(opts, sync) {
1294
1313
  }
1295
1314
  return new Promise(async (resolve2, reject) => {
1296
1315
  await platform_default.ready;
1316
+ if (globalThis.pluginConnectionPromise && !(opts.mod === 15 && opts.fn === 0)) {
1317
+ await globalThis.pluginConnectionPromise;
1318
+ }
1297
1319
  const payload = preparePayload();
1298
1320
  const responseBuffer = await platform_default.bridge.Async(
1299
1321
  payload.buffer
@@ -1332,7 +1354,6 @@ function processResponse(buffer) {
1332
1354
 
1333
1355
  // ../../core/internal/bundle/lib/@types/bundle.ts
1334
1356
  var BundleDir = 1;
1335
- var BuilderTailwindCSS = 3;
1336
1357
 
1337
1358
  // ../../core/internal/bundle/lib/@types/path.ts
1338
1359
  var Join = 0;
@@ -1551,39 +1572,209 @@ function bundle(entryPoint) {
1551
1572
  ee.on("result", resolve2);
1552
1573
  });
1553
1574
  }
1554
- async function builderTailwindCSS() {
1555
- return (await bridge({
1556
- mod: Bundle,
1557
- fn: BuilderTailwindCSS
1558
- })).eventEmitter();
1575
+
1576
+ // ../../core/internal/bundle/lib/@types/plugin.ts
1577
+ var StartPluginStream = 0;
1578
+ var Register = 1;
1579
+ var Unregister = 2;
1580
+
1581
+ // ../../core/internal/bundle/lib/plugin/index.ts
1582
+ var plugins = /* @__PURE__ */ new Map();
1583
+ var duplexStream = null;
1584
+ var eventEmitter = null;
1585
+ var connectionPromise = null;
1586
+ var te4 = new TextEncoder();
1587
+ async function connect() {
1588
+ if (duplexStream) {
1589
+ return;
1590
+ }
1591
+ const duplex = await bridge({
1592
+ mod: Plugin,
1593
+ fn: StartPluginStream
1594
+ });
1595
+ await duplex.open();
1596
+ duplexStream = duplex;
1597
+ eventEmitter = duplex.eventEmitter();
1598
+ eventEmitter.on(
1599
+ "plugin-call",
1600
+ async (pluginId, requestId, ...args2) => {
1601
+ let result2 = null;
1602
+ let errorMsg = null;
1603
+ try {
1604
+ const registeredPlugin = plugins.get(pluginId);
1605
+ if (registeredPlugin) {
1606
+ result2 = await registeredPlugin.callback(...args2);
1607
+ if (registeredPlugin.type === PluginTypeBuild) {
1608
+ const remappedResult = [];
1609
+ result2.forEach(({ outputName, contents }) => {
1610
+ contents = typeof contents === "string" ? te4.encode(contents) : contents;
1611
+ remappedResult.push(outputName, contents);
1612
+ });
1613
+ result2 = remappedResult;
1614
+ }
1615
+ } else {
1616
+ throw new Error(
1617
+ `No registered plugin found for id: ${pluginId}`
1618
+ );
1619
+ }
1620
+ } catch (err) {
1621
+ errorMsg = err.message || String(err);
1622
+ }
1623
+ if (Array.isArray(result2)) {
1624
+ eventEmitter.writeEvent(
1625
+ "plugin-response",
1626
+ pluginId,
1627
+ requestId,
1628
+ errorMsg,
1629
+ ...result2
1630
+ );
1631
+ } else {
1632
+ eventEmitter.writeEvent(
1633
+ "plugin-response",
1634
+ pluginId,
1635
+ requestId,
1636
+ errorMsg,
1637
+ result2
1638
+ );
1639
+ }
1640
+ }
1641
+ );
1642
+ }
1643
+ async function register(type2, plugin2) {
1644
+ if (!connectionPromise) {
1645
+ connectionPromise = connect();
1646
+ }
1647
+ await connectionPromise;
1648
+ const { name, ...pluginData } = plugin2.data || {};
1649
+ const id2 = await bridge({
1650
+ mod: Plugin,
1651
+ fn: Register,
1652
+ data: [type2, name || "plugin-" + type2, pluginData]
1653
+ });
1654
+ plugins.set(id2, { type: type2, callback: plugin2.callback });
1655
+ return {
1656
+ unregister: async () => {
1657
+ plugins.delete(id2);
1658
+ await bridge({
1659
+ mod: Plugin,
1660
+ fn: Unregister,
1661
+ data: [id2]
1662
+ });
1663
+ }
1664
+ };
1559
1665
  }
1666
+ var plugin = {
1667
+ register
1668
+ };
1669
+ var plugin_default = plugin;
1560
1670
 
1561
1671
  // ../../core/internal/bundle/lib/run/index.ts
1562
1672
  function run(directoryOrOptions) {
1563
1673
  const directory2 = typeof directoryOrOptions === "string" ? directoryOrOptions : directoryOrOptions?.directory;
1564
- const env = typeof directoryOrOptions === "object" ? directoryOrOptions.env : void 0;
1674
+ const env2 = typeof directoryOrOptions === "object" ? directoryOrOptions.env : void 0;
1565
1675
  const resolved = path_default.resolve(directory2 ?? ".");
1566
1676
  return bridge({
1567
1677
  mod: Core,
1568
1678
  fn: Run,
1569
- data: [resolved, env]
1679
+ data: [resolved, env2]
1570
1680
  });
1571
1681
  }
1572
1682
 
1573
1683
  // ../../core/internal/bundle/lib/process/version.json
1574
- var version_default = { major: "1", minor: "0", patch: "0-alpha", branch: "v1", build: "1696", hash: "78be2a93cd4be4d52e13672db2a7826f2023e230" };
1684
+ var version_default = { major: "1", minor: "0", patch: "0-alpha", branch: "v1", build: "1706", hash: "83a224d4d1c01ade773cdc6ba8edf0074686f3e7" };
1685
+
1686
+ // src/args.ts
1687
+ function findArg(aliases, hasValueOrArgs, customArgs) {
1688
+ const hasValue = typeof hasValueOrArgs === "boolean" ? hasValueOrArgs : false;
1689
+ const args2 = Array.isArray(hasValueOrArgs) ? hasValueOrArgs : customArgs || process.argv.slice(2);
1690
+ const values = [];
1691
+ let present = false;
1692
+ for (let i = 0; i < args2.length; i++) {
1693
+ const arg = args2[i];
1694
+ if (aliases.includes(arg)) {
1695
+ present = true;
1696
+ if (hasValue) {
1697
+ const next = args2[i + 1];
1698
+ if (next !== void 0 && !next.startsWith("-")) {
1699
+ values.push(next);
1700
+ i++;
1701
+ } else {
1702
+ values.push("");
1703
+ }
1704
+ }
1705
+ } else if (hasValue) {
1706
+ for (const alias of aliases) {
1707
+ if (arg.startsWith(alias + "=")) {
1708
+ values.push(arg.slice(alias.length + 1));
1709
+ present = true;
1710
+ break;
1711
+ }
1712
+ }
1713
+ }
1714
+ }
1715
+ return hasValue ? values : present;
1716
+ }
1717
+ function getPositionalArgs(args2 = process.argv.slice(2)) {
1718
+ const positional = [];
1719
+ const valueFlags = [
1720
+ ["-e", "--env"],
1721
+ ["-p", "--port"]
1722
+ ];
1723
+ const booleanFlags = [
1724
+ ["-h", "--help"],
1725
+ ["-v", "--version"],
1726
+ ["-o", "--open"],
1727
+ ["-b", "--build"]
1728
+ ];
1729
+ for (let i = 0; i < args2.length; i++) {
1730
+ const arg = args2[i];
1731
+ if (booleanFlags.some((aliases) => aliases.includes(arg))) {
1732
+ continue;
1733
+ }
1734
+ let isValueFlag = false;
1735
+ for (const aliases of valueFlags) {
1736
+ if (aliases.includes(arg)) {
1737
+ const next = args2[i + 1];
1738
+ if (next !== void 0 && !next.startsWith("-")) {
1739
+ i++;
1740
+ }
1741
+ isValueFlag = true;
1742
+ break;
1743
+ }
1744
+ let matchedPrefix = false;
1745
+ for (const alias of aliases) {
1746
+ if (arg.startsWith(alias + "=")) {
1747
+ matchedPrefix = true;
1748
+ break;
1749
+ }
1750
+ }
1751
+ if (matchedPrefix) {
1752
+ isValueFlag = true;
1753
+ break;
1754
+ }
1755
+ }
1756
+ if (isValueFlag) {
1757
+ continue;
1758
+ }
1759
+ if (arg.startsWith("-")) {
1760
+ continue;
1761
+ }
1762
+ positional.push(arg);
1763
+ }
1764
+ return positional;
1765
+ }
1575
1766
 
1576
1767
  // src/index.ts
1577
- import postcss from "postcss";
1578
- import atImport from "postcss-import";
1579
- import tailwindcss from "@tailwindcss/postcss";
1580
- import autoprefixer from "autoprefixer";
1581
- import fs3 from "node:fs";
1582
- var end = () => {
1768
+ import pluginTailwindcss, {
1769
+ initialize
1770
+ } from "@fullstacked/tailwindcss/index.ts";
1771
+ var end = (code2) => {
1583
1772
  core2.end();
1584
- process.exit();
1773
+ process.exit(code2);
1585
1774
  };
1586
- ["SIGINT", "SIGTERM", "SIGQUIT"].forEach((signal) => process.on(signal, end));
1775
+ ["SIGINT", "SIGTERM", "SIGQUIT"].forEach(
1776
+ (signal) => process.on(signal, () => end(0))
1777
+ );
1587
1778
  var webviews = /* @__PURE__ */ new Map();
1588
1779
  var core2 = await load(
1589
1780
  (ctx, streamId, buffer) => {
@@ -1606,12 +1797,23 @@ var core2 = await load(
1606
1797
  });
1607
1798
  }
1608
1799
  );
1609
- var args2 = process.argv.slice(2);
1610
- var help = args2.includes("-h") || args2.includes("--help");
1611
- var showVersion = args2.includes("-v") || args2.includes("--version");
1612
- var openBrowser = args2.includes("-o") || args2.includes("--open");
1613
- var buildOnly = args2.includes("-b") || args2.includes("--build");
1614
- var positionalArgs = args2.filter((arg) => !arg.startsWith("-"));
1800
+ var help = findArg(["-h", "--help"]);
1801
+ var showVersion = findArg(["-v", "--version"]);
1802
+ var openBrowser = findArg(["-o", "--open"]);
1803
+ var buildOnly = findArg(["-b", "--build"]);
1804
+ var envArgs = findArg(["-e", "--env"], true);
1805
+ var env = {};
1806
+ for (const val of envArgs) {
1807
+ const index = val.indexOf("=");
1808
+ if (index !== -1) {
1809
+ const key = val.slice(0, index);
1810
+ const value = val.slice(index + 1);
1811
+ env[key] = value;
1812
+ } else if (val) {
1813
+ env[val] = "";
1814
+ }
1815
+ }
1816
+ var positionalArgs = getPositionalArgs();
1615
1817
  var directory = path3.resolve(positionalArgs.at(-1) || ".");
1616
1818
  if (showVersion) {
1617
1819
  console.log(
@@ -1641,35 +1843,23 @@ globalThis.bridges = {
1641
1843
  Sync: (payload) => core2.call(payload),
1642
1844
  Async: async (payload) => core2.call(payload)
1643
1845
  };
1644
- var tailwindcssBuilder = await builderTailwindCSS();
1645
- tailwindcssBuilder.on("build", async (entryfile, outfile) => {
1646
- const from = path3.resolve(directory, entryfile);
1647
- const to = path3.resolve(directory, outfile);
1648
- const css = await fs3.promises.readFile(from, "utf-8");
1649
- const result2 = await postcss([
1650
- atImport({
1651
- addModulesDirectories: [
1652
- path3.resolve(import.meta.dirname, "node_modules")
1653
- ]
1654
- }),
1655
- tailwindcss(),
1656
- autoprefixer()
1657
- ]).process(css, {
1658
- from,
1659
- to
1660
- });
1661
- await fs3.promises.writeFile(to, result2.css);
1662
- tailwindcssBuilder.writeEvent("build-done");
1846
+ await initialize({
1847
+ oxide: "node_modules/oxide-wasm/pkg/oxide_wasm_bg.wasm",
1848
+ lightningcss: "node_modules/lightningcss-wasm/lightningcss_node.wasm",
1849
+ tailwindcss: "node_modules/tailwindcss",
1850
+ baseDirectory: directory
1663
1851
  });
1852
+ await plugin_default.register("build", pluginTailwindcss);
1664
1853
  var result = await bundle();
1665
1854
  if (result.Warnings?.length) {
1666
1855
  console.warn("Warnings:", result.Warnings);
1667
1856
  }
1668
1857
  if (result.Errors?.length) {
1669
1858
  console.error("Errors:", result.Errors);
1859
+ end(1);
1670
1860
  } else if (!buildOnly) {
1671
- run();
1861
+ run({ env });
1672
1862
  } else {
1673
1863
  console.log("Build complete.");
1674
- end();
1864
+ end(0);
1675
1865
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fullstacked",
3
- "version": "1.0.0-alpha.1696",
3
+ "version": "1.0.0-alpha.1706",
4
4
  "bin": {
5
5
  "fullstacked": "index.js"
6
6
  },
@@ -10,12 +10,8 @@
10
10
  "prepack": "npm run build"
11
11
  },
12
12
  "dependencies": {
13
- "@tailwindcss/postcss": "^4.3.1",
14
- "autoprefixer": "^10.5.0",
13
+ "@fullstacked/tailwindcss": "github:fullstackedorg/tailwindcss",
15
14
  "open": "^11.0.0",
16
- "postcss": "^8.5.15",
17
- "postcss-import": "^16.1.1",
18
- "tailwindcss": "^4.3.1",
19
15
  "ws": "^8.21.0"
20
16
  },
21
17
  "devDependencies": {
@@ -25,12 +21,12 @@
25
21
  "node-addon-api": "^8.8.0"
26
22
  },
27
23
  "optionalDependencies": {
28
- "@fullstacked/darwin-arm64": "1.0.0-alpha.1696",
29
- "@fullstacked/darwin-x64": "1.0.0-alpha.1696",
30
- "@fullstacked/linux-arm64": "1.0.0-alpha.1696",
31
- "@fullstacked/linux-x64": "1.0.0-alpha.1696",
32
- "@fullstacked/win32-arm64": "1.0.0-alpha.1696",
33
- "@fullstacked/win32-x64": "1.0.0-alpha.1696"
24
+ "@fullstacked/darwin-arm64": "1.0.0-alpha.1706",
25
+ "@fullstacked/darwin-x64": "1.0.0-alpha.1706",
26
+ "@fullstacked/linux-arm64": "1.0.0-alpha.1706",
27
+ "@fullstacked/linux-x64": "1.0.0-alpha.1706",
28
+ "@fullstacked/win32-arm64": "1.0.0-alpha.1706",
29
+ "@fullstacked/win32-x64": "1.0.0-alpha.1706"
34
30
  },
35
31
  "author": "FullStacked",
36
32
  "license": "MIT",
@@ -53,6 +49,9 @@
53
49
  "./packages": {
54
50
  "types": "./types/packages/index.d.ts"
55
51
  },
52
+ "./plugin": {
53
+ "types": "./types/plugin/index.d.ts"
54
+ },
56
55
  "./run": {
57
56
  "types": "./types/run/index.d.ts"
58
57
  },
@@ -4,12 +4,27 @@ export declare const BundleDir: BundleFn;
4
4
  export declare const BundleFile: BundleFn;
5
5
  export declare const BuilderTailwindCSS: BundleFn;
6
6
  export declare const BuilderSASS: BundleFn;
7
- export interface TailwindCSSBuilder {
8
- }
9
7
  export interface EsbuildResult {
10
8
  OutputFiles: string[];
11
9
  Errors: any[];
12
10
  Warnings: any[];
13
11
  }
12
+ export interface PluginBuildData {
13
+ filter: string;
14
+ ext?: string[];
15
+ }
16
+ export interface PluginResolvedFile {
17
+ importer: string;
18
+ path: string;
19
+ resolvedDir: string;
20
+ }
21
+ export interface PluginParams {
22
+ sources: string[];
23
+ resolved: PluginResolvedFile[];
24
+ }
25
+ export interface BuildPluginOutputFile {
26
+ outputName: string;
27
+ contents: string;
28
+ }
14
29
  export interface DocumentHTML {
15
30
  }
@@ -12,7 +12,6 @@ export declare const RefTag: GitRefType;
12
12
  export interface CustomFS {
13
13
  }
14
14
  export type GitFn = number;
15
- export declare const AuthManager: GitFn;
16
15
  export declare const HasGit: GitFn;
17
16
  export declare const Init: GitFn;
18
17
  export declare const Head: GitFn;
@@ -30,7 +29,7 @@ export declare const Checkout: GitFn;
30
29
  export declare const Merge: GitFn;
31
30
  export declare const Restore: GitFn;
32
31
  export interface HTTPBasicAuth {
33
- GitAuth?: GitAuth;
32
+ GitAuth?: any;
34
33
  }
35
34
  export interface GitHead {
36
35
  branch: string;
@@ -60,12 +59,6 @@ export interface GitCommit {
60
59
  export declare const DateFormat = "Mon Jan 2 15:04:05 2006 -0700";
61
60
  export interface GitStream {
62
61
  }
63
- export interface GitAuth {
64
- host: string;
65
- username: string;
66
- password: string;
67
- email: string;
68
- }
69
62
  export interface GitBranch {
70
63
  name: string;
71
64
  remote: boolean;
@@ -14,6 +14,7 @@ export declare const Git: CoreModule;
14
14
  export declare const Packages: CoreModule;
15
15
  export declare const Sentry: CoreModule;
16
16
  export declare const Dgram: CoreModule;
17
+ export declare const Plugin: CoreModule;
17
18
  export type ModuleSwitch = any;
18
19
  export type CoreCallResponseType = number;
19
20
  export declare const CoreResponseError: CoreCallResponseType;
@@ -53,6 +54,30 @@ export interface ContextDirectories {
53
54
  Root: string;
54
55
  Build: string;
55
56
  }
57
+ export declare const PluginTypeGitAuth = "git-auth";
58
+ export declare const PluginTypeBuild = "build";
59
+ export type PluginType = typeof PluginTypeGitAuth | typeof PluginTypeBuild;
60
+ export interface PluginRequest {
61
+ Response: DeserializedData[];
62
+ ResponseError?: string;
63
+ Wg?: any;
64
+ }
65
+ export interface ContextPlugin {
66
+ Id: number;
67
+ Name: string;
68
+ Type: PluginType;
69
+ Data: DeserializedRawObject;
70
+ Requests: {
71
+ [key: number]: PluginRequest | undefined;
72
+ };
73
+ RequestsMutex?: any;
74
+ }
75
+ export interface GitAuth {
76
+ host: string;
77
+ username: string;
78
+ password: string;
79
+ email: string;
80
+ }
56
81
  export interface Context {
57
82
  Id: number;
58
83
  Directories: ContextDirectories;
@@ -68,6 +93,15 @@ export interface Context {
68
93
  };
69
94
  StreamsMutex?: any;
70
95
  NextStreamId: number;
96
+ PluginStreamId: number;
97
+ Plugins: {
98
+ [key: number]: ContextPlugin | undefined;
99
+ };
100
+ PluginsMutex?: any;
101
+ GitAuths: {
102
+ [key: string]: GitAuth | undefined;
103
+ };
104
+ GitAuthsMutex?: any;
71
105
  Exit: boolean;
72
106
  }
73
107
  export type SerializableData = any;
@@ -0,0 +1,4 @@
1
+ export type PluginFn = number;
2
+ export declare const StartPluginStream: PluginFn;
3
+ export declare const Register: PluginFn;
4
+ export declare const Unregister: PluginFn;
@@ -8,7 +8,7 @@ export interface Duplex extends ReadableStream<Uint8Array<ArrayBuffer>> {
8
8
  on(event: "close", callback: EndCallback): void;
9
9
  write(data: StreamData): Promise<any>;
10
10
  writeEvent(event: string, ...args: SerializableData[]): Promise<any>;
11
- end(chunk?: StreamData, encoding?: string | EndCallback, callback?: EndCallback): void;
11
+ end(): Promise<any>;
12
12
  promise(): Promise<any>;
13
13
  eventEmitter(): ReturnType<typeof createEventEmitter>;
14
14
  open(): Promise<void>;
@@ -1,12 +1,10 @@
1
1
  import { EsbuildResult } from "../@types/bundle.ts";
2
- import { EventEmitter } from "../bridge/eventEmitter.ts";
3
2
  export declare function esbuildVersion(): Promise<string>;
4
3
  export declare function bundle(entryPoint?: string): Promise<EsbuildResult>;
5
4
  export declare function bundleFile(entryPoint: string): Promise<EsbuildResult>;
6
- export declare function builderTailwindCSS(): Promise<EventEmitter<{
7
- build: string[];
8
- "build-done": [];
9
- }>>;
5
+ export declare function builderTailwindCSS(): Promise<{
6
+ on(): void;
7
+ }>;
10
8
  declare const bundler: {
11
9
  esbuildVersion: typeof esbuildVersion;
12
10
  bundle: typeof bundle;
@@ -1,10 +1,8 @@
1
- import { GitAuth, GitAuthor, GitBranch, GitCommit, GitHead, GitStatus, GitTag } from "../@types/git.ts";
1
+ import { GitAuthor, GitBranch, GitCommit, GitHead, GitStatus, GitTag } from "../@types/git.ts";
2
2
  import type { Duplex } from "../bridge/duplex.ts";
3
- import { EventEmitter } from "../bridge/eventEmitter.ts";
4
- export declare function createGitAuthManager(): Promise<EventEmitter<{
5
- auth: [string];
6
- authResponse: [string, Partial<GitAuth>];
7
- }>>;
3
+ export declare function createGitAuthManager(): Promise<{
4
+ on(): void;
5
+ }>;
8
6
  export declare function hasGit(directory: string): Promise<boolean>;
9
7
  export declare function init(directory: string, url: string): Promise<any>;
10
8
  export declare function head(directory: string): Promise<GitHead>;
@@ -22,7 +20,6 @@ export declare function checkout(directory: string, ref: string, create?: boolea
22
20
  export declare function merge(directory: string, branch: string): Promise<any>;
23
21
  export declare function restore(directory: string, ...files: string[]): Promise<any>;
24
22
  declare const git: {
25
- createGitAuthManager: typeof createGitAuthManager;
26
23
  hasGit: typeof hasGit;
27
24
  init: typeof init;
28
25
  head: typeof head;
@@ -39,5 +36,6 @@ declare const git: {
39
36
  checkout: typeof checkout;
40
37
  merge: typeof merge;
41
38
  restore: typeof restore;
39
+ createGitAuthManager: typeof createGitAuthManager;
42
40
  };
43
41
  export default git;
@@ -0,0 +1,32 @@
1
+ import { GitAuth, PluginTypeGitAuth, PluginTypeBuild } from "../@types/index.ts";
2
+ import { PluginBuildData, PluginResolvedFile } from "../@types/bundle.ts";
3
+ type CommonPluginData = {
4
+ name?: string;
5
+ };
6
+ export type PluginRegistry = {
7
+ [PluginTypeGitAuth]: {
8
+ data?: CommonPluginData;
9
+ callback: (host: string) => Promise<Partial<GitAuth>> | Partial<GitAuth>;
10
+ };
11
+ [PluginTypeBuild]: {
12
+ data?: CommonPluginData & PluginBuildData;
13
+ callback: (params: {
14
+ resolved: PluginResolvedFile[];
15
+ sources: string[];
16
+ }) => Promise<{
17
+ outputName: string;
18
+ contents: string | Uint8Array;
19
+ }[]>;
20
+ };
21
+ };
22
+ export interface JSPlugin {
23
+ type: string;
24
+ callback: (...args: any[]) => Promise<any | any[]> | any | any[];
25
+ }
26
+ export declare function register<T extends keyof PluginRegistry>(type: T, plugin: PluginRegistry[T]): Promise<{
27
+ unregister: () => Promise<void>;
28
+ }>;
29
+ declare const plugin: {
30
+ register: typeof register;
31
+ };
32
+ export default plugin;