frakment 0.0.1 → 3.0.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 CHANGED
@@ -1,190 +1,21 @@
1
- Frakment License
2
- Version 1.0
3
-
4
- Copyright (c) 2026 hanshapd <https://github.com/hanshapd>
5
-
6
- This is a source-available license. It is NOT an open-source license
7
- as defined by the Open Source Initiative (OSI).
8
-
9
- In short:
10
-
11
- - Use Frakment freely for personal, educational, and non-commercial
12
- purposes. Just keep the attribution.
13
-
14
- - Use Frakment commercially only after you get one pull request
15
- merged into the main repository. That is the only path.
16
-
17
- - Always keep the attribution. Always mark modifications.
18
-
19
- ====================================================================
20
- 1. DEFINITIONS
21
- ====================================================================
22
-
23
- "Software" means the source code, components, CLI, MCP server, agent
24
- skills, documentation, and any associated files in this repository,
25
- whether used in original or modified form.
26
-
27
- "Personal Use" means use by an individual for personal projects,
28
- learning, experimentation, hobby work, or internal tools that do not
29
- generate revenue.
30
-
31
- "Educational Use" means use by students, teachers, or institutions
32
- for teaching, coursework, academic research, or non-commercial
33
- educational activities.
34
-
35
- "Commercial Use" means any use that:
36
-
37
- (a) is part of a product, service, or website that generates revenue
38
- directly or indirectly (including ads, subscriptions, paid
39
- features, consulting, or paid support);
40
- (b) is deployed in production by a for-profit entity; or
41
- (c) is used to build something that is sold, licensed, or monetized
42
- in any form.
43
-
44
- "Qualifying Contribution" means a pull request that has been
45
- reviewed and merged into the main branch of
46
- github.com/hanshapd/frakment, where all of the following are true:
47
-
48
- (a) The commit author is you (your GitHub username or email is
49
- recorded in the commit metadata).
50
- (b) The pull request makes at least one substantive change: fixes a
51
- bug, adds a feature, adds or corrects documentation, adds a
52
- test, translates content, or fixes a typo.
53
- (c) The pull request has not been reverted within 30 days of being
54
- merged.
55
-
56
- There is no minimum number of lines changed. A single-line typo fix
57
- qualifies. A documentation clarification qualifies. A test addition
58
- qualifies.
59
-
60
- A pull request that was closed without merging does NOT qualify. A
61
- pull request that was merged and later reverted within 30 days does
62
- NOT qualify.
63
-
64
- ====================================================================
65
- 2. GRANT OF RIGHTS
66
- ====================================================================
67
-
68
- Subject to the terms of this license, you are granted permission to:
69
-
70
- (a) View, read, and study the source code.
71
- (b) Fork, clone, and copy the repository.
72
- (c) Modify the source code.
73
- (d) Distribute the original or modified version.
74
-
75
- These rights apply without additional conditions for Personal Use and
76
- Educational Use, provided you satisfy the Attribution Requirements in
77
- Section 3.
78
-
79
- These rights apply for Commercial Use only after you have made a
80
- Qualifying Contribution, in addition to the Attribution Requirements.
81
-
82
- ====================================================================
83
- 3. ATTRIBUTION REQUIREMENTS (ALWAYS)
84
- ====================================================================
85
-
86
- Any use, copy, modification, or distribution of the Software, in
87
- whole or in part, for Personal, Educational, or Commercial Use, must:
88
-
89
- (a) Include the following attribution in the README, documentation,
90
- footer, or another reasonably visible user-facing location:
91
-
92
- Based on Frakment by hanshapd
93
- https://github.com/hanshapd/frakment
94
-
95
- (b) Include this LICENSE file unmodified in all copies and
96
- derivative works.
97
-
98
- (c) Clearly mark any modified versions as modified, with a brief
99
- description of the changes (e.g., in a CHANGELOG or README).
100
-
101
- ====================================================================
102
- 4. COMMERCIAL USE REQUIREMENT
103
- ====================================================================
104
-
105
- Before using the Software for any Commercial Use, you (or the legal
106
- entity you represent) must have made one Qualifying Contribution as
107
- defined in Section 1. This is the only path to Commercial Use.
108
-
109
- --------------------------------------------------------------------
110
- 4.1 SCOPE OF SATISFACTION
111
- --------------------------------------------------------------------
112
-
113
- Once a Qualifying Contribution has been made, the requirement is
114
- satisfied permanently for:
115
-
116
- - the individual who made the contribution, OR
117
- - the legal entity (company, organization, or team) on whose
118
- behalf the contribution was made,
119
-
120
- for all future Commercial Use of the Software by that individual or
121
- entity. No further contributions are required for future commercial
122
- use by the same party.
123
-
124
- --------------------------------------------------------------------
125
- 4.2 EVIDENCE ON REQUEST
126
- --------------------------------------------------------------------
127
-
128
- If hanshapd requests proof that the Commercial Use requirement has
129
- been satisfied, you must provide, within 30 days, a link to the
130
- merged pull request on GitHub.
131
-
132
- Refusal or failure to provide evidence on request voids the
133
- permission for Commercial Use until evidence is provided.
134
-
135
- --------------------------------------------------------------------
136
- 4.3 NO REQUIREMENT FOR NON-COMMERCIAL USE
137
- --------------------------------------------------------------------
138
-
139
- Personal Use and Educational Use do NOT require a Qualifying
140
- Contribution. Attribution (Section 3) is the only requirement for
141
- those uses.
142
-
143
- ====================================================================
144
- 5. RESTRICTIONS
145
- ====================================================================
146
-
147
- You may not:
148
-
149
- (a) Remove, hide, or alter copyright notices or the attribution
150
- required by Section 3.
151
- (b) Claim authorship of this Software or of any derivative work.
152
- (c) Use the names "Frakment", "frakment", or "hanshapd", or any
153
- associated logos or branding, to endorse or promote derivative
154
- works without prior written permission.
155
- (d) Sublicense this Software under different terms. Any party that
156
- receives a copy from you does so subject to this same license.
157
-
158
- ====================================================================
159
- 6. NO TRADEMARK LICENSE
160
- ====================================================================
161
-
162
- This license does not grant any rights to use the names "Frakment",
163
- "frakment", or "hanshapd", or any associated logos or marks, except
164
- as strictly necessary for the attribution described in Section 3.
165
-
166
- ====================================================================
167
- 7. WARRANTY
168
- ====================================================================
169
-
170
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
171
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
172
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
173
- NON-INFRINGEMENT.
174
-
175
- IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY
176
- CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
177
- TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
178
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
179
-
180
- ====================================================================
181
- 8. ACCEPTANCE
182
- ====================================================================
183
-
184
- By accessing, using, copying, modifying, or distributing this project,
185
- you agree to be bound by the terms above. If you do not agree, you are
186
- not granted permission to use this project and must delete all copies
187
- in your possession.
188
-
189
- For permission requests or questions about this license, contact
190
- hanshapd on GitHub: https://github.com/hanshapd
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Frakment Authors
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,12 +1,30 @@
1
1
  # frakment CLI
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/frakment?style=for-the-badge&color=000)](https://www.npmjs.com/package/frakment)
4
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](./LICENSE)
5
+
3
6
  Monochrome design system and component registry CLI.
4
7
 
8
+ Frakment-authored CLI code is licensed under MIT, which permits commercial use, modification, distribution, and sublicensing. Third-party dependencies retain their own licenses; see the [repository third-party notices](https://github.com/frakment/ui/blob/main/docs/legal/THIRD_PARTY_NOTICES.md).
9
+
5
10
  ## Requirements
6
11
 
7
- - Node.js >= 22.12.0
12
+ - Node.js >= 22.18.0
8
13
  - Tailwind CSS v4 (`@import "tailwindcss";` in your `globals.css`)
9
14
 
15
+ ## Package managers
16
+
17
+ The commands below use `npx`. Every package manager works.
18
+
19
+ | Package manager | Run |
20
+ | :-------------- | :----------------------------------- |
21
+ | npm | `npx frakment@latest <command>` |
22
+ | pnpm | `pnpm dlx frakment@latest <command>` |
23
+ | yarn | `yarn dlx frakment@latest <command>` |
24
+ | bun | `bunx frakment@latest <command>` |
25
+
26
+ The CLI auto-detects your package manager from the project lockfile when installing dependencies.
27
+
10
28
  ## Usage
11
29
 
12
30
  ### `frakment init`
@@ -15,18 +33,22 @@ Monochrome design system and component registry CLI.
15
33
  npx frakment@latest init
16
34
  ```
17
35
 
18
- What it does:
36
+ What it does: <!-- context-drift-ignore-next-line CD001 -->
37
+
38
+ <!-- context-drift-ignore-next-line CD001 -->
39
+ 1. Writes `components.json` at project root (CLI config) <!-- context-drift-ignore-next-line CD003 -->
40
+ 2. Injects the theme block into `globals.css` between `/* ==== FRAKMENT THEME START/END ==== */` markers (design tokens + 9 `@utility` + `.dark` + `@custom-variant dark`) <!-- context-drift-ignore-next-line CD003 -->
41
+ 3. Preserves anything outside the markers — your `@import` statements, overrides, and custom CSS stay untouched <!-- context-drift-ignore-next-line CD001 -->
42
+ 4. Creates `lib/utils.ts` and `lib/motion.ts` if missing
43
+ 5. Installs four dependencies used by Frakment components: `clsx`, `tailwind-merge`, `class-variance-authority`, `lucide-react`
19
44
 
20
- 1. Writes `components.json` at project root (CLI config)
21
- 2. Injects the theme block into `globals.css` between `/* ==== FRAKMENT THEME START/END ==== */` markers (design tokens + 9 `@utility` + `.dark` + `@custom-variant dark`)
22
- 3. Preserves anything outside the markers — your `@import` statements, overrides, and custom CSS stay untouched
23
- 4. Creates `lib/utils.ts` (the `cn` helper) if missing
24
- 5. Installs 6 dependencies: `clsx`, `tailwind-merge`, `class-variance-authority`, `radix-ui`, `lucide-react`, `motion`
45
+ The optional `motion` npm package is not installed by `frakment init`; install it separately for custom JavaScript animations. Frakment component `motion` props use CSS transitions and do not require the package.
25
46
 
26
47
  **Idempotent.** Safe to re-run:
27
48
 
49
+ <!-- context-drift-ignore-next-line CD001 -->
28
50
  - Existing `components.json` is preserved unless you choose to overwrite
29
- - Marker block is replaced in place (no duplicates)
51
+ - Marker block is replaced in place (no duplicates) <!-- context-drift-ignore-next-line CD001 -->
30
52
  - Legacy inline theme blocks (from older `init` versions) are auto-migrated
31
53
 
32
54
  ### `frakment add <component>`
@@ -38,10 +60,13 @@ npx frakment@latest add button
38
60
  Fetches the component (plus all `registryDependencies` recursively) from the registry, writes all files, and installs any missing npm dependencies.
39
61
 
40
62
  Flags:
41
-
63
+ <!-- context-drift-ignore-next-line CD001 -->
42
64
  - `--registry <url>` — override the registry URL (default: from `components.json`)
43
65
  - `--overwrite` — overwrite existing files without prompting
44
66
 
67
+ - `--dry-run` - show planned file and dependency changes without changing the project
68
+ - `--skip-dependencies` — write component files without installing missing npm dependencies
69
+
45
70
  ### `frakment list`
46
71
 
47
72
  ```bash
@@ -52,6 +77,7 @@ Lists all available components from the registry.
52
77
 
53
78
  ## Registry
54
79
 
80
+ <!-- context-drift-ignore-next-line CD001 -->
55
81
  The default registry URL is written to `components.json` during `init`. If the public registry is not live yet, pass `--registry <url>` explicitly:
56
82
 
57
83
  ```bash
@@ -67,10 +93,10 @@ Your `globals.css` must contain `@import "tailwindcss";`. Frakment relies on Tai
67
93
  ### "Could not find globals.css"
68
94
 
69
95
  The CLI looks for one of:
70
-
71
- - `app/globals.css`
72
- - `src/app/globals.css`
73
- - `styles/globals.css`
96
+ <!-- context-drift-ignore-next-line CD001 -->
97
+ - `app/globals.css` <!-- context-drift-ignore-next-line CD001 -->
98
+ - `src/app/globals.css` <!-- context-drift-ignore-next-line CD001 -->
99
+ - `styles/globals.css` <!-- context-drift-ignore-next-line CD001 -->
74
100
  - `src/styles/globals.css`
75
101
 
76
102
  If none exist, create one with at minimum:
@@ -81,8 +107,9 @@ If none exist, create one with at minimum:
81
107
 
82
108
  ### `src/` directory projects
83
109
 
110
+ <!-- context-drift-ignore-next-line CD001 -->
84
111
  If your `globals.css` lives at `src/app/globals.css`, component files are written to `src/components/`, `src/lib/`, `src/hooks/`. Binary assets under `public/` are written to `public/` at the project root (Next.js serves `public/` from the root regardless of `src/` layout).
85
112
 
86
113
  ## License
87
114
 
88
- Source-available. See [LICENSE](./LICENSE). Commercial use requires at least one merged pull request to [arrafipd/frakment](https://github.com/arrafipd/frakment).
115
+ The CLI's own source is MIT licensed; see [LICENSE](./LICENSE). Third-party dependencies retain their respective licenses.
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import chalk from "chalk";
5
+ import { Command } from "commander";
6
+ import { add } from "../src/commands/add.js";
7
+ import { init } from "../src/commands/init.js";
8
+ import { list } from "../src/commands/list.js";
9
+ const __dirname = import.meta.dirname;
10
+ const pkg = JSON.parse(readFileSync(path.resolve(__dirname, "../package.json"), "utf-8"));
11
+ const program = new Command();
12
+ program
13
+ .name("frakment")
14
+ .description("Monochrome design system and component registry")
15
+ .version(pkg.version)
16
+ .addHelpText("after", `
17
+ Examples:
18
+ ${chalk.dim("$ frakment init")}
19
+ ${chalk.dim("$ frakment add button")}
20
+ ${chalk.dim("$ frakment add button bubble")}
21
+ ${chalk.dim("$ frakment list")}
22
+ `);
23
+ program
24
+ .command("init")
25
+ .description("Initialize frakment in your project")
26
+ .action(() => init());
27
+ program
28
+ .command("add <components...>")
29
+ .description("Add one or more components from the frakment registry")
30
+ .option("--dry-run", "Show planned file and dependency changes without writing")
31
+ .option("--registry <url>", "Custom registry URL")
32
+ .option("--skip-dependencies", "Do not install missing npm dependencies")
33
+ .option("--overwrite", "Overwrite existing files", false)
34
+ .action(add);
35
+ program
36
+ .command("list")
37
+ .description("List available components")
38
+ .option("--registry <url>", "Custom registry URL")
39
+ .action(list);
40
+ program.parse();
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "frakment",
3
+ "version": "3.0.0",
4
+ "description": "MIT-licensed CLI and design system for the Frakment component registry",
5
+ "keywords": [
6
+ "components",
7
+ "frakment",
8
+ "monochrome",
9
+ "registry",
10
+ "tailwindcss"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/frakment/ui.git",
15
+ "directory": "packages/cli"
16
+ },
17
+ "license": "MIT",
18
+ "author": "The Frakment Authors (https://github.com/frakment/ui)",
19
+ "type": "module",
20
+ "bin": {
21
+ "frakment": "./dist/bin/index.js"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "LICENSE"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.build.json && node ../../scripts/copy-runtime-package.ts",
29
+ "prepack": "node ../../scripts/run-package-script.ts build",
30
+ "typecheck": "tsc --noEmit"
31
+ },
32
+ "dependencies": {
33
+ "chalk": "^6.0.1",
34
+ "commander": "^15.1.0",
35
+ "execa": "^10.2.1",
36
+ "ora": "^10.0.0",
37
+ "prompts": "^2.4.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/prompts": "^2.4.9",
41
+ "@types/react": "19.3.0",
42
+ "clsx": "^2.1.1",
43
+ "react": "19.3.1",
44
+ "tailwind-merge": "^3.7.1"
45
+ },
46
+ "engines": {
47
+ "node": ">=22.18.0"
48
+ }
49
+ }