mirror of
https://github.com/grafana/grafana.git
synced 2025-01-21 22:13:38 -06:00
Chore: Prevent direct path imports from workspace grafana packages (#98940)
* restrict imports from @grafana/ui/src paths * prevent path imports from all grafana packages * just run on ui, runtime, data packages * update
This commit is contained in:
parent
1dcff0a71f
commit
e3e580edfa
@ -86,6 +86,10 @@ module.exports = [
|
|||||||
importNames: ['Layout', 'HorizontalGroup', 'VerticalGroup'],
|
importNames: ['Layout', 'HorizontalGroup', 'VerticalGroup'],
|
||||||
message: 'Use Stack component instead.',
|
message: 'Use Stack component instead.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
group: ['@grafana/ui/src/*', '@grafana/runtime/src/*', '@grafana/data/src/*'],
|
||||||
|
message: 'Import from the public export instead.',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
1254
.betterer.results
1254
.betterer.results
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-check
|
||||||
const { parse } = require('ini');
|
const { parse } = require('ini');
|
||||||
const { readFileSync, existsSync } = require('node:fs');
|
const { readFileSync, existsSync } = require('node:fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
@ -18,14 +19,17 @@ const getEnvConfig = () => {
|
|||||||
const custom = parse(customSettings);
|
const custom = parse(customSettings);
|
||||||
|
|
||||||
const merged = { ...defaults.frontend_dev, ...custom.frontend_dev };
|
const merged = { ...defaults.frontend_dev, ...custom.frontend_dev };
|
||||||
|
|
||||||
// Take all frontend keys from the ini file and prefix with `frontend_dev_`,
|
// Take all frontend keys from the ini file and prefix with `frontend_dev_`,
|
||||||
// so they can be added to `process.env` elsewhere
|
// so they can be added to `process.env` elsewhere
|
||||||
return Object.entries(merged).reduce((acc, [key, value]) => {
|
/** @type {Record<string, unknown>} */
|
||||||
return {
|
const env = {};
|
||||||
...acc,
|
|
||||||
[`frontend_dev_${key}`]: value,
|
for (const [key, value] of Object.entries(merged)) {
|
||||||
};
|
env[`frontend_dev_${key}`] = value;
|
||||||
}, {});
|
}
|
||||||
|
|
||||||
|
return env;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = getEnvConfig;
|
module.exports = getEnvConfig;
|
||||||
|
Loading…
Reference in New Issue
Block a user