fluent-cart 0.0.0-stage → 0.1.0
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 +21 -0
- package/README.md +13 -2
- package/bin/fluent-cart.mjs +7 -0
- package/lib/kit-bin.mjs +16 -0
- package/package.json +30 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FluentCart Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fluent-cart
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The command line of the FluentCart headless kit, under a short name:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx fluent-cart init # AGENTS.md, CLAUDE.md and the agent skills in your Astro project
|
|
7
|
+
npx fluent-cart check # the store connection, JS per page, alt text, CSS; --only cls for layout shift
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
It runs the command of [`@fluent-cart/astro`](https://www.npmjs.com/package/@fluent-cart/astro), with the same options and exit codes. In a project that has `@fluent-cart/astro` installed, the canonical form is `npx @fluent-cart/astro init` (it uses your installed version and fetches nothing).
|
|
11
|
+
|
|
12
|
+
To start a new store: `npm create fluent-cart my-store` ([create-fluent-cart](https://www.npmjs.com/package/create-fluent-cart)).
|
|
13
|
+
|
|
14
|
+
MIT, © 2026 FluentCart Inc. Source: [fluent-cart/headless](https://github.com/fluent-cart/headless).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `npx fluent-cart …` runs the @fluent-cart/astro command line (init, check) in this process, so the
|
|
3
|
+
// arguments (process.argv) and the exit code are the kit's own.
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { kitBin } from '../lib/kit-bin.mjs';
|
|
6
|
+
|
|
7
|
+
await import(pathToFileURL(kitBin()).href);
|
package/lib/kit-bin.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Finds the @fluent-cart/astro command file: the kit's main entry, then up to its package.json, then its bin.
|
|
2
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
export function kitBin(resolve = (name) => import.meta.resolve(name)) {
|
|
7
|
+
let dir = dirname(fileURLToPath(resolve('@fluent-cart/astro')));
|
|
8
|
+
const isKit = (folder) => existsSync(join(folder, 'package.json')) && JSON.parse(readFileSync(join(folder, 'package.json'), 'utf8')).name === '@fluent-cart/astro';
|
|
9
|
+
while (!isKit(dir)) {
|
|
10
|
+
const up = dirname(dir);
|
|
11
|
+
if (up === dir) throw new Error('@fluent-cart/astro is not installed.');
|
|
12
|
+
dir = up;
|
|
13
|
+
}
|
|
14
|
+
const manifest = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
|
|
15
|
+
return join(dir, manifest.bin['fluent-cart']);
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluent-cart",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "npx fluent-cart: the FluentCart headless command line (init, check). Runs the command of @fluent-cart/astro.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "FluentCart Inc",
|
|
7
|
+
"homepage": "https://github.com/fluent-cart/headless/tree/main/fluent-cart#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/fluent-cart/headless.git",
|
|
11
|
+
"directory": "fluent-cart"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/fluent-cart/headless/issues",
|
|
14
|
+
"keywords": ["fluentcart", "astro", "headless", "ecommerce", "cli", "agents"],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"fluent-cart": "bin/fluent-cart.mjs"
|
|
18
|
+
},
|
|
19
|
+
"files": ["bin", "lib"],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18.19"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test test/*.test.mjs"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@fluent-cart/astro": "^0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|