@yannosay/sinth 0.0.15 → 0.0.17

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sinth.ts +18 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yannosay/sinth",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "A declarative language that compiles to pure HTML, CSS, and JavaScript.",
5
5
  "author": "Yannosay Productions",
6
6
  "license": "AGPL-3.0",
package/src/sinth.ts CHANGED
@@ -1591,15 +1591,15 @@ function compileFile(filePath: string, opts: CompileOptions): string | null {
1591
1591
  return rel.startsWith(".") ? rel : "./" + rel;
1592
1592
  });
1593
1593
 
1594
- // Convert JS absolute paths to relative paths from the HTML output
1595
- const relativeJsLinks = jsLinks.map(js => ({
1596
- ...js,
1597
- src: (() => {
1598
- const rel = path.relative(path.dirname(absPath), js.src).replace(/\\/g, "/");
1599
- return rel.startsWith(".") ? rel : "./" + rel;
1600
- })(),
1601
- }));
1602
-
1594
+ // Convert JS absolute paths to relative paths from the HTML output
1595
+ const relativeJsLinks = jsLinks.map(js => ({
1596
+ ...js,
1597
+ src: (() => {
1598
+ const rel = path.relative(path.dirname(absPath), js.src).replace(/\\/g, "/");
1599
+ return rel.startsWith(".") ? rel : "./" + rel;
1600
+ })(),
1601
+ }));
1602
+
1603
1603
  const head = renderHead(headData, relativeCssLinks, relativeJsLinks, scopedCSS, companionJS);
1604
1604
  const scriptTags: string[] = [];
1605
1605
 
@@ -1880,6 +1880,13 @@ async function main(): Promise<void> {
1880
1880
  process.stdout.write(` \x1b[32m✓\x1b[0m assets/ → ${path.relative(cwd, assetsOut)}/\n`);
1881
1881
  }
1882
1882
 
1883
+ const libIn = path.join(cwd, "libraries");
1884
+ const libOut = path.join(outDir, "libraries");
1885
+ if (fs.existsSync(libIn)) {
1886
+ copyDir(libIn, libOut);
1887
+ process.stdout.write(` \x1b[32m✓\x1b[0m libraries/ → ${path.relative(cwd, libOut)}/\n`);
1888
+ }
1889
+
1883
1890
  process.stdout.write(`\n\x1b[1mBuilt ${built} page(s)\x1b[0m${hadError ? " with errors" : ""}\n`);
1884
1891
  process.exit(hadError ? 1 : 0);
1885
1892
  break;
@@ -1915,7 +1922,8 @@ async function main(): Promise<void> {
1915
1922
  case "version":
1916
1923
  case "--version":
1917
1924
  case "-v": {
1918
- process.stdout.write("Sinth Compiler v0.0.15\n");
1925
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf-8"));
1926
+ process.stdout.write(`Sinth Compiler v${pkg.version}\n`);
1919
1927
  break;
1920
1928
  }
1921
1929