@o3r/core 12.1.0-prerelease.85 → 12.1.0-prerelease.86
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/README.md +36 -25
- package/package.json +4 -4
- package/schematics/add-modules/schema.d.ts +1 -1
- package/schematics/add-modules/schema.d.ts.map +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +2 -1
- package/schematics/ng-add/project-setup/index.d.ts.map +1 -1
- package/schematics/ng-add/project-setup/index.js +9 -5
- package/schematics/ng-add/schema.d.ts +1 -1
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/schema.json +3 -1
- package/schematics/ng-add/utils/linter/index.d.ts +3 -10
- package/schematics/ng-add/utils/linter/index.d.ts.map +1 -1
- package/schematics/ng-add/utils/linter/index.js +6 -21
- package/schematics/shared/presets/basic.preset.d.ts.map +1 -1
- package/schematics/shared/presets/basic.preset.js +11 -1
- package/schematics/shared/presets/helpers.js +1 -1
- package/schematics/shared/presets/index.d.ts.map +1 -1
- package/schematics/shared/presets/index.js +2 -0
- package/schematics/shared/presets/preset.interface.d.ts +5 -0
- package/schematics/shared/presets/preset.interface.d.ts.map +1 -1
- package/schematics/shared/presets/recommended.preset.d.ts +10 -0
- package/schematics/shared/presets/recommended.preset.d.ts.map +1 -0
- package/schematics/shared/presets/recommended.preset.js +19 -0
package/README.md
CHANGED
|
@@ -104,40 +104,51 @@ Today the following presets are available.
|
|
|
104
104
|
|
|
105
105
|
### Preset Basic
|
|
106
106
|
|
|
107
|
-
This preset
|
|
107
|
+
This preset does not add any additional modules.
|
|
108
|
+
|
|
109
|
+
### Preset Recommended
|
|
110
|
+
|
|
111
|
+
This preset is adding recommended Otter modules and features. This preset is the default one.
|
|
112
|
+
|
|
113
|
+
* [@o3r/eslint-config](https://www.npmjs.com/package/@o3r/eslint-config) (or [@o3r/eslint-config-otter](https://www.npmjs.com/package/@o3r/eslint-config-otter) for legacy configuration)
|
|
114
|
+
* [@o3r/testing](https://www.npmjs.com/package/@o3r/testing)
|
|
115
|
+
* [@o3r/workspace](https://www.npmjs.com/package/@o3r/workspace) specific features:
|
|
116
|
+
* Renovate configuration
|
|
117
|
+
* VSCode Tooling
|
|
118
|
+
* pre-commit checks
|
|
108
119
|
|
|
109
120
|
### Preset CMS
|
|
110
121
|
|
|
111
122
|
Will add all the modules allowing the allowing the full managing of an application by the CMS.
|
|
112
|
-
|
|
123
|
+
On top of the Otter recommended modules, it includes the following ones:
|
|
113
124
|
|
|
114
|
-
* @o3r/localization
|
|
115
|
-
* @o3r/styling
|
|
116
|
-
* @o3r/components
|
|
117
|
-
* @o3r/configuration
|
|
118
|
-
* @o3r/dynamic-content
|
|
119
|
-
* @o3r/rules-engine
|
|
125
|
+
* [@o3r/localization](https://www.npmjs.com/package/@o3r/localization)
|
|
126
|
+
* [@o3r/styling](https://www.npmjs.com/package/@o3r/styling)
|
|
127
|
+
* [@o3r/components](https://www.npmjs.com/package/@o3r/components)
|
|
128
|
+
* [@o3r/configuration](https://www.npmjs.com/package/@o3r/configuration)
|
|
129
|
+
* [@o3r/dynamic-content](https://www.npmjs.com/package/@o3r/dynamic-content)
|
|
130
|
+
* [@o3r/rules-engine](https://www.npmjs.com/package/@o3r/rules-engine)
|
|
120
131
|
|
|
121
132
|
### Preset All
|
|
122
133
|
|
|
123
134
|
Will add all official modules provided by the Otter Framework.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* @o3r/analytics
|
|
127
|
-
* @o3r/apis-manager
|
|
128
|
-
* @o3r/application
|
|
129
|
-
* @o3r/components
|
|
130
|
-
* @o3r/configuration
|
|
131
|
-
* @o3r/dynamic-content
|
|
132
|
-
* @o3r/eslint-config-otter
|
|
133
|
-
* @o3r/eslint-plugin
|
|
134
|
-
* @o3r/forms
|
|
135
|
-
* @o3r/localization
|
|
136
|
-
* @o3r/logger
|
|
137
|
-
* @o3r/rules-engine
|
|
138
|
-
* @o3r/store-sync
|
|
139
|
-
* @o3r/stylelint-plugin
|
|
140
|
-
* @o3r/styling
|
|
135
|
+
On top of the Otter recommended modules, it includes the following ones:
|
|
136
|
+
|
|
137
|
+
* [@o3r/analytics](https://www.npmjs.com/package/@o3r/analytics)
|
|
138
|
+
* [@o3r/apis-manager](https://www.npmjs.com/package/@o3r/apis-manager)
|
|
139
|
+
* [@o3r/application](https://www.npmjs.com/package/@o3r/application)
|
|
140
|
+
* [@o3r/components](https://www.npmjs.com/package/@o3r/components)
|
|
141
|
+
* [@o3r/configuration](https://www.npmjs.com/package/@o3r/configuration)
|
|
142
|
+
* [@o3r/dynamic-content](https://www.npmjs.com/package/@o3r/dynamic-content)
|
|
143
|
+
* [@o3r/eslint-config-otter](https://www.npmjs.com/package/@o3r/eslint-config-otter)
|
|
144
|
+
* [@o3r/eslint-plugin](https://www.npmjs.com/package/@o3r/eslint-plugin)
|
|
145
|
+
* [@o3r/forms](https://www.npmjs.com/package/@o3r/forms)
|
|
146
|
+
* [@o3r/localization](https://www.npmjs.com/package/@o3r/localization)
|
|
147
|
+
* [@o3r/logger](https://www.npmjs.com/package/@o3r/logger)
|
|
148
|
+
* [@o3r/rules-engine](https://www.npmjs.com/package/@o3r/rules-engine)
|
|
149
|
+
* [@o3r/store-sync](https://www.npmjs.com/package/@o3r/store-sync)
|
|
150
|
+
* [@o3r/stylelint-plugin](https://www.npmjs.com/package/@o3r/stylelint-plugin)
|
|
151
|
+
* [@o3r/styling](https://www.npmjs.com/package/@o3r/styling)
|
|
141
152
|
|
|
142
153
|
## External (Custom) Preset
|
|
143
154
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/core",
|
|
3
|
-
"version": "12.1.0-prerelease.
|
|
3
|
+
"version": "12.1.0-prerelease.86",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@ngrx/entity": "^19.0.0",
|
|
40
40
|
"@ngrx/store": "^19.0.0",
|
|
41
41
|
"@nx/angular": "~20.4.0",
|
|
42
|
-
"@o3r/telemetry": "^12.1.0-prerelease.
|
|
42
|
+
"@o3r/telemetry": "^12.1.0-prerelease.86",
|
|
43
43
|
"@schematics/angular": "^19.0.0",
|
|
44
44
|
"chokidar": "^4.0.3",
|
|
45
45
|
"globby": "^11.1.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@o3r/schematics": "^12.1.0-prerelease.
|
|
81
|
+
"@o3r/schematics": "^12.1.0-prerelease.86",
|
|
82
82
|
"tslib": "^2.6.2",
|
|
83
83
|
"uuid": "^11.0.5"
|
|
84
84
|
},
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@ngrx/store": "~19.0.0",
|
|
92
92
|
"@ngrx/store-devtools": "~19.0.0",
|
|
93
93
|
"@nx/eslint-plugin": "~20.4.0",
|
|
94
|
-
"@o3r/store-sync": "^12.1.0-prerelease.
|
|
94
|
+
"@o3r/store-sync": "^12.1.0-prerelease.86",
|
|
95
95
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
96
96
|
"@types/jest": "~29.5.2",
|
|
97
97
|
"@typescript-eslint/eslint-plugin": "~8.26.0",
|
|
@@ -3,7 +3,7 @@ import type { PresetNames } from '../ng-add/schema';
|
|
|
3
3
|
export interface NgAddModulesSchematicsSchema extends SchematicOptionObject {
|
|
4
4
|
/** Project name */
|
|
5
5
|
projectName?: string | undefined;
|
|
6
|
-
/**
|
|
6
|
+
/** Preset of module list to automatically install */
|
|
7
7
|
preset?: PresetNames | undefined;
|
|
8
8
|
/** Preset of non-official module list to automatically install */
|
|
9
9
|
externalPresets?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/add-modules/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/add-modules/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,qDAAqD;IACrD,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAEjC,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAuGpC;;;GAGG;AACH,eAAO,MAAM,KAAK,wBAAgC,CAAC"}
|
|
@@ -10,6 +10,7 @@ const schematics_3 = require("@o3r/schematics");
|
|
|
10
10
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
11
11
|
const presets_1 = require("../shared/presets");
|
|
12
12
|
const index_1 = require("./project-setup/index");
|
|
13
|
+
const utils_1 = require("./utils");
|
|
13
14
|
const workspacePackageName = '@o3r/workspace';
|
|
14
15
|
const o3rDevDependencies = [
|
|
15
16
|
'@o3r/schematics'
|
|
@@ -55,7 +56,7 @@ function ngAddFn(options) {
|
|
|
55
56
|
(0, schematics_2.registerPackageCollectionSchematics)(corePackageJsonContent),
|
|
56
57
|
async (t, c) => {
|
|
57
58
|
const { preset, externalPresets, ...forwardOptions } = options;
|
|
58
|
-
const presetOptions = { projectName: forwardOptions.projectName, exactO3rVersion: forwardOptions.exactO3rVersion, forwardOptions };
|
|
59
|
+
const presetOptions = { projectName: forwardOptions.projectName, exactO3rVersion: forwardOptions.exactO3rVersion, forwardOptions, isUsingEslintLegacy: (0, utils_1.isUsingLegacyConfig)(t) };
|
|
59
60
|
const presetRunner = await presets_1.presets[preset](presetOptions);
|
|
60
61
|
const externalPresetRunner = externalPresets ? await (0, presets_1.getExternalPreset)(externalPresets, t, c)(presetOptions) : undefined;
|
|
61
62
|
const modules = [...new Set([...(presetRunner.modules || []), ...(externalPresetRunner?.modules || [])])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/project-setup/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/project-setup/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAWnB;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,qBAAqB,EAAE,yBAAyB,wBAAwB,KAAG,IAoDlH,CAAC"}
|
|
@@ -9,14 +9,13 @@ const index_1 = require("../../rule-factories/index");
|
|
|
9
9
|
const update_builders_names_1 = require("../updates-for-v8/cms-adapters/update-builders-names");
|
|
10
10
|
const update_generators_names_1 = require("../updates-for-v8/generators/update-generators-names");
|
|
11
11
|
const replaced_packages_1 = require("../updates-for-v8/replaced-packages");
|
|
12
|
-
const index_2 = require("../utils/index");
|
|
13
12
|
/**
|
|
14
13
|
* Enable all the otter features requested by the user
|
|
15
14
|
* Install all the related dependencies and import the features inside the application
|
|
16
15
|
* @param options installation options to pass to the all the other packages' installation
|
|
17
16
|
* @param dependenciesSetupConfig
|
|
18
17
|
*/
|
|
19
|
-
const prepareProject = (options, dependenciesSetupConfig) =>
|
|
18
|
+
const prepareProject = (options, dependenciesSetupConfig) => (tree, context) => {
|
|
20
19
|
const coreSchematicsFolder = path.resolve(__dirname, '..');
|
|
21
20
|
const corePackageJsonPath = path.resolve(coreSchematicsFolder, '..', '..', 'package.json');
|
|
22
21
|
const corePackageJsonContent = JSON.parse(fs.readFileSync(corePackageJsonPath, { encoding: 'utf8' }));
|
|
@@ -24,14 +23,12 @@ const prepareProject = (options, dependenciesSetupConfig) => async (tree, contex
|
|
|
24
23
|
context.logger.error('Could not find @o3r/core package. Are you sure it is installed?');
|
|
25
24
|
}
|
|
26
25
|
const o3rCoreVersion = corePackageJsonContent.version;
|
|
27
|
-
const installOtterLinter = await (0, index_2.shouldOtterLinterBeInstalled)(context, tree);
|
|
28
26
|
const workspaceConfig = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
29
27
|
const workspaceProject = (options.projectName && workspaceConfig?.projects?.[options.projectName]) || undefined;
|
|
30
28
|
const projectType = workspaceProject?.projectType;
|
|
31
29
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(corePackageJsonPath);
|
|
32
30
|
const internalPackagesToInstallWithNgAdd = Array.from(new Set([
|
|
33
31
|
...(projectType === 'application' ? ['@o3r/application'] : []),
|
|
34
|
-
...(installOtterLinter ? [`@o3r/eslint-config${(0, index_2.isUsingFlatConfig)(tree) ? '' : '-otter'}`] : []),
|
|
35
32
|
...depsInfo.o3rPeerDeps
|
|
36
33
|
]));
|
|
37
34
|
const projectDirectory = workspaceProject?.root;
|
|
@@ -47,6 +44,13 @@ const prepareProject = (options, dependenciesSetupConfig) => async (tree, contex
|
|
|
47
44
|
};
|
|
48
45
|
});
|
|
49
46
|
(dependenciesSetupConfig.ngAddToRun ||= []).push(...internalPackagesToInstallWithNgAdd);
|
|
47
|
+
let hasEslint = false;
|
|
48
|
+
try {
|
|
49
|
+
const eslintPackage = 'eslint';
|
|
50
|
+
require.resolve(eslintPackage);
|
|
51
|
+
hasEslint = true;
|
|
52
|
+
}
|
|
53
|
+
catch { }
|
|
50
54
|
const appLibRules = [
|
|
51
55
|
(0, update_builders_names_1.updateBuildersNames)(),
|
|
52
56
|
(0, update_generators_names_1.updateOtterGeneratorsNames)(),
|
|
@@ -57,7 +61,7 @@ const prepareProject = (options, dependenciesSetupConfig) => async (tree, contex
|
|
|
57
61
|
(0, schematics_2.removePackages)(replaced_packages_1.packagesToRemove),
|
|
58
62
|
(0, index_1.o3rBasicUpdates)(options.projectName, o3rCoreVersion, projectType),
|
|
59
63
|
// task that should run after the schematics should be after the ng-add task as they will wait for the package installation before running the other dependencies
|
|
60
|
-
!options.skipLinter &&
|
|
64
|
+
!options.skipLinter && hasEslint ? (0, schematics_2.applyEsLintFix)() : (0, schematics_1.noop)()
|
|
61
65
|
];
|
|
62
66
|
return (0, schematics_1.chain)(appLibRules);
|
|
63
67
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
-
export type PresetNames = 'basic' | 'cms' | 'all';
|
|
2
|
+
export type PresetNames = 'basic' | 'recommended' | 'cms' | 'all';
|
|
3
3
|
export interface NgAddSchematicsSchema extends SchematicOptionObject {
|
|
4
4
|
/** Preset of module list to automatically install */
|
|
5
5
|
preset: PresetNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,KAAK,GAAG,KAAK,CAAC;AAElE,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,qDAAqD;IACrD,MAAM,EAAE,WAAW,CAAC;IAEpB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,+BAA+B;IAC/B,WAAW,EAAE,OAAO,CAAC;IAErB,iDAAiD;IACjD,MAAM,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAElD,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IAEjB,8DAA8D;IAC9D,WAAW,EAAE,OAAO,CAAC;IAErB,sEAAsE;IACtE,YAAY,EAAE,OAAO,CAAC;IAEtB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
"preset": {
|
|
8
8
|
"description": "Preset of module list to automatically install",
|
|
9
9
|
"type": "string",
|
|
10
|
-
"default": "
|
|
10
|
+
"default": "recommended",
|
|
11
11
|
"enum": [
|
|
12
12
|
"basic",
|
|
13
|
+
"recommended",
|
|
13
14
|
"cms",
|
|
14
15
|
"all"
|
|
15
16
|
],
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"type": "list",
|
|
19
20
|
"items": [
|
|
20
21
|
{ "value": "basic", "label": "BASIC - Minimum plugin list to install for a basic Otter application. (details on https://www.npmjs.com/package/@o3r/core#preset-basic)" },
|
|
22
|
+
{ "value": "recommended", "label": "RECOMMENDED - Add the recommended Otter modules. (details on https://www.npmjs.com/package/@o3r/core#preset-recommended)" },
|
|
21
23
|
{ "value": "cms", "label": "CMS - Add the Otter modules allowing the full administration of the application via the CMS. (details on https://www.npmjs.com/package/@o3r/core#preset-cms)" },
|
|
22
24
|
{ "value": "all", "label": "ALL - Add all the available Otter modules. (details on https://www.npmjs.com/package/@o3r/core#preset-all)" }
|
|
23
25
|
]
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Tree } from '@angular-devkit/schematics';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Is the ESLint legacy config used in the repository
|
|
4
4
|
* @param tree
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
7
|
-
/**
|
|
8
|
-
* Checks if `eslint` package is installed. If so, ask the user for otter linter rules install.
|
|
9
|
-
* Otherwise displays a message to inform the user that otter linter rules can be added later.
|
|
10
|
-
* @param context Schematics context
|
|
11
|
-
* @param tree
|
|
12
|
-
*/
|
|
13
|
-
export declare const shouldOtterLinterBeInstalled: (context: SchematicContext, tree: Tree) => Promise<boolean>;
|
|
6
|
+
export declare const isUsingLegacyConfig: (tree: Tree) => boolean;
|
|
14
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,YAQ7C,CAAC"}
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const prompt_1 = require("@angular/cli/src/utilities/prompt");
|
|
3
|
+
exports.isUsingLegacyConfig = void 0;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* Is the ESLint legacy config used in the repository
|
|
7
6
|
* @param tree
|
|
8
7
|
*/
|
|
9
|
-
const
|
|
10
|
-
exports.isUsingFlatConfig = isUsingFlatConfig;
|
|
11
|
-
/**
|
|
12
|
-
* Checks if `eslint` package is installed. If so, ask the user for otter linter rules install.
|
|
13
|
-
* Otherwise displays a message to inform the user that otter linter rules can be added later.
|
|
14
|
-
* @param context Schematics context
|
|
15
|
-
* @param tree
|
|
16
|
-
*/
|
|
17
|
-
const shouldOtterLinterBeInstalled = async (context, tree) => {
|
|
8
|
+
const isUsingLegacyConfig = (tree) => {
|
|
18
9
|
const linterPackageName = 'eslint';
|
|
19
|
-
let useOtterLinter = false;
|
|
20
10
|
try {
|
|
21
11
|
require.resolve(`${linterPackageName}/package.json`);
|
|
22
|
-
if (context.interactive) {
|
|
23
|
-
useOtterLinter = await (0, prompt_1.askConfirmation)(`You already have ESLint installed. Would you like to add otter config rules for ESLint?
|
|
24
|
-
Otherwise, you can add them later via this command: ng add @o3r/eslint-config${(0, exports.isUsingFlatConfig)(tree) ? '' : '-otter'}`, true);
|
|
25
|
-
}
|
|
26
12
|
}
|
|
27
13
|
catch {
|
|
28
|
-
|
|
29
|
-
You can add Otter linter config rules later to the project via this command: ng add @o3r/eslint-config`);
|
|
14
|
+
return false;
|
|
30
15
|
}
|
|
31
|
-
return
|
|
16
|
+
return !!tree.root.subfiles.some((file) => /\.eslintrc\.(?:json|js|ya?ml)?$/.test(file));
|
|
32
17
|
};
|
|
33
|
-
exports.
|
|
18
|
+
exports.isUsingLegacyConfig = isUsingLegacyConfig;
|
|
34
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/basic.preset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"basic.preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/basic.preset.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,wBAAgB,WAAW;;EAO1B"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.basicPreset = basicPreset;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_2 = require("@o3r/schematics");
|
|
4
6
|
const helpers_1 = require("./helpers");
|
|
7
|
+
const skipWorkspaceFeature = {
|
|
8
|
+
skipVscodeTools: true,
|
|
9
|
+
skipRenovate: true,
|
|
10
|
+
skipPreCommitChecks: true
|
|
11
|
+
};
|
|
5
12
|
/**
|
|
6
13
|
* Default preset with the basic of Otter Framework (no additional modules)
|
|
7
14
|
*/
|
|
8
15
|
function basicPreset() {
|
|
9
16
|
return {
|
|
10
|
-
rule: (0,
|
|
17
|
+
rule: (0, schematics_1.chain)([
|
|
18
|
+
(0, schematics_2.setupSchematicsParamsForProject)({ '@o3r/workspace:ng-add': skipWorkspaceFeature }),
|
|
19
|
+
(0, helpers_1.defaultPresetRuleFactory)([])
|
|
20
|
+
])
|
|
11
21
|
};
|
|
12
22
|
}
|
|
13
23
|
//# sourceMappingURL=basic.preset.js.map
|
|
@@ -11,7 +11,7 @@ const schematics_2 = require("@o3r/schematics");
|
|
|
11
11
|
* @param options
|
|
12
12
|
*/
|
|
13
13
|
function defaultPresetRuleFactory(moduleToInstall, options = {}) {
|
|
14
|
-
return (tree
|
|
14
|
+
return (tree) => {
|
|
15
15
|
const corePackageJsonContent = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', '..', '..', 'package.json'), { encoding: 'utf8' }));
|
|
16
16
|
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
17
17
|
if (moduleToInstall.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,OAAO,EACR,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,OAAO,EACR,MAAM,oBAAoB,CAAC;AAK5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,OAKrB,CAAC"}
|
|
@@ -5,10 +5,12 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const all_preset_1 = require("./all.preset");
|
|
6
6
|
const basic_preset_1 = require("./basic.preset");
|
|
7
7
|
const cms_preset_1 = require("./cms.preset");
|
|
8
|
+
const recommended_preset_1 = require("./recommended.preset");
|
|
8
9
|
tslib_1.__exportStar(require("./external.preset"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./preset.interface"), exports);
|
|
10
11
|
exports.presets = {
|
|
11
12
|
basic: basic_preset_1.basicPreset,
|
|
13
|
+
recommended: recommended_preset_1.recommendedPreset,
|
|
12
14
|
cms: cms_preset_1.cmsPreset,
|
|
13
15
|
all: all_preset_1.allPreset
|
|
14
16
|
};
|
|
@@ -11,6 +11,11 @@ export interface PresetOptions {
|
|
|
11
11
|
dependenciesSetupConfig?: SetupDependenciesOptions;
|
|
12
12
|
/** Use a pinned version for otter packages */
|
|
13
13
|
exactO3rVersion?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Is using Eslint legacy configuration.
|
|
16
|
+
* This option should be removed when @o3r/eslint-config-otter won't be supported anymore.
|
|
17
|
+
*/
|
|
18
|
+
isUsingEslintLegacy?: boolean;
|
|
14
19
|
}
|
|
15
20
|
/** Definition of the modules preset */
|
|
16
21
|
export interface Preset {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.interface.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/preset.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC,uDAAuD;IACvD,uBAAuB,CAAC,EAAE,wBAAwB,CAAC;IAEnD,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"preset.interface.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/preset.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC,uDAAuD;IACvD,uBAAuB,CAAC,EAAE,wBAAwB,CAAC;IAEnD,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,uCAAuC;AACvC,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,4CAA4C;IAC5C,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEjF,kBAAkB;AAClB,MAAM,MAAM,OAAO,GAAG;KAAG,CAAC,IAAI,WAAW,GAAG,aAAa;CAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PresetOptions } from './preset.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Preset with Otter recommended modules
|
|
4
|
+
* @param options
|
|
5
|
+
*/
|
|
6
|
+
export declare function recommendedPreset(options: PresetOptions): {
|
|
7
|
+
modules: string[];
|
|
8
|
+
rule: import("@angular-devkit/schematics").Rule;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=recommended.preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommended.preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/recommended.preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa;;;EAUvD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendedPreset = recommendedPreset;
|
|
4
|
+
const helpers_1 = require("./helpers");
|
|
5
|
+
/**
|
|
6
|
+
* Preset with Otter recommended modules
|
|
7
|
+
* @param options
|
|
8
|
+
*/
|
|
9
|
+
function recommendedPreset(options) {
|
|
10
|
+
const modules = [
|
|
11
|
+
options.isUsingEslintLegacy ? '@o3r/eslint-config-otter' : '@o3r/eslint-config',
|
|
12
|
+
'@o3r/testing'
|
|
13
|
+
];
|
|
14
|
+
return {
|
|
15
|
+
modules,
|
|
16
|
+
rule: (0, helpers_1.defaultPresetRuleFactory)(modules, options)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=recommended.preset.js.map
|