zuby 1.0.83 → 1.0.84

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/config.js CHANGED
@@ -153,6 +153,7 @@ export const mergeDefaultConfig = async (config) => {
153
153
  }
154
154
  // Set default values
155
155
  config.srcDir = config.srcDir ?? './';
156
+ config.srcPagesDir = config.srcPagesDir ?? `${config.srcDir}/pages`.replace(/\/+/g, '/');
156
157
  config.publicDir = config.publicDir ?? 'public';
157
158
  config.outDir = config.outDir ?? '.zuby';
158
159
  config.cacheDir = config.cacheDir ?? '.zuby-cache';
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "zuby",
3
- "version": "1.0.83",
3
+ "version": "1.0.84",
4
4
  "description": "Zuby.js is a framework for building modern apps using Preact or React.",
5
5
  "type": "module",
6
- "main": "index.js",
7
6
  "scripts": {
8
7
  "release": "cd ./dist && npm publish --access public && cd ..",
9
8
  "build": "rm -rf dist/ && tsc && cp -rf package.json LICENSE.md README.md src/examples src/tsconfigs dist/ && npm run bundle-server",
@@ -36,13 +35,13 @@
36
35
  "zubyjs": "./commands/index.js"
37
36
  },
38
37
  "bugs": {
39
- "url": "https://gitlab.com/futrou/zuby.js/-/issues",
40
- "email": "zuby@futrou.com"
38
+ "url": "https://github.com/futrou/zuby.js/issues",
39
+ "email": "zubyjs@futrou.com"
41
40
  },
42
41
  "license": "MIT",
43
42
  "repository": {
44
43
  "type": "git",
45
- "url": "git+https://gitlab.com/futrou/zuby.js.git"
44
+ "url": "git+https://github.com/futrou/zuby.js.git"
46
45
  },
47
46
  "homepage": "https://zubyjs.com",
48
47
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  import { BASE_TEMPLATES, PATH_TYPES, TEMPLATES } from './types.js';
2
2
  import { getZubyInternalConfig } from '../config.js';
3
- import { basename, join, resolve } from 'path';
3
+ import { basename, resolve } from 'path';
4
4
  import { glob } from 'glob';
5
5
  import { normalizePath } from '../utils/pathUtils.js';
6
6
  import { pathToRegexp, toPath } from './pathUtils.js';
@@ -141,8 +141,8 @@ export async function getTemplates(cache = true) {
141
141
  * and returns them as an array of TemplateFile objects.
142
142
  */
143
143
  export async function getTemplateFiles() {
144
- const { srcDir, templateExtensions, templateFiles } = await getZubyInternalConfig();
145
- const pagesDir = normalizePath(join(srcDir, 'pages'));
144
+ const { srcPagesDir, templateExtensions, templateFiles } = await getZubyInternalConfig();
145
+ const pagesDir = normalizePath(srcPagesDir);
146
146
  const files = await glob(`${pagesDir}/**/*.{${templateExtensions.join(',')}}`);
147
147
  const configTemplateFiles = templateFiles.map(({ templateType, filename, path }) => {
148
148
  return {
package/types.d.ts CHANGED
@@ -18,6 +18,12 @@ export interface ZubyConfig {
18
18
  * @default ./
19
19
  */
20
20
  srcDir?: string;
21
+ /**
22
+ * The relative path to the directory where the pages are located
23
+ * inside the src directory.
24
+ * @default ./pages
25
+ */
26
+ srcPagesDir?: string;
21
27
  /**
22
28
  * The relative path the folder with the static files.
23
29
  * These files are copied to the output directory.