@pulse-editor/cli 0.1.1-beta.23 → 0.1.1-beta.24

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.
@@ -59,7 +59,9 @@ export default function Create({ cli }) {
59
59
  if (projectName) {
60
60
  // Check if the project already exists
61
61
  const projectPath = path.join(process.cwd(), projectName);
62
- if (fs.existsSync(projectPath)) {
62
+ if (fs.existsSync(projectPath) &&
63
+ fs.lstatSync(projectPath).isDirectory() &&
64
+ fs.readdirSync(projectPath).length > 0) {
63
65
  setErrorMessage(_jsx(Text, { color: "redBright", children: "\u274C A project with same name already exists in current path." }));
64
66
  setTimeout(() => {
65
67
  exit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulse-editor/cli",
3
- "version": "0.1.1-beta.23",
3
+ "version": "0.1.1-beta.24",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "pulse": "dist/cli.js"
@@ -1 +0,0 @@
1
- export declare function loadAndCall(func: string, req: Request): Promise<Response>;
@@ -1,23 +0,0 @@
1
- /* This folder contains temporary code to be moved to a different package in the future. */
2
- // @ts-expect-error ignore ts error
3
- import { createInstance } from '@module-federation/runtime';
4
- import { performReload } from '@module-federation/node/utils';
5
- import { readConfigFile } from '../../utils.js';
6
- export async function loadAndCall(func, req) {
7
- const pulseConfig = await readConfigFile();
8
- await performReload(true);
9
- // here we assign the return value of the init() function, which can be used to do some more complex
10
- // things with the module federation runtime
11
- const instance = createInstance({
12
- name: 'preview_host',
13
- remotes: [
14
- {
15
- name: pulseConfig.id + '_server',
16
- entry: `http://localhost:3030/.server-function/remoteEntry.js`,
17
- },
18
- ],
19
- });
20
- const loadedFunc = (await instance.loadRemote(`${pulseConfig.id}_server/${func}`)).default;
21
- const res = await loadedFunc(req);
22
- return res;
23
- }