made-refine 0.1.3 → 0.1.7
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/README.md +21 -6
- package/dist/babel.cjs +37 -0
- package/dist/cli.cjs +1 -3
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +529 -335
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +529 -335
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +7 -7
- package/babel/index.cjs +0 -45
- package/vite/index.ts +0 -157
- package/vite/transform.test.ts +0 -95
- /package/{vite/index.d.ts → dist/vite.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -13,10 +13,11 @@ npx made-refine init
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The CLI auto-detects your framework (Next.js, Vite, or TanStack Start), installs the package, and configures everything — with a diff preview before any file changes.
|
|
16
|
+
If you use Bun, you can run `bunx made-refine init` instead.
|
|
16
17
|
|
|
17
18
|
Or, paste this prompt into any AI coding assistant (Cursor, Copilot, Claude Code, etc.):
|
|
18
19
|
|
|
19
|
-
> Add made-refine to this project. Run `npx made-refine init` and follow the prompts.
|
|
20
|
+
> Add made-refine to this project. Run `npx made-refine init` and follow the prompts. If Bun is available, `bunx made-refine init` also works.
|
|
20
21
|
|
|
21
22
|
---
|
|
22
23
|
|
|
@@ -27,11 +28,7 @@ If you prefer to set things up by hand, follow the instructions below for your f
|
|
|
27
28
|
### Installation
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
npm install made-refine@beta
|
|
31
|
-
# or
|
|
32
31
|
bun add made-refine@beta
|
|
33
|
-
# or
|
|
34
|
-
yarn add made-refine@beta
|
|
35
32
|
```
|
|
36
33
|
|
|
37
34
|
## Next.js Setup
|
|
@@ -254,12 +251,14 @@ Add this to `.mcp.json` in your project root:
|
|
|
254
251
|
"mcpServers": {
|
|
255
252
|
"made-refine": {
|
|
256
253
|
"command": "npx",
|
|
257
|
-
"args": ["made-refine-mcp"]
|
|
254
|
+
"args": ["-y", "made-refine-mcp"]
|
|
258
255
|
}
|
|
259
256
|
}
|
|
260
257
|
}
|
|
261
258
|
```
|
|
262
259
|
|
|
260
|
+
If you use Bun, set `"command": "bunx"` and `"args": ["made-refine-mcp"]`.
|
|
261
|
+
|
|
263
262
|
Restart Claude Code. You should see the Made-Refine tools available.
|
|
264
263
|
|
|
265
264
|
### Usage
|
|
@@ -354,6 +353,22 @@ These utilities require DOM APIs and must run in the browser:
|
|
|
354
353
|
- React 18+
|
|
355
354
|
- Next.js 13+ or Vite 4+
|
|
356
355
|
|
|
356
|
+
## Release to npm
|
|
357
|
+
|
|
358
|
+
Publishing is handled by GitHub Actions via `.github/workflows/publish.yml`.
|
|
359
|
+
|
|
360
|
+
1. Go to **Actions** -> **Publish** -> **Run workflow**.
|
|
361
|
+
2. Run it from the `main` branch.
|
|
362
|
+
3. Choose `task`:
|
|
363
|
+
- `release`: bump version and publish
|
|
364
|
+
- `unpublish`: remove selected versions from npm
|
|
365
|
+
4. For `release`, choose `bump` (`patch`, `minor`, `major`, or `prerelease`).
|
|
366
|
+
5. If using `prerelease`, set `preid` (default: `beta`).
|
|
367
|
+
6. Keep `npm_tag` as `auto` (stable -> `latest`, prerelease -> `beta`) or override it.
|
|
368
|
+
7. For `unpublish`, set `unpublish_versions` and `confirm_unpublish=UNPUBLISH`.
|
|
369
|
+
|
|
370
|
+
For release, the workflow bumps `package.json` version, creates a git tag, pushes to `main`, and publishes to npm with Bun.
|
|
371
|
+
|
|
357
372
|
## CSS Variables
|
|
358
373
|
|
|
359
374
|
The package uses CSS variables for theming. It will use your app's existing shadcn/ui theme if available, or fall back to sensible defaults:
|
package/dist/babel.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// babel/index.cjs
|
|
4
|
+
var path = require("path");
|
|
5
|
+
function isHostElement(name) {
|
|
6
|
+
return /^[a-z]/.test(name);
|
|
7
|
+
}
|
|
8
|
+
module.exports = function directEditSourcePlugin({ types: t }) {
|
|
9
|
+
return {
|
|
10
|
+
name: "direct-edit-source",
|
|
11
|
+
visitor: {
|
|
12
|
+
JSXOpeningElement(nodePath, state) {
|
|
13
|
+
const { node } = nodePath;
|
|
14
|
+
if (!t.isJSXIdentifier(node.name)) return;
|
|
15
|
+
if (!isHostElement(node.name.name)) return;
|
|
16
|
+
const filename = state.file?.opts?.filename;
|
|
17
|
+
if (!filename) return;
|
|
18
|
+
const normalized = filename.replace(/\\/g, "/");
|
|
19
|
+
if (normalized.includes("/node_modules/")) return;
|
|
20
|
+
if (normalized.includes("/node_modules/made-refine/")) return;
|
|
21
|
+
if (!node.loc?.start) return;
|
|
22
|
+
const hasAttribute = node.attributes.some((attr) => {
|
|
23
|
+
return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: "data-direct-edit-source" });
|
|
24
|
+
});
|
|
25
|
+
if (hasAttribute) return;
|
|
26
|
+
const relative = path.relative(process.cwd(), filename).replace(/\\/g, "/");
|
|
27
|
+
const file = `/[project]/${relative}`;
|
|
28
|
+
const line = node.loc.start.line;
|
|
29
|
+
const column = node.loc.start.column + 1;
|
|
30
|
+
const value = `${file}:${line}:${column}`;
|
|
31
|
+
node.attributes.push(
|
|
32
|
+
t.jsxAttribute(t.jsxIdentifier("data-direct-edit-source"), t.stringLiteral(value))
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
package/dist/cli.cjs
CHANGED
|
@@ -8369,7 +8369,7 @@ function detectPackageManager(cwd) {
|
|
|
8369
8369
|
if (import_fs.default.existsSync(import_path.default.join(cwd, "bun.lockb")) || import_fs.default.existsSync(import_path.default.join(cwd, "bun.lock"))) return "bun";
|
|
8370
8370
|
if (import_fs.default.existsSync(import_path.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
8371
8371
|
if (import_fs.default.existsSync(import_path.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
8372
|
-
return "
|
|
8372
|
+
return "bun";
|
|
8373
8373
|
}
|
|
8374
8374
|
function getInstallCommand(pm) {
|
|
8375
8375
|
switch (pm) {
|
|
@@ -8379,8 +8379,6 @@ function getInstallCommand(pm) {
|
|
|
8379
8379
|
return "pnpm add -D made-refine@beta";
|
|
8380
8380
|
case "yarn":
|
|
8381
8381
|
return "yarn add -D made-refine@beta";
|
|
8382
|
-
default:
|
|
8383
|
-
return "npm install -D made-refine@beta";
|
|
8384
8382
|
}
|
|
8385
8383
|
}
|
|
8386
8384
|
function installPackage(cwd) {
|
package/dist/index.d.mts
CHANGED
|
@@ -37,6 +37,7 @@ interface DirectEditContextValue extends DirectEditState {
|
|
|
37
37
|
updateBorderRadiusProperty: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
38
38
|
updateBorderProperty: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
39
39
|
updateBorderProperties: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
40
|
+
updateRawCSS: (properties: Record<string, string>) => void;
|
|
40
41
|
updateFlexProperty: (key: FlexPropertyKey, value: string) => void;
|
|
41
42
|
toggleFlexLayout: () => void;
|
|
42
43
|
updateSizingProperty: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -127,6 +128,7 @@ interface DirectEditPanelInnerProps {
|
|
|
127
128
|
onUpdateBorderRadius: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
128
129
|
onUpdateBorder: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
129
130
|
onBatchUpdateBorder: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
131
|
+
onSetCSS: (properties: Record<string, string>) => void;
|
|
130
132
|
onUpdateFlex: (key: 'flexDirection' | 'justifyContent' | 'alignItems', value: string) => void;
|
|
131
133
|
onToggleFlex: () => void;
|
|
132
134
|
onUpdateSizing: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -143,7 +145,7 @@ interface DirectEditPanelInnerProps {
|
|
|
143
145
|
onHeaderPointerMove?: (e: React.PointerEvent) => void;
|
|
144
146
|
onHeaderPointerUp?: (e: React.PointerEvent) => void;
|
|
145
147
|
}
|
|
146
|
-
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onSetCSS, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
147
149
|
declare function DirectEditPanel(): react_jsx_runtime.JSX.Element | null;
|
|
148
150
|
|
|
149
151
|
interface DirectEditToolbarInnerProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface DirectEditContextValue extends DirectEditState {
|
|
|
37
37
|
updateBorderRadiusProperty: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
38
38
|
updateBorderProperty: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
39
39
|
updateBorderProperties: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
40
|
+
updateRawCSS: (properties: Record<string, string>) => void;
|
|
40
41
|
updateFlexProperty: (key: FlexPropertyKey, value: string) => void;
|
|
41
42
|
toggleFlexLayout: () => void;
|
|
42
43
|
updateSizingProperty: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -127,6 +128,7 @@ interface DirectEditPanelInnerProps {
|
|
|
127
128
|
onUpdateBorderRadius: (key: BorderRadiusPropertyKey, value: CSSPropertyValue) => void;
|
|
128
129
|
onUpdateBorder: (key: BorderPropertyKey, value: BorderProperties[BorderPropertyKey]) => void;
|
|
129
130
|
onBatchUpdateBorder: (changes: Array<[BorderPropertyKey, BorderProperties[BorderPropertyKey]]>) => void;
|
|
131
|
+
onSetCSS: (properties: Record<string, string>) => void;
|
|
130
132
|
onUpdateFlex: (key: 'flexDirection' | 'justifyContent' | 'alignItems', value: string) => void;
|
|
131
133
|
onToggleFlex: () => void;
|
|
132
134
|
onUpdateSizing: (key: SizingPropertyKey, value: SizingValue) => void;
|
|
@@ -143,7 +145,7 @@ interface DirectEditPanelInnerProps {
|
|
|
143
145
|
onHeaderPointerMove?: (e: React.PointerEvent) => void;
|
|
144
146
|
onHeaderPointerUp?: (e: React.PointerEvent) => void;
|
|
145
147
|
}
|
|
146
|
-
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
declare function DirectEditPanelInner({ elementInfo, computedSpacing, computedBorderRadius, computedBorder, computedFlex, computedSizing, computedColor, computedTypography, pendingStyles, onClose, onSelectParent, onSelectChild, onUpdateSpacing, onUpdateBorderRadius, onUpdateBorder, onBatchUpdateBorder, onSetCSS, onUpdateFlex, onToggleFlex, onUpdateSizing, onUpdateColor, onUpdateTypography, onReset, onExportEdits, onSendToAgent, className, style, panelRef, isDragging, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, }: DirectEditPanelInnerProps): react_jsx_runtime.JSX.Element;
|
|
147
149
|
declare function DirectEditPanel(): react_jsx_runtime.JSX.Element | null;
|
|
148
150
|
|
|
149
151
|
interface DirectEditToolbarInnerProps {
|