实现小游戏与小程序项目创建发布
This commit is contained in:
@@ -5,6 +5,7 @@ import { join } from 'node:path';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { handleWorksRoutes } from '@electron/api/routes/works';
|
||||
import { createProjectConfig } from '../../shared/project-config';
|
||||
|
||||
const readWorksPublishFileMock = vi.hoisted(() => vi.fn());
|
||||
const readWorksDeployCheckMock = vi.hoisted(() => vi.fn());
|
||||
@@ -57,6 +58,12 @@ function createRequest(method: string, body?: unknown, headers: Record<string, s
|
||||
|
||||
async function writePublishableProject(projectPath: string): Promise<void> {
|
||||
await mkdir(join(projectPath, 'src'), { recursive: true });
|
||||
await mkdir(join(projectPath, '.niancode'), { recursive: true });
|
||||
await writeFile(
|
||||
join(projectPath, '.niancode', 'project.json'),
|
||||
JSON.stringify(createProjectConfig('2026-08-09T00:00:00.000Z', 'mini_game')),
|
||||
'utf8',
|
||||
);
|
||||
await writeFile(join(projectPath, 'package.json'), JSON.stringify({
|
||||
name: 'space-cleaner',
|
||||
private: true,
|
||||
|
||||
Reference in New Issue
Block a user