Ayho
Ayho
Explore posts from servers
DDeno
Created by Ayho on 3/10/2025 in #help
Lume CMS
Hello, I have an issue when I want to deploy Lume CMS with deno deploy. I have my lume CMS storage config set to the src folder and I followed the documentation steps here https://lume.land/cms/deployment/deno-deploy/ the CMS is live but when. I want to edit the data, it doesn't edit in the src folder but in the root folder. Is it normal? Here is my cms file
const cms = lumeCMS({
auth: {
method: "basic",
users: {
[Deno.env.get("USERNAME") || "admin"]: Deno.env.get("PASSWORD") || "password",
},
},
});

cms.upload({
name: "images",
description: "",
store: "src:images",
});

cms.storage(
"src",
new GitHub({
client: new Octokit({ auth: Deno.env.get("GITHUB_TOKEN") }),
owner: "{{myname}}",
repo: "{{myrepo}}",
branch: "main",
}),
)

export default cms;
const cms = lumeCMS({
auth: {
method: "basic",
users: {
[Deno.env.get("USERNAME") || "admin"]: Deno.env.get("PASSWORD") || "password",
},
},
});

cms.upload({
name: "images",
description: "",
store: "src:images",
});

cms.storage(
"src",
new GitHub({
client: new Octokit({ auth: Deno.env.get("GITHUB_TOKEN") }),
owner: "{{myname}}",
repo: "{{myrepo}}",
branch: "main",
}),
)

export default cms;
I don't know if the _config.ts is necessary for this but I set up the lume options like this const site = lume({ src: "./src", }); my entrypoint is _cms.ts on deno deploy Thanks in advance!
3 replies
NNuxt
Created by Ayho on 2/12/2025 in #❓・help
Test plugin of useNuxtApp vitest
Hello all, I don't know how to test one of my services I pass through useNuxtApp. I use @nuxt/test-utils and my component got a const { $someService } = useNuxtApp(); and in my test I want to mock it and try like this
const { useNuxtAppMock } = vi.hoisted(() => {
return {
useNuxtAppMock: vi.fn(() => {
return {
$someService: {
doSmth: vi.fn(),
},
};
}),
};
});
mockNuxtImport('useNuxtApp', () => {
return useNuxtAppMock;
});
const { useNuxtAppMock } = vi.hoisted(() => {
return {
useNuxtAppMock: vi.fn(() => {
return {
$someService: {
doSmth: vi.fn(),
},
};
}),
};
});
mockNuxtImport('useNuxtApp', () => {
return useNuxtAppMock;
});
I get this error : [vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file What am I doing wrong ?
6 replies