xpine 0.0.7 → 0.0.9

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.
@@ -1,8 +1,100 @@
1
- export * from './src/runDevServer.ts';
2
- export * from './src/express.ts';
3
- export * from './src/util/env.ts';
4
- export * from './src/util/get-config.ts';
5
- export * from './src/scripts/build.ts';
6
- export * from './src/auth.ts';
7
- export * from './src/util/html.ts';
8
- //# sourceMappingURL=index.d.ts.map
1
+ declare module "src/build/typescript-builder" {
2
+ import ts from 'typescript';
3
+ type ImportDeclaration = {
4
+ node: ts.Node;
5
+ importPath: string;
6
+ };
7
+ export function getImportDeclarationNodes(node: ts.Node, sourceFile: ts.SourceFile, importDeclarations?: ImportDeclaration[]): ImportDeclaration[];
8
+ export function stripImportsNodesFromFile(importsToStrip: string[], content: string, importDeclarations: ImportDeclaration[]): string;
9
+ type FoundAlpineFunction = {
10
+ name: string;
11
+ isDefaultExport: boolean;
12
+ hasExport: boolean;
13
+ };
14
+ export function findDataAttributesAndFunctions(node: ts.Node, sourceFile: ts.SourceFile, foundDataAttributes?: string[], foundFunctions?: FoundAlpineFunction[]): {
15
+ foundDataAttributes: string[];
16
+ foundFunctions: FoundAlpineFunction[];
17
+ };
18
+ export function getAttributeValuePair(node: ts.Node, sourceFile: ts.SourceFile): string[];
19
+ export function getFunctionDeclarationValue(node: ts.Node, sourceFile: ts.SourceFile): FoundAlpineFunction;
20
+ export function convertEntryPointsToSingleFile(entryPoints: string[], tempWritePath: string): void;
21
+ export function removeClientScriptInTSXFile(pathName: string): {
22
+ content: any;
23
+ clientContent: any;
24
+ fullContent: any;
25
+ toRemoveFrom: number;
26
+ clientDataStart: number;
27
+ };
28
+ export function printRecursiveFrom(node: ts.Node, indentLevel: number, sourceFile: ts.SourceFile): void;
29
+ }
30
+ declare module "src/util/require" {
31
+ const require: NodeJS.Require;
32
+ export default require;
33
+ }
34
+ declare module "types" {
35
+ import { Request } from 'express';
36
+ export type XPineConfig = {
37
+ [key: string]: string;
38
+ };
39
+ export type TokenUser = {
40
+ email?: string;
41
+ username?: string;
42
+ };
43
+ export type ServerRequest = Request & {
44
+ user?: TokenUser;
45
+ };
46
+ }
47
+ declare module "src/util/get-config" {
48
+ import { XPineConfig } from "types";
49
+ export function fromRoot(pathName?: string): string;
50
+ export const config: XPineConfig;
51
+ }
52
+ declare module "src/scripts/build" {
53
+ export function buildApp(isDev?: boolean): Promise<void>;
54
+ export function buildCSS(): Promise<void>;
55
+ export function buildPublicFolderSymlinks(): Promise<void>;
56
+ export function logSize(pathName: string, type: 'app' | 'client' | 'css', validExtensions?: string[]): Promise<void>;
57
+ }
58
+ declare module "src/util/env" {
59
+ export function setupEnv(): void;
60
+ }
61
+ declare module "src/runDevServer" {
62
+ export function runDevServer(): Promise<void>;
63
+ }
64
+ declare module "src/auth" {
65
+ import { ServerRequest } from "types";
66
+ export function signUser(email: string, username: string): Promise<unknown>;
67
+ export function verifyUser(token: string): Promise<any>;
68
+ export function getTokenFromRequest(req: ServerRequest): string;
69
+ }
70
+ declare module "src/express" {
71
+ import { Express } from 'express';
72
+ export function createRouter(): Promise<{
73
+ router: import("express-serve-static-core").Router;
74
+ routeResults: any[];
75
+ }>;
76
+ export function createXPineRouter(app: any, beforeErrorRoute?: (app: Express) => void): Promise<void>;
77
+ }
78
+ declare module "src/util/html" {
79
+ export class html {
80
+ static attributeObjectToString(props: any): string;
81
+ static fragment(props: any): Promise<string>;
82
+ static createElement(type: any, props: any, ...children: any[]): Promise<any>;
83
+ }
84
+ export function JSXRuntime(): boolean;
85
+ }
86
+ declare module "index" {
87
+ export * from "src/runDevServer";
88
+ export * from "src/express";
89
+ export * from "src/util/env";
90
+ export * from "src/util/get-config";
91
+ export * from "src/scripts/build";
92
+ export * from "src/auth";
93
+ export * from "src/util/html";
94
+ }
95
+ //# sourceMappingURL=index.d.ts.map
96
+ declare module 'xpine' {
97
+ import main = require('index');
98
+ export = main;
99
+ }
100
+
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build/typescript-builder.ts","../../src/util/require.ts","../../types.ts","../../src/util/get-config.ts","../../src/scripts/build.ts","../../src/util/env.ts","../../src/runDevServer.ts","../../src/auth.ts","../../src/express.ts","../../src/util/html.ts","../../index.ts"],"names":[],"mappings":";IAAA,OAAO,EAAE,MAAM,YAAY,CAAC;IAI5B,KAAK,iBAAiB,GAAG;QACvB,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAA;IAGD,MAAM,UAAU,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,kBAAkB,GAAE,iBAAiB,EAAO,uBAiB/H;IAED,MAAM,UAAU,yBAAyB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAO3H;IAED,KAAK,mBAAmB,GAAG;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAA;IAED,MAAM,UAAU,8BAA8B,CAC5C,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,mBAAmB,GAAE,MAAM,EAAO,EAClC,cAAc,GAAE,mBAAmB,EAAO;;;MA0B3C;IAED,MAAM,UAAU,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,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Ae,WAAkB,iBAahH;;;IC5QD,MAAM,UAAU,QAAQ,SAEvB;;;ICKD,gBAAsB,YAAY,kBAiDjC;;;IC5DD,OAAO,EAAE,aAAa,EAAE,cAAoB;IAG5C,gBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAiB7D;IAED,gBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ5D;IAED,MAAM,UAAU,mBAAmB,CAAC,GAAG,EAAE,aAAa,UAMrD;;;ICvCD,OAAgB,EAAgB,OAAO,EAAqB,MAAM,SAAS,CAAC;IAS5E,gBAAsB,YAAY;;;OAgEjC;IAiBD,gBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,iBA6B1F;;;ICvHD,MAAM,OAAO,IAAI;QAEf,MAAM,CAAC,uBAAuB,CAAC,KAAK,KAAA;eAWvB,QAAQ,CAAC,KAAK,KAAA;eAKd,aAAa,CAAC,IAAI,KAAA,EAAE,KAAK,KAAA,EAAE,GAAG,QAAQ,OAAA;KASpD;IAED,MAAM,UAAU,UAAU,YAEzB;;;IC/BD,iCAAsC;IACtC,4BAAiC;IACjC,6BAAkC;IAClC,oCAAyC;IACzC,kCAAuC;IACvC,yBAA8B;IAC9B,8BAAmC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xpine",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-secrets-manager": "^3.758.0",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsx ./src/scripts/build-module.ts && npm run build:types",
29
- "build:types": "npx tsc --declaration index.ts --declarationDir dist/lib --emitDeclarationOnly --declarationMap --skipLibCheck --esModuleInterop --allowImportingTsExtensions --target esnext --moduleResolution NodeNext --module NodeNext"
29
+ "build:types": "sh ./src/scripts/build-types.sh"
30
30
  },
31
31
  "bin": {
32
32
  "xpine-build": "dist/src/scripts/xpine-build.js",
@@ -1,12 +0,0 @@
1
- import { Request } from 'express';
2
- export type XPineConfig = {
3
- [key: string]: string;
4
- };
5
- export type TokenUser = {
6
- email?: string;
7
- username?: string;
8
- };
9
- export type ServerRequest = Request & {
10
- user?: TokenUser;
11
- };
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IACpC,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAA"}
package/types.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Request } from 'express';
2
- export type XPineConfig = {
3
- [key: string]: string;
4
- };
5
- export type TokenUser = {
6
- email?: string;
7
- username?: string;
8
- };
9
- export type ServerRequest = Request & {
10
- user?: TokenUser;
11
- };