CartoDB / carto-react-template

CARTO for React. The best way to develop Location Intelligence (LI) Apps usign CARTO platform and React
https://sample-app-react.carto.com
MIT License
39 stars 26 forks source link

Unnessary files included in the npm package #230

Closed jtmiclat closed 3 years ago

jtmiclat commented 3 years ago

I used the latest version of template via the following command

npx create-react-app ui --template @carto/cra-template

This generated the app but 3 files are generated that are also included in .gitignore.

config-overrides.js

$ head config-overrides.js 
/* config-overrides.js */
const path = require('path');

module.exports = function override(config, env) {
  const newConfig = config;

  newConfig.resolve.alias = {
    ...newConfig.resolve.alias,
    react: path.resolve('./node_modules/react'),
    'react-redux': path.resolve('./node_modules/react-redux'),

.eslintcache

$ head .eslintcache
[
    {
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/index.js": "1",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/App.js": "2",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/store/store.js": "3",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/store/initialStateSlice.js": "4",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/routes.js": "5",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/store/appSlice.js": "6",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/components/common/Header.js": "7",
        "/Users/victor/dev/carto-react-template/template-skeleton/template/src/components/views/login/Login.js": "8",

package.dev.json

$ head package.dev.json 
{
  "name": "carto-for-react",
  "version": "1.0.2",
  "private": true,
  "dependencies": {
    "@carto/react-api": "1.0.1",
    "@carto/react-auth": "1.0.1",
    "@carto/react-basemaps": "1.0.1",
    "@carto/react-core": "1.0.1",
    "@carto/react-redux": "1.0.1",

I'm dont think any of these should have been included. The template still works so this is a minor annoyance.

You can check the files are included via the following link https://registry.npmjs.org/@carto/cra-template/-/cra-template-1.0.2.tgz

borja-munoz commented 3 years ago

Fixed in the latest version released today (1.1). We have removed package.dev.json and .eslintcache but we have kept config_overrides.js and remove it from .gitignore because it is useful in some cases where you want to link the template to a specific library branch.