@jsonpages/cli 3.0.59 → 3.0.60
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/assets/src_tenant_alpha.sh +15 -15
- package/package.json +1 -1
- package/src/index.js +16 -7
|
@@ -3117,26 +3117,26 @@ const UploadableImage = Image.extend({
|
|
|
3117
3117
|
...this.parent?.(),
|
|
3118
3118
|
uploadId: {
|
|
3119
3119
|
default: null,
|
|
3120
|
-
parseHTML: (element) => element.getAttribute('data-upload-id'),
|
|
3121
|
-
renderHTML: (attributes) =>
|
|
3120
|
+
parseHTML: (element: HTMLElement) => element.getAttribute('data-upload-id'),
|
|
3121
|
+
renderHTML: (attributes: Record<string, unknown>) =>
|
|
3122
3122
|
attributes.uploadId ? { 'data-upload-id': String(attributes.uploadId) } : {},
|
|
3123
3123
|
},
|
|
3124
3124
|
uploading: {
|
|
3125
3125
|
default: false,
|
|
3126
|
-
parseHTML: (element) => element.getAttribute('data-uploading') === 'true',
|
|
3127
|
-
renderHTML: (attributes) =>
|
|
3126
|
+
parseHTML: (element: HTMLElement) => element.getAttribute('data-uploading') === 'true',
|
|
3127
|
+
renderHTML: (attributes: Record<string, unknown>) =>
|
|
3128
3128
|
attributes.uploading ? { 'data-uploading': 'true' } : {},
|
|
3129
3129
|
},
|
|
3130
3130
|
uploadError: {
|
|
3131
3131
|
default: false,
|
|
3132
|
-
parseHTML: (element) => element.getAttribute('data-upload-error') === 'true',
|
|
3133
|
-
renderHTML: (attributes) =>
|
|
3132
|
+
parseHTML: (element: HTMLElement) => element.getAttribute('data-upload-error') === 'true',
|
|
3133
|
+
renderHTML: (attributes: Record<string, unknown>) =>
|
|
3134
3134
|
attributes.uploadError ? { 'data-upload-error': 'true' } : {},
|
|
3135
3135
|
},
|
|
3136
3136
|
awaitingUpload: {
|
|
3137
3137
|
default: false,
|
|
3138
|
-
parseHTML: (element) => element.getAttribute('data-awaiting-upload') === 'true',
|
|
3139
|
-
renderHTML: (attributes) =>
|
|
3138
|
+
parseHTML: (element: HTMLElement) => element.getAttribute('data-awaiting-upload') === 'true',
|
|
3139
|
+
renderHTML: (attributes: Record<string, unknown>) =>
|
|
3140
3140
|
attributes.awaitingUpload ? { 'data-awaiting-upload': 'true' } : {},
|
|
3141
3141
|
},
|
|
3142
3142
|
};
|
|
@@ -3184,7 +3184,7 @@ const updateImageByUploadId = (
|
|
|
3184
3184
|
patch: Record<string, unknown>
|
|
3185
3185
|
): boolean => {
|
|
3186
3186
|
let targetPos: number | null = null;
|
|
3187
|
-
editor.state.doc.descendants((node, pos) => {
|
|
3187
|
+
editor.state.doc.descendants((node: { type: { name: string }; attrs?: Record<string, unknown> }, pos: number) => {
|
|
3188
3188
|
if (node.type.name === 'image' && node.attrs?.uploadId === uploadId) {
|
|
3189
3189
|
targetPos = pos;
|
|
3190
3190
|
return false;
|
|
@@ -3338,7 +3338,7 @@ const StudioTiptapEditor: React.FC<{ data: TiptapData }> = ({ data }) => {
|
|
|
3338
3338
|
class:
|
|
3339
3339
|
'prose prose-invert max-w-none min-h-[220px] rounded-lg border border-zinc-800 bg-zinc-950/60 p-4 text-zinc-100 outline-none',
|
|
3340
3340
|
},
|
|
3341
|
-
handleDrop: (_view, event) => {
|
|
3341
|
+
handleDrop: (_view: unknown, event: DragEvent) => {
|
|
3342
3342
|
const file = event.dataTransfer?.files?.[0];
|
|
3343
3343
|
if (!file || !file.type.startsWith('image/') || !assets?.onAssetUpload) return false;
|
|
3344
3344
|
event.preventDefault();
|
|
@@ -3351,8 +3351,8 @@ const StudioTiptapEditor: React.FC<{ data: TiptapData }> = ({ data }) => {
|
|
|
3351
3351
|
})();
|
|
3352
3352
|
return true;
|
|
3353
3353
|
},
|
|
3354
|
-
handlePaste: (_view, event) => {
|
|
3355
|
-
const file = Array.from(event.clipboardData?.files ?? []).find((f) =>
|
|
3354
|
+
handlePaste: (_view: unknown, event: ClipboardEvent) => {
|
|
3355
|
+
const file = Array.from(event.clipboardData?.files ?? []).find((f: File) =>
|
|
3356
3356
|
f.type.startsWith('image/')
|
|
3357
3357
|
);
|
|
3358
3358
|
if (!file || !assets?.onAssetUpload) return false;
|
|
@@ -3366,7 +3366,7 @@ const StudioTiptapEditor: React.FC<{ data: TiptapData }> = ({ data }) => {
|
|
|
3366
3366
|
})();
|
|
3367
3367
|
return true;
|
|
3368
3368
|
},
|
|
3369
|
-
handleClickOn: (_view, _pos, node) => {
|
|
3369
|
+
handleClickOn: (_view: unknown, _pos: number, node: { type: { name: string }; attrs?: Record<string, unknown> }) => {
|
|
3370
3370
|
if (node.type.name !== 'image') return false;
|
|
3371
3371
|
if (node.attrs?.awaitingUpload !== true) return false;
|
|
3372
3372
|
const uploadId = typeof node.attrs?.uploadId === 'string' ? node.attrs.uploadId : null;
|
|
@@ -3376,14 +3376,14 @@ const StudioTiptapEditor: React.FC<{ data: TiptapData }> = ({ data }) => {
|
|
|
3376
3376
|
return true;
|
|
3377
3377
|
},
|
|
3378
3378
|
},
|
|
3379
|
-
onUpdate: ({ editor: currentEditor }) => {
|
|
3379
|
+
onUpdate: ({ editor: currentEditor }: { editor: Editor }) => {
|
|
3380
3380
|
const markdown = getEditorMarkdown(currentEditor);
|
|
3381
3381
|
emitInlineUpdate(markdown);
|
|
3382
3382
|
},
|
|
3383
3383
|
onFocus: () => {
|
|
3384
3384
|
setFocusLock(true);
|
|
3385
3385
|
},
|
|
3386
|
-
onBlur: ({ editor: currentEditor }) => {
|
|
3386
|
+
onBlur: ({ editor: currentEditor }: { editor: Editor }) => {
|
|
3387
3387
|
const markdown = getEditorMarkdown(currentEditor);
|
|
3388
3388
|
if (markdown !== latestEmittedMarkdownRef.current) {
|
|
3389
3389
|
emitInlineUpdate(markdown);
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -134,14 +134,23 @@ program
|
|
|
134
134
|
await processScriptInNode(scriptPath, targetDir);
|
|
135
135
|
spinner.succeed('Source code and assets projected successfully.');
|
|
136
136
|
|
|
137
|
-
// 5. DEPENDENCY RESOLUTION (
|
|
137
|
+
// 5. DEPENDENCY RESOLUTION (SOT: apps/tenant-alpha/package.json; fallback: @jsonpages/stack)
|
|
138
138
|
spinner.start('Installing dependencies (this may take a minute)...');
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
const sotPath = path.resolve(process.cwd(), 'apps', 'tenant-alpha', 'package.json');
|
|
140
|
+
let depSpecs = [];
|
|
141
|
+
let devDepSpecs = [];
|
|
142
|
+
if (await fs.pathExists(sotPath)) {
|
|
143
|
+
const sot = await fs.readJson(sotPath);
|
|
144
|
+
depSpecs = Object.entries(sot.dependencies || {}).map(([n, v]) => `${n}@${v}`);
|
|
145
|
+
devDepSpecs = Object.entries(sot.devDependencies || {}).map(([n, v]) => `${n}@${v}`);
|
|
146
|
+
}
|
|
147
|
+
if (depSpecs.length === 0 && devDepSpecs.length === 0) {
|
|
148
|
+
const stack = (await import('@jsonpages/stack')).default;
|
|
149
|
+
depSpecs = Object.entries(stack.dependencies || {}).map(([name, ver]) => `${name}@${ver}`);
|
|
150
|
+
devDepSpecs = Object.entries(stack.devDependencies || {}).map(([name, ver]) => `${name}@${ver}`);
|
|
151
|
+
}
|
|
152
|
+
if (depSpecs.length > 0) await execa(npmCmd, ['install', ...depSpecs], { cwd: targetDir });
|
|
153
|
+
if (devDepSpecs.length > 0) await execa(npmCmd, ['install', '-D', ...devDepSpecs], { cwd: targetDir });
|
|
145
154
|
|
|
146
155
|
spinner.succeed(chalk.green.bold('✨ Tenant Ready!'));
|
|
147
156
|
|