xpine 0.0.16 → 0.0.18
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/TODO +2 -1
- package/dist/index.js +20 -7
- package/dist/src/build/typescript-builder.d.ts +2 -1
- package/dist/src/build/typescript-builder.d.ts.map +1 -1
- package/dist/src/scripts/build.d.ts.map +1 -1
- package/dist/src/scripts/xpine-build.js +20 -7
- package/dist/src/scripts/xpine-dev.js +20 -7
- package/dist/src/util/postcss/remove-layers.d.ts.map +1 -1
- package/package.json +7 -4
- package/dist/src/scripts/runDevServer.d.ts +0 -2
- package/dist/src/scripts/runDevServer.d.ts.map +0 -1
package/TODO
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
-
|
|
1
|
+
- static files from a +config.ts file in a folder (similar to vike)
|
|
2
|
+
- with a method of getting a list of file paths to feed into dynamic slugs, e.g. post/[id] slugs
|
package/dist/index.js
CHANGED
|
@@ -71,13 +71,8 @@ function convertEntryPointsToSingleFile(entryPoints, tempWritePath) {
|
|
|
71
71
|
entryPoints.map((entry) => `import "${entry}"`).join(";\n")
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function removeClientScriptInTSXFile(pathName) {
|
|
74
|
+
function removeClientScriptInTSXFile(pathName, source) {
|
|
75
75
|
const content = fs.readFileSync(pathName, "utf-8");
|
|
76
|
-
const source = ts.createSourceFile(
|
|
77
|
-
pathName,
|
|
78
|
-
content,
|
|
79
|
-
ts.ScriptTarget.Latest
|
|
80
|
-
);
|
|
81
76
|
let toRemoveFrom;
|
|
82
77
|
let clientDataStart;
|
|
83
78
|
const clientImportsToHoist = [];
|
|
@@ -119,6 +114,17 @@ function removeClientScriptInTSXFile(pathName) {
|
|
|
119
114
|
clientDataStart
|
|
120
115
|
};
|
|
121
116
|
}
|
|
117
|
+
function createStaticFile(pathName, source) {
|
|
118
|
+
source.forEachChild((child) => {
|
|
119
|
+
if (child.kind === ts.SyntaxKind.ExpressionStatement) {
|
|
120
|
+
const text = child.getText(source);
|
|
121
|
+
const cleanedText = text.replace(/["';]/g, "");
|
|
122
|
+
if (cleanedText === "xpine-static") {
|
|
123
|
+
console.log("make this file static", pathName);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
122
128
|
|
|
123
129
|
// src/scripts/build.ts
|
|
124
130
|
import { globSync } from "glob";
|
|
@@ -271,7 +277,14 @@ async function buildAppFiles(files, isDev) {
|
|
|
271
277
|
name: "insert-html-banner-and-remove-client-scripts",
|
|
272
278
|
setup(build2) {
|
|
273
279
|
build2.onLoad({ filter: /.tsx/ }, (args) => {
|
|
274
|
-
const
|
|
280
|
+
const content = fs2.readFileSync(args.path, "utf-8");
|
|
281
|
+
const source = ts2.createSourceFile(
|
|
282
|
+
args.path,
|
|
283
|
+
content,
|
|
284
|
+
ts2.ScriptTarget.Latest
|
|
285
|
+
);
|
|
286
|
+
const cleanedContent = removeClientScriptInTSXFile(args.path, source);
|
|
287
|
+
createStaticFile(args.path, source);
|
|
275
288
|
const htmlImportStart = "import { html } from 'xpine';\n";
|
|
276
289
|
const newContent = `${htmlImportStart}${cleanedContent.content}`;
|
|
277
290
|
componentData.push({
|
|
@@ -17,13 +17,14 @@ export declare function findDataAttributesAndFunctions(node: ts.Node, sourceFile
|
|
|
17
17
|
export declare function getAttributeValuePair(node: ts.Node, sourceFile: ts.SourceFile): string[];
|
|
18
18
|
export declare function getFunctionDeclarationValue(node: ts.Node, sourceFile: ts.SourceFile): FoundAlpineFunction;
|
|
19
19
|
export declare function convertEntryPointsToSingleFile(entryPoints: string[], tempWritePath: string): void;
|
|
20
|
-
export declare function removeClientScriptInTSXFile(pathName: string): {
|
|
20
|
+
export declare function removeClientScriptInTSXFile(pathName: string, source: ts.SourceFile): {
|
|
21
21
|
content: any;
|
|
22
22
|
clientContent: any;
|
|
23
23
|
fullContent: any;
|
|
24
24
|
toRemoveFrom: number;
|
|
25
25
|
clientDataStart: number;
|
|
26
26
|
};
|
|
27
|
+
export declare function createStaticFile(pathName: string, source: ts.SourceFile): void;
|
|
27
28
|
export declare function printRecursiveFrom(node: ts.Node, indentLevel: number, sourceFile: ts.SourceFile): void;
|
|
28
29
|
export {};
|
|
29
30
|
//# sourceMappingURL=typescript-builder.d.ts.map
|
|
@@ -1 +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;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E,MAAM,QAO1F;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU;;;;;;EA+ClF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,QAUvE;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,QAU9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AA2BA,wBAAsB,QAAQ,CAAC,KAAK,UAAQ,iBAa3C;AAmMD,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"}
|
|
@@ -66,13 +66,8 @@ function convertEntryPointsToSingleFile(entryPoints, tempWritePath) {
|
|
|
66
66
|
entryPoints.map((entry) => `import "${entry}"`).join(";\n")
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function removeClientScriptInTSXFile(pathName) {
|
|
69
|
+
function removeClientScriptInTSXFile(pathName, source) {
|
|
70
70
|
const content = fs.readFileSync(pathName, "utf-8");
|
|
71
|
-
const source = ts.createSourceFile(
|
|
72
|
-
pathName,
|
|
73
|
-
content,
|
|
74
|
-
ts.ScriptTarget.Latest
|
|
75
|
-
);
|
|
76
71
|
let toRemoveFrom;
|
|
77
72
|
let clientDataStart;
|
|
78
73
|
const clientImportsToHoist = [];
|
|
@@ -114,6 +109,17 @@ function removeClientScriptInTSXFile(pathName) {
|
|
|
114
109
|
clientDataStart
|
|
115
110
|
};
|
|
116
111
|
}
|
|
112
|
+
function createStaticFile(pathName, source) {
|
|
113
|
+
source.forEachChild((child) => {
|
|
114
|
+
if (child.kind === ts.SyntaxKind.ExpressionStatement) {
|
|
115
|
+
const text = child.getText(source);
|
|
116
|
+
const cleanedText = text.replace(/["';]/g, "");
|
|
117
|
+
if (cleanedText === "xpine-static") {
|
|
118
|
+
console.log("make this file static", pathName);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
117
123
|
|
|
118
124
|
// src/scripts/build.ts
|
|
119
125
|
import { globSync } from "glob";
|
|
@@ -266,7 +272,14 @@ async function buildAppFiles(files, isDev) {
|
|
|
266
272
|
name: "insert-html-banner-and-remove-client-scripts",
|
|
267
273
|
setup(build2) {
|
|
268
274
|
build2.onLoad({ filter: /.tsx/ }, (args) => {
|
|
269
|
-
const
|
|
275
|
+
const content = fs2.readFileSync(args.path, "utf-8");
|
|
276
|
+
const source = ts2.createSourceFile(
|
|
277
|
+
args.path,
|
|
278
|
+
content,
|
|
279
|
+
ts2.ScriptTarget.Latest
|
|
280
|
+
);
|
|
281
|
+
const cleanedContent = removeClientScriptInTSXFile(args.path, source);
|
|
282
|
+
createStaticFile(args.path, source);
|
|
270
283
|
const htmlImportStart = "import { html } from 'xpine';\n";
|
|
271
284
|
const newContent = `${htmlImportStart}${cleanedContent.content}`;
|
|
272
285
|
componentData.push({
|
|
@@ -73,13 +73,8 @@ function convertEntryPointsToSingleFile(entryPoints, tempWritePath) {
|
|
|
73
73
|
entryPoints.map((entry) => `import "${entry}"`).join(";\n")
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
function removeClientScriptInTSXFile(pathName) {
|
|
76
|
+
function removeClientScriptInTSXFile(pathName, source) {
|
|
77
77
|
const content = fs.readFileSync(pathName, "utf-8");
|
|
78
|
-
const source = ts.createSourceFile(
|
|
79
|
-
pathName,
|
|
80
|
-
content,
|
|
81
|
-
ts.ScriptTarget.Latest
|
|
82
|
-
);
|
|
83
78
|
let toRemoveFrom;
|
|
84
79
|
let clientDataStart;
|
|
85
80
|
const clientImportsToHoist = [];
|
|
@@ -121,6 +116,17 @@ function removeClientScriptInTSXFile(pathName) {
|
|
|
121
116
|
clientDataStart
|
|
122
117
|
};
|
|
123
118
|
}
|
|
119
|
+
function createStaticFile(pathName, source) {
|
|
120
|
+
source.forEachChild((child) => {
|
|
121
|
+
if (child.kind === ts.SyntaxKind.ExpressionStatement) {
|
|
122
|
+
const text = child.getText(source);
|
|
123
|
+
const cleanedText = text.replace(/["';]/g, "");
|
|
124
|
+
if (cleanedText === "xpine-static") {
|
|
125
|
+
console.log("make this file static", pathName);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
124
130
|
|
|
125
131
|
// src/scripts/build.ts
|
|
126
132
|
import { globSync } from "glob";
|
|
@@ -273,7 +279,14 @@ async function buildAppFiles(files, isDev) {
|
|
|
273
279
|
name: "insert-html-banner-and-remove-client-scripts",
|
|
274
280
|
setup(build2) {
|
|
275
281
|
build2.onLoad({ filter: /.tsx/ }, (args) => {
|
|
276
|
-
const
|
|
282
|
+
const content = fs2.readFileSync(args.path, "utf-8");
|
|
283
|
+
const source = ts2.createSourceFile(
|
|
284
|
+
args.path,
|
|
285
|
+
content,
|
|
286
|
+
ts2.ScriptTarget.Latest
|
|
287
|
+
);
|
|
288
|
+
const cleanedContent = removeClientScriptInTSXFile(args.path, source);
|
|
289
|
+
createStaticFile(args.path, source);
|
|
277
290
|
const htmlImportStart = "import { html } from 'xpine';\n";
|
|
278
291
|
const newContent = `${htmlImportStart}${cleanedContent.content}`;
|
|
279
292
|
componentData.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-layers.d.ts","sourceRoot":"","sources":["../../../../src/util/postcss/remove-layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,kBAAU,MAAM,CAAC;IACf,UAAiB,OAAO;
|
|
1
|
+
{"version":3,"file":"remove-layers.d.ts","sourceRoot":"","sources":["../../../../src/util/postcss/remove-layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,kBAAU,MAAM,CAAC;IACf,UAAiB,OAAO;KAAG;CAC5B;AAID,QAAA,MAAM,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CASxC,CAAC;AAGH,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xpine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-secrets-manager": "^3.758.0",
|
|
@@ -25,12 +25,15 @@
|
|
|
25
25
|
"url": "git://github.com/dan-caldwell/xpine.git"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "tsx ./src/scripts/build-module.ts && npm run build:types",
|
|
29
|
-
"build:types": "sh ./src/scripts/build-types.sh"
|
|
28
|
+
"build": "tsx ./src/scripts/run-build-module.ts && npm run build:types",
|
|
29
|
+
"build:types": "sh ./src/scripts/build-types.sh",
|
|
30
|
+
"xpine-dev-server": "tsx ./src/scripts/xpine-dev-server.ts"
|
|
30
31
|
},
|
|
31
32
|
"bin": {
|
|
32
33
|
"xpine-build": "dist/src/scripts/xpine-build.js",
|
|
33
|
-
"xpine-dev": "dist/src/scripts/xpine-dev.js"
|
|
34
|
+
"xpine-dev": "dist/src/scripts/xpine-dev.js",
|
|
35
|
+
"xpine-build:debug": "tsx ./src/scripts/xpine-build.ts",
|
|
36
|
+
"xpine-dev:debug": "tsx ./src/scripts/xpine-dev.ts"
|
|
34
37
|
},
|
|
35
38
|
"types": "dist/index.d.ts",
|
|
36
39
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runDevServer.d.ts","sourceRoot":"","sources":["../../../src/scripts/runDevServer.ts"],"names":[],"mappings":"AAYA,wBAAsB,YAAY,kBAiDjC"}
|