Replies: 6 comments
-
@AdrianMoraRodriguez @PSantanaGlez13, @coromoto En Babel usan Lerna para la administración del monorepo y su publicación (vean por ejemplo Me parece que una aproximación simple para la publicación podría ser crear un nuevo monorepo simplificado con sólo dos packages:
y publicaríamos los dos paquetes. Luego para compilar se supone que esta instalado const myPlugin = require("support-plugin");
const parse = require("custom-fork-of-babel-parser-on-npm-here");
module.exports = {
plugins: [
{
parserOverride(code, opts) {
return parse(code, opts);
},
},
],
}; y en la configuración añadimos el plugin. ¿Que problemas le ven a esta aproximación? ¿Alternativas? Algunas Referencias sobre Lerna
|
Beta Was this translation helpful? Give feedback.
-
@AdrianMoraRodriguez |
Beta Was this translation helpful? Give feedback.
-
@crguezl @AdrianMoraRodriguez Intentándolo publicar me he encontrado con este mensaje: sombra@P:~/projects/left-side-JS/babel-tanhauhau$ yarn lerna publish from-package
yarn run v1.22.22
$ /home/sombra/projects/left-side-JS/babel-tanhauhau/node_modules/.bin/lerna publish from-package
lerna notice cli v3.19.0
lerna WARN Yarn's registry proxy is broken, replacing with public npm registry
lerna WARN If you don't have an npm token, you should exit and run `npm login`
lerna WARN Unable to determine published version, assuming "@ull-esit-pl/parser-left-side" unpublished.
lerna WARN Unable to determine published version, assuming "@ull-esit-pl/babel-plugin-left-side-plugin" unpublished.
lerna WARN Unable to determine published version, assuming "@ull-esit-pl/babel-plugin-left-side-support" unpublished.
Found 3 packages to publish:
- @ull-esit-pl/parser-left-side => 1.0.0
- @ull-esit-pl/babel-plugin-left-side-plugin => 1.0.0
- @ull-esit-pl/babel-plugin-left-side-support => 1.0.0
? Are you sure you want to publish these packages? Yes
lerna info publish Publishing packages to npm...
lerna info Verifying npm credentials
lerna http fetch GET 200 https://registry.npmjs.org/-/npm/v1/user 629ms
lerna http fetch GET 200 https://registry.npmjs.org/-/org/psantanaglez13/package?format=cli 263ms
lerna WARN The logged-in user does not have any previously-published packages, skipping permission checks...
lerna info Checking two-factor auth mode
lerna http fetch GET 200 https://registry.npmjs.org/-/npm/v1/user 621ms
lerna http fetch PUT 404 https://registry.npmjs.org/@ull-esit-pl%2fbabel-plugin-left-side-support 316ms
lerna ERR! E404 Not found
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. El problema parece ser que al no estar en la organización de npm de @ULL-ESIT-PL no puedo publicar paquetes en ella. ¿Podría tener permisos para publicar en ella? Alternativamente, se puede crear otra organización, usar mi propio usuario o publicar en el registro de GitHub. |
Beta Was this translation helpful? Give feedback.
-
@PSantanaGlez13 @AdrianMoraRodriguez Ahora son miembros de la organización. Deberían poder publicar paquetes en la org de GitHub y en npm |
Beta Was this translation helpful? Give feedback.
-
@crguezl @AdrianMoraRodriguez También descubrí porque no me funcionaba con la versión "más actualizada" de Babel el |
Beta Was this translation helpful? Give feedback.
-
@PSantanaGlez13 @AdrianMoraRodriguez @coromoto I have doubts about where is the best way to provide the instructions about the published packages, so I have asked v0: QuestionWhen publishing packages from a monorepo in the GitHub registry, what is the policy of the registry about the README.md of the package? I noticed that by default the GitHub registry uses the root README.md as the documentation. If we write a README.md inside the package folder, will it be referenced as the README.md documentation of the package by the GitHub registry? v0 (edited) AnswerWhen it comes to publishing packages from a monorepo to package registries, including the GitHub registry, the handling of README.md files can indeed be a bit tricky. Here's what I can tell you based on general practices:
To make sure the GitHub registry uses the package-specific README.md instead of the root one, you should:
It's worth noting that the exact behavior might depend on how you're publishing your packages and what tools you're using (like Changesets, Lerna, or custom scripts) . If you're still experiencing issues with the GitHub registry not using the package-specific README.md, you might want to check your publishing configuration and ensure that the README.md is being correctly included in the published package contents. |
Beta Was this translation helpful? Give feedback.
-
@AdrianMoraRodriguez @PSantanaGlez13
No tengo claro que sea sencillo como publicar babel ya que es un monorepo con un montón de packages.
Tenemos que hablarlo.
Por lo pronto mover el plugin a la zona de packages e ir aprendiendo como es el proceso de publicación del monorepo.
Beta Was this translation helpful? Give feedback.
All reactions