Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

log.exportResolvedPaths { local_options } #19

Open
GHNewbiee opened this issue Aug 8, 2020 · 3 comments
Open

log.exportResolvedPaths { local_options } #19

GHNewbiee opened this issue Aug 8, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@GHNewbiee
Copy link

GHNewbiee commented Aug 8, 2020

A problem which I usually face, and probably other users, too, is the correct declaration of relative paths, especially of those ones which are related to foreign packages/modules config options.

I suggest a new option to be created; the log.exportResolvedPaths one, which records all resolved options paths in a user friendly form such as:

relative_file_path, absolute_file_path, Option.property_name, relative_path_set, ABOSLUTE_PATH_resolved

and exports them either to the terminal or to a file.

local_options would include properties such as:

include, exclude, columnsDisplayed: string[], exportTo: terminal|'path_to_log_file'

Moreover, showResponseTime option would also be moved under the log option as log.showResponseTime.

Additional notes:

  • Instead of an option, it could be a plugin.
  • A maxFilesNo property may be set, to control the files per directory that are exported when regex is used.
@sarsamurmu
Copy link
Owner

Can you describe it more with example configurations?

@GHNewbiee
Copy link
Author

GHNewbiee commented Aug 8, 2020

Note: I have added additional notes in the first message.

Yes, of course. For example:

start({
  rootDir: process.cwd(),
  cacheDir: './.reboost_cache',
  entries: [
    ['./src/index.js', './public/dist/index.js']
  ],
  contentServer: {
    root: './public'
    },
    index: 'index.html'
  },
  resolve: {
    alias: {
      ConfigFiles: './.config_files',
      Public: './public',
      Src: './src'
    },
  },
  sourceMaps: {
    include: /.*/,
    exclude: /node_modules/
  },
  watchOptions: {
    include: /.*/,
    exclude: /\..*|node_modules|.*.json|.*.code-workspace|reboost.js/,
    chokidar: {
      cwd: process.cwd()
      }
    }
  },
  plugins: [
    UsePlugin({
      include: /.(png|jpg|jpeg)$/i,
      exclude: /.*/,
      use: FilePlugin()
    }),
    UsePlugin({
      include: /.*/,
      exclude: /node_modules/,
      use: BabelPlugin()
    }),
    CSSPlugin({
      modules: {
        test: /\.module\./i
      }
    })
  ]
})

When

  log.exportResolvedPaths: {
    include: /.*/,
    exclude: /node_modules/,
    columnsDisplayed: ['relative_file_path', 'absolute_file_path', 'Option.property_name', 'relative_path_set', 'ABOSLUTE_PATH_resolved'],
    exportTo: 'terminal',
    maxFilesNo: 5
  }

then, the following should be given:

relative_file_path absolute_file_path Option.property_name relative_path_set ABOSLUTE_PATH_resolved
./reboost.js /home/... /project/reboot.js rootDir ./ /home/... /project/
"-" "-" cacheDir ./.reboost_cache/ /home/... /project/.reboost_cache/
"-" "-" contentServer.root ./public/ /home/... /project/public/
"-" "-" contentServer.index ./public/index.html /home/... /project/public/index.html
"-" "-" resolve.alias.ConfigFiles ./.config_files/ /home/... /project/.config_files/
"-" "-" resolve.alias.Public ./public/ /home/... /project/public/
"-" "-" resolve.alias.Src ./src/ /home/... /project/src/
"-" "-" sourceMaps.include The first 5 files per directory The first 5 files per directory
"-" "-" sourceMaps.exclude ./node_modules/ /home/... /project/node_modules/
... ... ... ... ...
"-" "-" watchOptions.chokidar.cwd ./ /home/... /project/
... ... ... ... ...

This should also include imports and requires from every single file; for example:
test.js

import { a, b } from './.../tester'
...
relative_file_path absolute_file_path Option.property_name relative_path_set ABOSLUTE_PATH_resolved
./.../test.js /home/... /project/.../test.js a, b ./.../tester.js /home/... /project/.../tester.js

@sarsamurmu sarsamurmu added the enhancement New feature or request label Aug 9, 2020
@GHNewbiee
Copy link
Author

We do not really need it, too! You may keep it as a low priority feature in future when all other high priorities will have been settled down and you'll wonder what else small features can be added to "improve/develop" the project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants