@procore/core-scripts 11.10.4 → 11.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint/config.js +1 -0
- package/dist/eslint/config.js.map +1 -1
- package/dist/eslint/hack.js +48 -0
- package/dist/eslint/hack.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/eslint/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/eslint/config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/eslint/config.ts"],"names":[],"mappings":";;;AACA,kBAAe;AAEf,SAAgB,kBAAkB;IAChC,OAAO;QACL,OAAO,EAAE,wBAAwB;KAClC,CAAA;AACH,CAAC;AAJD,gDAIC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path = tslib_1.__importStar(require("path"));
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
// This fix works for ESLint 7.x || 8.x
|
|
7
|
+
// In the next major version of eslint this fix should be tested that it still works
|
|
8
|
+
const eslintrcFolder = path.dirname(require.resolve('@eslint/eslintrc/package.json'));
|
|
9
|
+
const eslintrcBundlePath = path.join(eslintrcFolder, 'dist/eslintrc.cjs');
|
|
10
|
+
function checkEslintConfigInPackageJson(path) {
|
|
11
|
+
let packageJson;
|
|
12
|
+
try {
|
|
13
|
+
// eslint-disable-next-line import/no-dynamic-require,global-require
|
|
14
|
+
packageJson = require(path);
|
|
15
|
+
// eslint-disable-next-line no-empty
|
|
16
|
+
}
|
|
17
|
+
catch (e) { }
|
|
18
|
+
if (packageJson) {
|
|
19
|
+
return ((packageJson.dependencies &&
|
|
20
|
+
'@procore/eslint-config' in packageJson.dependencies) ||
|
|
21
|
+
(packageJson.devDependencies &&
|
|
22
|
+
'@procore/eslint-config' in packageJson.devDependencies));
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const cwd = fs_1.default.realpathSync(process.cwd());
|
|
27
|
+
const packageJsonPath = path.resolve(cwd, 'package.json');
|
|
28
|
+
const hasProcoreEslintConfigInPackageJson = checkEslintConfigInPackageJson(packageJsonPath);
|
|
29
|
+
const rootPackageJsonPath = path.resolve(cwd, '../..', 'package.json');
|
|
30
|
+
const hasProcoreEslintConfigInRootPackageJson = checkEslintConfigInPackageJson(rootPackageJsonPath);
|
|
31
|
+
// eslint-disable-next-line import/no-dynamic-require,global-require
|
|
32
|
+
const { ModuleResolver } = require(eslintrcBundlePath).Legacy;
|
|
33
|
+
const originalResolve = ModuleResolver.resolve;
|
|
34
|
+
ModuleResolver.resolve = function HackedModuleResolver(moduleName, relativeToPath) {
|
|
35
|
+
if (moduleName === '@procore/eslint-config' &&
|
|
36
|
+
// if "@procore/eslint-config" in the "package.json" - use it instead builtin "@procore/eslint-config"
|
|
37
|
+
!hasProcoreEslintConfigInPackageJson &&
|
|
38
|
+
!hasProcoreEslintConfigInRootPackageJson) {
|
|
39
|
+
/**
|
|
40
|
+
* To find "@procore/eslint-config" in "@procore/core-scripts/node_modules",
|
|
41
|
+
* because original ModuleResolver starts search from cwd (package folder or workspace)
|
|
42
|
+
*/
|
|
43
|
+
//
|
|
44
|
+
return require.resolve(moduleName);
|
|
45
|
+
}
|
|
46
|
+
return originalResolve.call(this, moduleName, relativeToPath);
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=hack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hack.js","sourceRoot":"","sources":["../../src/eslint/hack.ts"],"names":[],"mappings":";;;AAAA,mDAA4B;AAC5B,oDAAmB;AAEnB,uCAAuC;AACvC,oFAAoF;AACpF,MAAM,cAAc,GAAG,IAAI,CA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CAAC,uCAAuC,EACxC;QACA;;;WAGG;QACH,EAAE;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;KACnC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,cAAc,CAAC,CAAA;AAC/D,CAAC,CAAA"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"11.10.
|
|
1
|
+
{"version":"11.10.6","commands":{"info":{"id":"info","description":"Gathers relevant information about the CLI.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{},"args":[]},"rm":{"id":"rm","description":"Removes things.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Automatically answer 'Yes' to the question.","allowNo":false},"dryRun":{"name":"dryRun","type":"boolean","char":"d","description":"List what would be deleted instead of deleting.","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Allow deleting the current working directory and outside.","allowNo":false}},"args":[{"name":"path","description":"Path that will be remove.","required":true}]},"test":{"id":"test","description":"Runs Jest. Visit https://jestjs.io/docs/en/cli for more information about available options, only --config is documented.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","description":"The path to a Jest config file specifying how to find and execute tests."}},"args":[]},"app:build":{"id":"app:build","description":"Compiles the application.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"analyze":{"name":"analyze","type":"boolean","description":"Run webpack bundle analyzer.","allowNo":false},"railsMode":{"name":"railsMode","type":"boolean","description":"Enables Procore Rails integration.","allowNo":false},"inspect":{"name":"inspect","type":"boolean","description":"Prints the Webpack configuration.","allowNo":false},"sourceMapPublicPath":{"name":"sourceMapPublicPath","type":"option","description":"Base path for all the sourcemap."},"publicPath":{"name":"publicPath","type":"option","description":"Allows you to specify the base path for all the assets within your application."}},"args":[]},"app:clean":{"id":"app:clean","description":"Cleans the distribution folder (/build).","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{},"args":[]},"app:gen":{"id":"app:gen","description":"Generates application scaffolding.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{},"args":[]},"app:start":{"id":"app:start","description":"Starts the development server.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"railsMode":{"name":"railsMode","type":"boolean","description":"Enables Procore Rails integration.","allowNo":false},"inspect":{"name":"inspect","type":"boolean","description":"Prints the Webpack configuration.","allowNo":false},"openBrowser":{"name":"openBrowser","type":"boolean","description":"Open browser after initializing the server.","allowNo":false},"https":{"name":"https","type":"boolean","description":"Use HTTPS.","allowNo":false},"dangerouslyDisableHostCheck":{"name":"dangerouslyDisableHostCheck","type":"boolean","description":"Disable host checking.","allowNo":false},"port":{"name":"port","type":"option","description":"Server port.","default":"5000"},"host":{"name":"host","type":"option","description":"Server host.","default":"0.0.0.0"},"socketHost":{"name":"socketHost","type":"option","description":"HMR websocket host","default":"0.0.0.0"},"publicPath":{"name":"publicPath","type":"option","description":"Public asset path."}},"args":[]},"lib:build":{"id":"lib:build","description":"Compiles the library in production mode.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"analyze":{"name":"analyze","type":"boolean","description":"Run webpack bundle analyzer.","allowNo":false},"inspect":{"name":"inspect","type":"boolean","description":"Prints the Webpack configuration.","allowNo":false}},"args":[]},"lib:clean":{"id":"lib:clean","description":"Cleans the distribution folder (/dist).","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{},"args":[]},"lib:start":{"id":"lib:start","description":"Compiles the library in development mode.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{},"args":[]},"lint:eslint":{"id":"lint:eslint","description":"Runs the ESLint linter.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","description":"Automatically fix problems.","allowNo":false},"fixTypes":{"name":"fixTypes","type":"option","description":"The types of lint errors/warnings to fix.","options":["layout","problem","suggestion"]}},"args":[{"name":"input","description":"Comma-delimited list of file and/or folder paths that the linter will run against.","required":false}]},"lint:stylelint":{"id":"lint:stylelint","description":"Runs the stylelint linter.","pluginName":"@procore/core-scripts","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","description":"Automatically fix problems.","allowNo":false}},"args":[{"name":"files","description":"Path to the file or folder that the linter will run against.","required":false}]}}}
|
package/package.json
CHANGED