xpine 0.0.9 → 0.0.11

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.
@@ -0,0 +1,8 @@
1
+ export * from './src/runDevServer';
2
+ export * from './src/express';
3
+ export * from './src/util/env';
4
+ export * from './src/util/get-config';
5
+ export * from './src/scripts/build';
6
+ export * from './src/auth';
7
+ export * from './src/util/html';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ServerRequest } from '../types';
2
+ export declare function signUser(email: string, username: string): Promise<unknown>;
3
+ export declare function verifyUser(token: string): Promise<any>;
4
+ export declare function getTokenFromRequest(req: ServerRequest): string;
5
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAiB7D;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ5D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,UAMrD"}
@@ -0,0 +1,29 @@
1
+ import ts from 'typescript';
2
+ type ImportDeclaration = {
3
+ node: ts.Node;
4
+ importPath: string;
5
+ };
6
+ export declare function getImportDeclarationNodes(node: ts.Node, sourceFile: ts.SourceFile, importDeclarations?: ImportDeclaration[]): ImportDeclaration[];
7
+ export declare function stripImportsNodesFromFile(importsToStrip: string[], content: string, importDeclarations: ImportDeclaration[]): string;
8
+ type FoundAlpineFunction = {
9
+ name: string;
10
+ isDefaultExport: boolean;
11
+ hasExport: boolean;
12
+ };
13
+ export declare function findDataAttributesAndFunctions(node: ts.Node, sourceFile: ts.SourceFile, foundDataAttributes?: string[], foundFunctions?: FoundAlpineFunction[]): {
14
+ foundDataAttributes: string[];
15
+ foundFunctions: FoundAlpineFunction[];
16
+ };
17
+ export declare function getAttributeValuePair(node: ts.Node, sourceFile: ts.SourceFile): string[];
18
+ export declare function getFunctionDeclarationValue(node: ts.Node, sourceFile: ts.SourceFile): FoundAlpineFunction;
19
+ export declare function convertEntryPointsToSingleFile(entryPoints: string[], tempWritePath: string): void;
20
+ export declare function removeClientScriptInTSXFile(pathName: string): {
21
+ content: any;
22
+ clientContent: any;
23
+ fullContent: any;
24
+ toRemoveFrom: number;
25
+ clientDataStart: number;
26
+ };
27
+ export declare function printRecursiveFrom(node: ts.Node, indentLevel: number, sourceFile: ts.SourceFile): void;
28
+ export {};
29
+ //# sourceMappingURL=typescript-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-builder.d.ts","sourceRoot":"","sources":["../../../src/build/typescript-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAGD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,kBAAkB,GAAE,iBAAiB,EAAO,uBAiB/H;AAED,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAO3H;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAA;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,mBAAmB,GAAE,MAAM,EAAO,EAClC,cAAc,GAAE,mBAAmB,EAAO;;;EA0B3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,MAAM,EAAE,CAMxF;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,mBAAmB,CAkBzG;AAGD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,QAO1F;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM;;;;;;EAoD3D;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,QAU9D"}
@@ -0,0 +1,7 @@
1
+ import { Express } from 'express';
2
+ export declare function createRouter(): Promise<{
3
+ router: import("express-serve-static-core").Router;
4
+ routeResults: any[];
5
+ }>;
6
+ export declare function createXPineRouter(app: any, beforeErrorRoute?: (app: Express) => void): Promise<void>;
7
+ //# sourceMappingURL=express.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/express.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAgB,OAAO,EAAqB,MAAM,SAAS,CAAC;AAS5E,wBAAsB,YAAY;;;GAgEjC;AAiBD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,iBA6B1F"}
@@ -0,0 +1,2 @@
1
+ export declare function runDevServer(): Promise<void>;
2
+ //# sourceMappingURL=runDevServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDevServer.d.ts","sourceRoot":"","sources":["../../src/runDevServer.ts"],"names":[],"mappings":"AAYA,wBAAsB,YAAY,kBAiDjC"}
@@ -0,0 +1,5 @@
1
+ export declare function buildApp(isDev?: boolean): Promise<void>;
2
+ export declare function buildCSS(): Promise<void>;
3
+ export declare function buildPublicFolderSymlinks(): Promise<void>;
4
+ export declare function logSize(pathName: string, type: 'app' | 'client' | 'css', validExtensions?: string[]): Promise<void>;
5
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AAsBA,wBAAsB,QAAQ,CAAC,KAAK,UAAQ,iBAa3C;AA4LD,wBAAsB,QAAQ,kBAW7B;AAGD,wBAAsB,yBAAyB,kBAgB9C;AAOD,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,EAAE,eAAe,WAAkB,iBAahH"}
@@ -0,0 +1,2 @@
1
+ export declare function setupEnv(): void;
2
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/util/env.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,SAEvB"}
@@ -0,0 +1,4 @@
1
+ import { XPineConfig } from '../../types';
2
+ export declare function fromRoot(pathName?: string): string;
3
+ export declare const config: XPineConfig;
4
+ //# sourceMappingURL=get-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../../src/util/get-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,UAGzC;AAoDD,eAAO,MAAM,MAAM,EAAE,WAGpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare class html {
2
+ static attributeObjectToString(props: any): string;
3
+ static fragment(props: any): Promise<string>;
4
+ static createElement(type: any, props: any, ...children: any[]): Promise<any>;
5
+ }
6
+ export declare function JSXRuntime(): boolean;
7
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/util/html.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;IAEf,MAAM,CAAC,uBAAuB,CAAC,KAAK,KAAA;WAWvB,QAAQ,CAAC,KAAK,KAAA;WAKd,aAAa,CAAC,IAAI,KAAA,EAAE,KAAK,KAAA,EAAE,GAAG,QAAQ,OAAA;CASpD;AAED,wBAAgB,UAAU,YAEzB"}
@@ -0,0 +1,3 @@
1
+ declare const require: NodeJS.Require;
2
+ export default require;
3
+ //# sourceMappingURL=require.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require.d.ts","sourceRoot":"","sources":["../../../src/util/require.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO,gBAAiC,CAAC;AAE/C,eAAe,OAAO,CAAC"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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/index.ts CHANGED
@@ -1,7 +1,7 @@
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';
1
+ export * from './src/runDevServer';
2
+ export * from './src/express';
3
+ export * from './src/util/env';
4
+ export * from './src/util/get-config';
5
+ export * from './src/scripts/build';
6
+ export * from './src/auth';
7
+ export * from './src/util/html';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xpine",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-secrets-manager": "^3.758.0",
@@ -32,7 +32,7 @@
32
32
  "xpine-build": "dist/src/scripts/xpine-build.js",
33
33
  "xpine-dev": "dist/src/scripts/xpine-dev.js"
34
34
  },
35
- "types": "dist/lib/index.d.ts",
35
+ "types": "dist/index.d.ts",
36
36
  "type": "module",
37
37
  "devDependencies": {
38
38
  "@types/express": "^5.0.0",
@@ -1,100 +0,0 @@
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 +0,0 @@
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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