el-ojo-de-iberoamerica-common
v3.32.2
Published
Common components for El Ojo de Iberoamérica
Keywords
Readme
El Ojo de Iberoamérica - Common
Shared components and utilities for the El Ojo de Iberoamérica apps (inscriptions, contests, content, voting).
Conventions, branching and code style live in
CONTRIBUTING.md; notable changes are logged in
CHANGELOG.md.
Publish a new version
- Bump
versioninpackage.json. yarn build-lib.npm publish.- In the consuming app, bump the same version in its
package.jsonand runyarn install.
Local development against a consumer app
The build is rollup-based and react / react-dom are marked external, so the consumer always loads its own React copy. Setup is just two yarn link calls.
One-time link
# In this repo
cd {common_dir}
yarn link
# In the consumer app (inscriptions / contests / tracking)
cd {app_dir}
yarn link "el-ojo-de-iberoamerica-common"Daily loop
Two terminals:
# Terminal 1 — rebuild dist/ on every source change
cd {common_dir}
yarn watch-lib
# Terminal 2 — normal dev server in the consumer app
cd {app_dir}
yarn devEdit anything under src/ → rollup rewrites dist/index.es.js → Next.js HMR picks up the file change in the consumer. No version bumps, no yarn install between iterations.
Unlink when you're done
cd {app_dir}
yarn unlink "el-ojo-de-iberoamerica-common"
yarn install --check-filesThat restores the published version from the npm registry.
The previous version of this README walked through a 13-step
yarn linkrecipe that also linkedreactandreact-domfrom the consumer app'snode_modules. That dance was needed beforerollup.config.jsmarked React external and before the consumer app wirednext-transpile-modulesfor this package — neither is needed anymore. If you still hit "Invalid hook call" or duplicate-React warnings, runyarn install --check-filesin the consumer app to refresh its lockfile.
