@yannosay/sinth 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.
- package/package.json +1 -1
- package/src/sinth.ts +16 -17
package/package.json
CHANGED
package/src/sinth.ts
CHANGED
|
@@ -1583,12 +1583,12 @@ function compileFile(filePath: string, opts: CompileOptions): string | null {
|
|
|
1583
1583
|
return fs.existsSync(base) ? path.basename(base) : undefined;
|
|
1584
1584
|
})();
|
|
1585
1585
|
|
|
1586
|
-
// Convert CSS absolute paths to relative paths from the HTML output
|
|
1587
|
-
const relativeCssLinks = cssLinks.map(css => {
|
|
1588
|
-
const rel = path.relative(path.dirname(absPath), css).replace(/\\/g, "/");
|
|
1589
|
-
return rel.startsWith(".") ? rel : "./" + rel;
|
|
1590
|
-
});
|
|
1591
|
-
|
|
1586
|
+
// Convert CSS absolute paths to relative paths from the HTML output
|
|
1587
|
+
const relativeCssLinks = cssLinks.map(css => {
|
|
1588
|
+
const rel = path.relative(path.dirname(absPath), css).replace(/\\/g, "/");
|
|
1589
|
+
return rel.startsWith(".") ? rel : "./" + rel;
|
|
1590
|
+
});
|
|
1591
|
+
|
|
1592
1592
|
const head = renderHead(headData, relativeCssLinks, jsLinks, scopedCSS, companionJS);
|
|
1593
1593
|
const scriptTags: string[] = [];
|
|
1594
1594
|
|
|
@@ -1819,12 +1819,12 @@ async function main(): Promise<void> {
|
|
|
1819
1819
|
const minify = args.includes("--prod") || Boolean(cfg.minify);
|
|
1820
1820
|
const libraryPaths = (cfg.libraryPaths as string[] | undefined) ?? [path.join(cwd, "libraries")];
|
|
1821
1821
|
|
|
1822
|
-
// Remove flag values from args so they don't get treated as .sinth files
|
|
1823
|
-
const flagValues = new Set<string>();
|
|
1824
|
-
if (outDirIdx !== -1) flagValues.add(args[outDirIdx + 1]);
|
|
1825
|
-
if (portIdx !== -1) flagValues.add(args[portIdx + 1]);
|
|
1826
|
-
const cleanArgs = args.filter(a => !a.startsWith("--") && !flagValues.has(a));
|
|
1827
|
-
|
|
1822
|
+
// Remove flag values from args so they don't get treated as .sinth files
|
|
1823
|
+
const flagValues = new Set<string>();
|
|
1824
|
+
if (outDirIdx !== -1) flagValues.add(args[outDirIdx + 1]);
|
|
1825
|
+
if (portIdx !== -1) flagValues.add(args[portIdx + 1]);
|
|
1826
|
+
const cleanArgs = args.filter(a => !a.startsWith("--") && !flagValues.has(a));
|
|
1827
|
+
|
|
1828
1828
|
const opts: CompileOptions = { projectRoot: cwd, outDir, libraryPaths, minify, checkOnly: false };
|
|
1829
1829
|
|
|
1830
1830
|
switch (command) {
|
|
@@ -2077,8 +2077,8 @@ component Card(title, color = "blue") {
|
|
|
2077
2077
|
name: "my-sinth-site",
|
|
2078
2078
|
version: "1.0.0",
|
|
2079
2079
|
scripts: {
|
|
2080
|
-
build: "
|
|
2081
|
-
dev:
|
|
2080
|
+
build: "sinth build",
|
|
2081
|
+
dev: "sinth dev",
|
|
2082
2082
|
},
|
|
2083
2083
|
devDependencies: { "ts-node": "^10.0.0", typescript: "^5.0.0", sass: "^1.70.0" },
|
|
2084
2084
|
}, null, 2),
|
|
@@ -2088,9 +2088,8 @@ component Card(title, color = "blue") {
|
|
|
2088
2088
|
\x1b[32m✓ Sinth project scaffolded!\x1b[0m
|
|
2089
2089
|
|
|
2090
2090
|
\x1b[1mNext steps:\x1b[0m
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
npx ts-node sinth.ts build -- build to ./dist
|
|
2091
|
+
sinth dev
|
|
2092
|
+
sinth build
|
|
2094
2093
|
`);
|
|
2095
2094
|
}
|
|
2096
2095
|
|