pook1574
pook1574
NNuxt
Created by pook1574 on 10/7/2024 in #❓・help
Why don't I have access to Pinia when I try to pull types?
Why is it necessary to download pinia separately when using the nuxt module for it? Isn't that the point of the modules, to buddle dependencies? @cuebit
8 replies
NNuxt
Created by pook1574 on 10/7/2024 in #❓・help
Why don't I have access to Pinia when I try to pull types?
I tried running npm i pinia -f but it seemed to have broke some stuff and did not work correctly etither
8 replies
NNuxt
Created by pook1574 on 10/7/2024 in #❓・help
Why don't I have access to Pinia when I try to pull types?
8 replies
NNuxt
Created by pook1574 on 10/7/2024 in #❓・help
Why don't I have access to Pinia when I try to pull types?
I'v tried this solution , adding an alias to my config... but this didn't work
alias: {
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
}
alias: {
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
}
8 replies
NNuxt
Created by pook1574 on 10/3/2024 in #❓・help
Repository Pattern implementation attempt
I did, It was a great video. I used a lot of the logic in this video, along with a couple of articles like - https://medium.com/@luizzappa/nuxt-3-repository-pattern-organising-and-managing-your-calls-to-apis-with-typescript-acd563a4e046
7 replies
NNuxt
Created by pook1574 on 10/3/2024 in #❓・help
Repository Pattern implementation attempt
If any of you have a more simple solution I would love to hear it
7 replies
NNuxt
Created by pook1574 on 10/3/2024 in #❓・help
Repository Pattern implementation attempt
I also made a plugin like this
import { PortalRepository } from "@/repository/modules/portal/PortalRepository";

export default defineNuxtPlugin(() => {
const api = {
portal: new PortalRepository(),
// Add more repositories here as needed
};
return {
provide: {
api,
},
};
});

import { PortalRepository } from "@/repository/modules/portal/PortalRepository";

export default defineNuxtPlugin(() => {
const api = {
portal: new PortalRepository(),
// Add more repositories here as needed
};
return {
provide: {
api,
},
};
});

7 replies
NNuxt
Created by pook1574 on 10/3/2024 in #❓・help
Repository Pattern implementation attempt
I was hoping if someone had experience implementing a repository pattern in nuxt might give me some feedback on this before I run with it... see any future set backs with using this?
7 replies
NNuxt
Created by pook1574 on 10/3/2024 in #❓・help
Repository Pattern implementation attempt
I read a few articles and watched some videos... and used the heck out chat GPT and this is what I came up with for a repository pattern base class, a class that endpoint specific classes can inherit ... like-this

import type { IPortalCard } from "@/types/portal/IPortalCard";
import { BaseRepository } from "@/repository/BaseRepository";
import { SERVER } from "@/repository/ApiEnum";
import FindServer from "@/repository/BaseURL";

export class PortalRepository extends BaseRepository<IPortalCard> {
protected baseUrl = `${FindServer.getApiUrl(SERVER.DJANGO)}portal-cards`;
}

import type { IPortalCard } from "@/types/portal/IPortalCard";
import { BaseRepository } from "@/repository/BaseRepository";
import { SERVER } from "@/repository/ApiEnum";
import FindServer from "@/repository/BaseURL";

export class PortalRepository extends BaseRepository<IPortalCard> {
protected baseUrl = `${FindServer.getApiUrl(SERVER.DJANGO)}portal-cards`;
}
7 replies
NNuxt
Created by pook1574 on 9/27/2024 in #❓・help
nuxt/storybook does not work
How is that configurable in a Nuxt project? this is the only documentation I found on shamefully-hoist , but its not clear to me how to apply it https://nuxt.com/docs/api/nuxt-config#hoist. @danielroe , would I make a .npmrc file and set shamefully-hoist=true ? If so, I did that and the same issue came up in console.
3 replies