install DoctrineFixturesBundle and doctrine-fixtures in Symfony 2.1.4 - doctrine-orm

I want to install and configure DoctrineFixturesBundle and doctrine-fixtures in Symfony 2.1.4. Can anyone give me a guide.

Your question may be already in answered in DoctrineFixturesBundle issues section, anyway I will summarize the steps to install and configure DoctrineFixturesBundle in symfony 2.1.4 version.
Step 1 :
Open the composer.json and append below code in require section. This file is located in root folder of the project
{
"require": {
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures": "dev-master"
}
}
Step 2:
Run below command in your terminal
php composer.phar update
Final Step:
append the below in your app/AppKernel.php
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
// ...
);
// ...
}
Hope it helps.

Related

Vendoring npm packages in deno

How does one vendor a npm package in deno?
import_map.json:
{
"imports": {
"lume/": "https://deno.land/x/lume#v1.12.1/",
}
}
Lume has some npm dependencies, like https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.0.tgz.
deno.jsonc:
{
"importMap": "import_map.json",
}
dev_deps.ts:
export * as lume from "https://deno.land/x/lume#v1.12.1/mod.ts";
command:
$ deno vendor --force --unstable dev_deps.ts
# ...
Download https://registry.npmjs.org/markdown-it-attrs/-/markdown-it-attrs-4.1.3.tgz
# ...
thread 'main' panicked at 'Could not find local path
for npm:markdown-it-attrs#4.1.3', cli/tools/vendor/mappings.rs:138:11
I tried adding export * as ma from "npm:markdown-it-attrs"; to dev_depts.ts, but it did nothing.
I found the following issue on github.
Maybe this issue does have something to do with it.
I didn't find anything about how to resolve the problem in the official deno documentation and the lume documentation.
Unfortunately, currently you cannot use import_map in your Deno project if your goal is to publish a module that aims to be used in other applications, simply because you don't handle the way deno runtime will start.
From the application point of view, the deno run command cannot search every import_map configurations in your dependencies and handle them properly.
The import_map feature should be used only at end application level.
The fallback is to use by onvention a deps.ts source file to centralize all your dependencies.

How do I get vite to build entire project instead of just the index.html page?

I am new to vite and I can't figure out how to get it to build my entire project instead of just my index.html page. I run "npm run build" and every time it just does that index.html but in npm run dev it works fine. I have all my files on the same level as in the picture. How do I resolve this problem?
Create a vite.config.js file at the root of project and put this in it
const { defineConfig } = require('vite')
module.exports = defineConfig({
build: {
rollupOptions: {
input: {
main: './index.html',
about: './about.html',
shaderOne: './shaderOne.html',
// ...
// List all files you want in your build
}
}
}
})
If not, you will need to install vite locally. You can install it using npm install vite
See this documentation

adonis issue: error: `migration:run` is not a registered command

I Have installed #adonisjs/lucid.
create a migration to use command
adonis make:migration task
** task code**
'use strict'
const Schema = use('Schema')
class TaskSchema extends Schema {
up() {
this.create('tasks', table => {
table.increments()
table.timestamps()
table.string('name')
table.text('description')
table.integer('project_id').unsigned()
table
.foreign('project_id')
.references('projects.id')
.onDelete('cascade')
})
}
down() {
this.drop('tasks')
}
}
module.exports = TaskSchema
i have run my migration to show this error
error: `migration:run` is not a registered command
**
i have not understand this bug. I know that if not install the
dependencies #adonisjs/lucid than show this error but After I
installed dependencies why the error occurred
**
What you need here is adonis/cli.
npm i -g #adonisjs/cli
But I think the you don't really need this extra dependencies. Using ace is enough
node ace make:migration task
Here is the solution to this question
In fact, I don’t need to install the CLI in production.
Run your server with node server.js and execute internal commands with node ace XXX.
node ace migration:run --force

Edit the make:entity command

I would like to edit the make:entity command provided by the MakerBundle in Symfony 4.
Here is an explaination : the command adds the field Id by default in each entity. I would like automatically add other fields. That is why I want to edit the make:entity command.
I can also create a new Bundle that adds a new command like my:make:entity. But if I add a new command, I don't want that make:entity still usable anymore. I have an OpenSource project and I don't want somemone to use the old make:entity command. So, if I can't edit the make:entity command, can I deactivate it ?
Thank you in advance,
Vincent
You can fork the github repository from :
https://github.com/symfony/maker-bundle
and then make any modifications you like, commit and push to your fork.
Then you need to tell composer to use your fork instead of the official repo by adding a "repositories" section to the end of your composer.json file
"repositories": [
{
"type": "vcs",
"url": "https://github.com/[your github]/maker-bundle"
}
],
I hope this helps.

Module <rootDir>/node_modules/vue-jest in the transform option was not found

I got an error and I need your help. Thank for watching this question.
My situation: I am configuring Drone CI tool for my project and I get this when I run unit test on drone.yml.
Validation Error:
Module <rootDir>/node_modules/vue-jest in the transform option was not found.
Configuration Documentation:
https://jestjs.io/docs/configuration.html
Here is my jest.conf.js
transform: {
"^.+\\.js$": "babel-jest",
".*\\.vue$": "<rootDir>/node_modules/vue-jest"
},
What I have tried:
Remove <rootDir>/node_modules/. But I got an another error Module vue-jest in the transform option was not found.. So I think it is not the right solution
npm install --save-dev vue-jest
and rerun your test
Take a note that vue-jest is currently (2022) distributed in 3 concurrent packages:
vue-jest
#vue/vue2-jest
#vue/vue3-jest
In my case I've upgraded some dependencies and I had to switch from vue-jest to #vue/vue3-jest.
So my jest.config.js has to change accordingly:
module.exports = {
...
transform: {
"^.+\\.vue$": "#vue/vue3-jest",
},
...
}