@usequeek/create-theme 0.14.1 → 0.15.4
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/LICENSE +1 -1
- package/dist/add.js +1 -1
- package/dist/config-edit.js +1 -1
- package/dist/data/business-labels.json +1 -1
- package/dist/data/business-vocabulary.json +1 -1
- package/dist/data/skeleton-store.json +1 -1
- package/dist/data/theme-tags.json +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lists.d.ts +1 -1
- package/dist/lists.js +4 -5
- package/dist/naming.d.ts +8 -9
- package/dist/naming.js +7 -8
- package/package.json +3 -2
package/LICENSE
CHANGED
package/dist/add.js
CHANGED
|
@@ -90,7 +90,7 @@ export async function planAddTemplate(themeDir, input, lists = bundledLists()) {
|
|
|
90
90
|
const label = (input.label ?? lists.labelOf(business)).trim();
|
|
91
91
|
if (!label)
|
|
92
92
|
throw new UsageError('--label cannot be empty.');
|
|
93
|
-
// The template's `for`, category first
|
|
93
|
+
// The template's `for`, category first: planTemplates
|
|
94
94
|
// already computes it — a category leads with itself, a niche names only
|
|
95
95
|
// its own key. The new template is never the primary, so its design 1 id
|
|
96
96
|
// is its key, never `default`.
|
package/dist/config-edit.js
CHANGED
|
@@ -105,7 +105,7 @@ const newlineOf = (source) => (source.includes('\r\n') ? '\r\n' : '\n');
|
|
|
105
105
|
/**
|
|
106
106
|
* Edit a CRLF file (a Windows checkout, many Windows editors) as LF and give it back
|
|
107
107
|
* as CRLF. The parser's node offsets do not line up with a CRLF source, so an edit
|
|
108
|
-
* spliced at them lands mid-line and rewrites its neighbours
|
|
108
|
+
* spliced at them lands mid-line and rewrites its neighbours.
|
|
109
109
|
*/
|
|
110
110
|
function preservingLineEndings(source, edit) {
|
|
111
111
|
if (!source.includes('\r\n'))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Display names for every key in business-vocabulary.json, for pickers
|
|
2
|
+
"$comment": "Display names for every key in business-vocabulary.json, for the pickers in `npm create @usequeek/theme`; the labels test fails when a key has none.",
|
|
3
3
|
"labels": {
|
|
4
4
|
"android-phones": "Android Phones",
|
|
5
5
|
"art-supplies": "Art Supplies",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "The only keys a template's `for` may use (
|
|
2
|
+
"$comment": "The only keys a template's `for` may use (`default_demo.for` and `demos[].for` in theme.config.ts): `services` are the business slugs a vendor registers as, `catalogue` is the product taxonomy from root to branches, and `subcategories` maps a branch to its children; each key is the slug of its category name.",
|
|
3
3
|
"version": "d1f9c8eefc91ed3b2c834345458c62343f465ce6",
|
|
4
4
|
"services": [
|
|
5
5
|
"baby-kids",
|
|
@@ -683,7 +683,7 @@
|
|
|
683
683
|
"url": "https://media.usequeek.com/theme-assets/_bare/dcdae58f874939a9.jpg",
|
|
684
684
|
"alt": "",
|
|
685
685
|
"title": "One product, the whole page",
|
|
686
|
-
"subtitle": "A sales page sells one to three products.
|
|
686
|
+
"subtitle": "A sales page sells one to three products. Queek binds the merchant’s own to every products section here.",
|
|
687
687
|
"cta_label": "Buy now",
|
|
688
688
|
"cta_url": "/shop"
|
|
689
689
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "
|
|
2
|
+
"$comment": "Style tags offered by `npm create @usequeek/theme` (US spelling; business words such as fashion or food are categories, not tags).",
|
|
3
3
|
"tags": ["light", "dark", "colorful", "monochrome", "warm", "cool", "minimal", "bold", "elegant", "playful", "luxury", "classic", "modern", "editorial", "photo-led", "type-led", "catalog-first", "story-led"]
|
|
4
4
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export { appendDemoEntry, setDesignLabel } from './config-edit.js';
|
|
|
7
7
|
export { planAddTemplate, planAddDesign, planAddPage, applyAddPlan, vocabularyLists, type AddPlan } from './add.js';
|
|
8
8
|
export { clackPrompter, templateOptions } from './prompts.js';
|
|
9
9
|
export { bundledLists, cachedLists, createLists, getActiveLists, setActiveLists, SHOP_HINT, SHOP_KEY, SHOP_LABEL, type BusinessLists, type BusinessOption, type ListsData } from './lists.js';
|
|
10
|
-
/** The rename `npm create` applies to the starter, for tools that copy a theme under a new name
|
|
10
|
+
/** The rename `npm create` applies to the starter, for tools that copy a theme under a new name. */
|
|
11
11
|
export { renameTheme, SKELETON, type Identity } from './rename.js';
|
|
12
|
-
/** The starter this release was tested with: its tag matches this package's version
|
|
12
|
+
/** The starter this release was tested with: its tag matches this package's version. */
|
|
13
13
|
export declare const STARTER: string;
|
|
14
14
|
export declare function detectPackageManager(userAgent?: string): PackageManager;
|
|
15
15
|
export declare const HELP = "Create a Queek storefront theme.\n\n npm create @usequeek/theme@latest my-theme -- --templates laundry --tags minimal\n pnpm create @usequeek/theme my-theme --templates laundry --tags minimal\n\nnpm needs -- before these flags. In a terminal, anything you leave out is asked,\nand with no folder the folder is named after the theme (my-theme with --yes or no terminal).\n\n --name <text> theme name (default: the folder name)\n --templates <keys> businesses to make templates for, comma-separated (required with --yes)\n --primary <key> the main template (default: the first)\n --categories <keys> business categories (default: the templates')\n --tags <tags> 1\u20136 tags for the look (required with --yes)\n --pages <list|none> extra pages: contact, faq (default: both)\n --ai <list>, --no-ai AI assistants: claude, gemini (default: both; AGENTS.md unless --no-ai)\n --pm <npm|pnpm|yarn|bun>, --no-install, --no-git\n --yes, -y never prompt; take the default for everything else\n --dry-run print what would be written; write nothing\n --force allow a folder that is not empty\n --template <source> another starter: a giget source or a local folder\n --vocabulary <file> a pinned vocabulary file (default: the live copy)\n --offline use the bundled vocabulary snapshot; no network";
|
package/dist/index.js
CHANGED
|
@@ -14,10 +14,10 @@ export { appendDemoEntry, setDesignLabel } from './config-edit.js';
|
|
|
14
14
|
export { planAddTemplate, planAddDesign, planAddPage, applyAddPlan, vocabularyLists } from './add.js';
|
|
15
15
|
export { clackPrompter, templateOptions } from './prompts.js';
|
|
16
16
|
export { bundledLists, cachedLists, createLists, getActiveLists, setActiveLists, SHOP_HINT, SHOP_KEY, SHOP_LABEL } from './lists.js';
|
|
17
|
-
/** The rename `npm create` applies to the starter, for tools that copy a theme under a new name
|
|
17
|
+
/** The rename `npm create` applies to the starter, for tools that copy a theme under a new name. */
|
|
18
18
|
export { renameTheme, SKELETON } from './rename.js';
|
|
19
19
|
const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
20
|
-
/** The starter this release was tested with: its tag matches this package's version
|
|
20
|
+
/** The starter this release was tested with: its tag matches this package's version. */
|
|
21
21
|
export const STARTER = `github:usequeek/theme-starter#v${VERSION}`;
|
|
22
22
|
export function detectPackageManager(userAgent = process.env.npm_config_user_agent ?? '') {
|
|
23
23
|
const name = userAgent.split('/')[0];
|
package/dist/lists.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare function getActiveLists(): BusinessLists;
|
|
|
42
42
|
export declare function setActiveLists(lists: BusinessLists): void;
|
|
43
43
|
/** The cached copy, synchronously, for prompts that must ask before any fetch returns. Null when absent or invalid. */
|
|
44
44
|
export declare function cachedLists(): BusinessLists | null;
|
|
45
|
-
/** Business categories: what a vendor picks at setup
|
|
45
|
+
/** Business categories: what a vendor picks at setup. */
|
|
46
46
|
export declare const SERVICES: readonly string[];
|
|
47
47
|
/** Catalogue keys that are not also a business category: a template for one kind of product. */
|
|
48
48
|
export declare const NICHES: readonly string[];
|
package/dist/lists.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The lists a developer picks from, bundled at build time
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* release enforces.
|
|
2
|
+
* The lists a developer picks from, bundled at build time: no network before
|
|
3
|
+
* a question is asked, and the same vocabulary the checker of this release
|
|
4
|
+
* enforces.
|
|
6
5
|
*
|
|
7
6
|
* A run's lists are a BusinessLists built from one vocabulary copy: the
|
|
8
7
|
* cached-or-bundled copy while prompting, the live copy for the final check
|
|
@@ -103,7 +102,7 @@ export function cachedLists() {
|
|
|
103
102
|
labels: cached.labels ?? Object.fromEntries(bundled.businessKeys.map((key) => [key, bundled.labelOf(key)])),
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
|
-
/** Business categories: what a vendor picks at setup
|
|
105
|
+
/** Business categories: what a vendor picks at setup. */
|
|
107
106
|
export const SERVICES = BUNDLED.services;
|
|
108
107
|
/** Catalogue keys that are not also a business category: a template for one kind of product. */
|
|
109
108
|
export const NICHES = BUNDLED.niches;
|
package/dist/naming.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BusinessLists } from './lists.js';
|
|
2
|
-
/** `Mọ́ Laundry & Co.` → `mo-laundry-co`: what
|
|
2
|
+
/** `Mọ́ Laundry & Co.` → `mo-laundry-co`: what Queek accepts as a theme slug, `^[a-z][a-z0-9-]{1,30}$`. */
|
|
3
3
|
export declare function slugify(name: string): string;
|
|
4
4
|
/** Why a slug cannot be used, or null. */
|
|
5
5
|
export declare function slugProblem(slug: string): string | null;
|
|
@@ -10,7 +10,7 @@ export interface TemplatePlan {
|
|
|
10
10
|
id: string;
|
|
11
11
|
/** The business picked. */
|
|
12
12
|
key: string;
|
|
13
|
-
/** The template key theme.config.ts declares on the design
|
|
13
|
+
/** The template key theme.config.ts declares on the design: the business picked. */
|
|
14
14
|
template: string;
|
|
15
15
|
label: string;
|
|
16
16
|
for: string[];
|
|
@@ -18,13 +18,12 @@ export interface TemplatePlan {
|
|
|
18
18
|
primary: boolean;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* One template per business picked, each with one design (
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* names a category (R2.7).
|
|
21
|
+
* One template per business picked, each with one design (theme → template
|
|
22
|
+
* → design). The main template's design is `default` (demo.json); every other
|
|
23
|
+
* design's id is its template's key, which makes it that template's design 1.
|
|
24
|
+
* The key is the business picked, so a template is never inferred from an id.
|
|
25
|
+
* A business category makes a general template, a niche a niche one — either
|
|
26
|
+
* way `for` is just that key, so a niche never names a category.
|
|
28
27
|
*/
|
|
29
28
|
export declare function planTemplates(keys: string[], primary?: string, lists?: BusinessLists): TemplatePlan[];
|
|
30
29
|
/** The business categories the templates belong to, once each, in order. */
|
package/dist/naming.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RESERVED_PREFIXES, RESERVED_SLUGS, getActiveLists } from './lists.js';
|
|
2
|
-
/** `Mọ́ Laundry & Co.` → `mo-laundry-co`: what
|
|
2
|
+
/** `Mọ́ Laundry & Co.` → `mo-laundry-co`: what Queek accepts as a theme slug, `^[a-z][a-z0-9-]{1,30}$`. */
|
|
3
3
|
export function slugify(name) {
|
|
4
4
|
let slug = name.normalize('NFKD').replace(/\p{M}/gu, '').toLowerCase()
|
|
5
5
|
.replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
@@ -27,13 +27,12 @@ export function prefixFor(slug) {
|
|
|
27
27
|
return candidates.find((prefix) => /^[a-z][a-z0-9]{1,3}$/.test(prefix) && !RESERVED_PREFIXES.includes(prefix) && prefix !== 'core') ?? `${slug[0]}q`;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* One template per business picked, each with one design (
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* names a category (R2.7).
|
|
30
|
+
* One template per business picked, each with one design (theme → template
|
|
31
|
+
* → design). The main template's design is `default` (demo.json); every other
|
|
32
|
+
* design's id is its template's key, which makes it that template's design 1.
|
|
33
|
+
* The key is the business picked, so a template is never inferred from an id.
|
|
34
|
+
* A business category makes a general template, a niche a niche one — either
|
|
35
|
+
* way `for` is just that key, so a niche never names a category.
|
|
37
36
|
*/
|
|
38
37
|
export function planTemplates(keys, primary, lists = getActiveLists()) {
|
|
39
38
|
const unique = [...new Set(keys)];
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usequeek/create-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "npm create @usequeek/theme — start a Queek storefront theme from the official starter.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "Queekx Technology LTD",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"bin": {
|
|
8
9
|
"create-theme": "./dist/cli.js"
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@clack/prompts": "^1.8.1",
|
|
25
|
-
"@usequeek/theme-check": "^0.
|
|
26
|
+
"@usequeek/theme-check": "^0.15.3",
|
|
26
27
|
"giget": "^3.3.1",
|
|
27
28
|
"magicast": "^0.5.5"
|
|
28
29
|
},
|