@sap/cds-compiler 2.15.2 → 3.0.2
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/CHANGELOG.md +66 -1590
- package/bin/cdsc.js +42 -46
- package/doc/CHANGELOG_ARCHIVE.md +1592 -0
- package/doc/CHANGELOG_BETA.md +3 -4
- package/doc/CHANGELOG_DEPRECATED.md +35 -1
- package/doc/{DeprecatedOptions.md → DeprecatedOptions_v2.md} +3 -1
- package/doc/Versioning.md +20 -1
- package/lib/api/.eslintrc.json +2 -2
- package/lib/api/main.js +312 -143
- package/lib/api/options.js +15 -85
- package/lib/api/validate.js +6 -10
- package/lib/base/keywords.js +280 -110
- package/lib/base/message-registry.js +80 -24
- package/lib/base/messages.js +103 -52
- package/lib/base/model.js +44 -2
- package/lib/base/optionProcessorHelper.js +53 -21
- package/lib/checks/actionsFunctions.js +7 -5
- package/lib/checks/annotationsOData.js +1 -1
- package/lib/checks/cdsPersistence.js +1 -0
- package/lib/checks/elements.js +6 -6
- package/lib/checks/invalidTarget.js +1 -1
- package/lib/checks/nonexpandableStructured.js +1 -1
- package/lib/checks/queryNoDbArtifacts.js +2 -1
- package/lib/checks/selectItems.js +5 -1
- package/lib/checks/types.js +4 -2
- package/lib/checks/utils.js +2 -2
- package/lib/checks/validator.js +2 -1
- package/lib/compiler/assert-consistency.js +15 -10
- package/lib/compiler/builtins.js +127 -10
- package/lib/compiler/define.js +6 -4
- package/lib/compiler/extend.js +63 -12
- package/lib/compiler/finalize-parse-cdl.js +20 -9
- package/lib/compiler/index.js +25 -11
- package/lib/compiler/moduleLayers.js +7 -0
- package/lib/compiler/populate.js +16 -14
- package/lib/compiler/propagator.js +3 -3
- package/lib/compiler/resolve.js +194 -222
- package/lib/compiler/shared.js +56 -76
- package/lib/compiler/tweak-assocs.js +9 -10
- package/lib/compiler/utils.js +7 -2
- package/lib/edm/annotations/genericTranslation.js +60 -6
- package/lib/edm/annotations/preprocessAnnotations.js +10 -11
- package/lib/edm/csn2edm.js +39 -41
- package/lib/edm/edm.js +22 -15
- package/lib/edm/edmPreprocessor.js +66 -69
- package/lib/edm/edmUtils.js +12 -62
- package/lib/gen/Dictionary.json +8 -6
- package/lib/gen/language.checksum +1 -1
- package/lib/gen/language.interp +8 -30
- package/lib/gen/language.tokens +105 -114
- package/lib/gen/languageLexer.interp +1 -34
- package/lib/gen/languageLexer.js +889 -1007
- package/lib/gen/languageLexer.tokens +95 -106
- package/lib/gen/languageParser.js +20717 -22376
- package/lib/json/from-csn.js +73 -68
- package/lib/json/to-csn.js +13 -10
- package/lib/language/antlrParser.js +2 -2
- package/lib/language/docCommentParser.js +61 -38
- package/lib/language/errorStrategy.js +52 -40
- package/lib/language/genericAntlrParser.js +333 -259
- package/lib/language/language.g4 +600 -645
- package/lib/language/multiLineStringParser.js +14 -42
- package/lib/language/textUtils.js +44 -0
- package/lib/main.d.ts +27 -42
- package/lib/main.js +104 -81
- package/lib/model/csnRefs.js +2 -1
- package/lib/model/csnUtils.js +183 -285
- package/lib/model/revealInternalProperties.js +32 -9
- package/lib/model/sortViews.js +32 -31
- package/lib/optionProcessor.js +64 -57
- package/lib/render/.eslintrc.json +1 -1
- package/lib/render/DuplicateChecker.js +4 -7
- package/lib/render/manageConstraints.js +70 -2
- package/lib/render/toCdl.js +334 -339
- package/lib/render/toHdbcds.js +20 -16
- package/lib/render/toRename.js +44 -22
- package/lib/render/toSql.js +60 -54
- package/lib/render/utils/common.js +15 -1
- package/lib/render/utils/sql.js +20 -19
- package/lib/sql-identifier.js +6 -0
- package/lib/transform/db/.eslintrc.json +3 -2
- package/lib/transform/db/cdsPersistence.js +5 -15
- package/lib/transform/db/constraints.js +1 -1
- package/lib/transform/db/expansion.js +7 -6
- package/lib/transform/db/flattening.js +18 -19
- package/lib/transform/db/views.js +3 -3
- package/lib/transform/draft/.eslintrc.json +2 -2
- package/lib/transform/draft/db.js +6 -6
- package/lib/transform/draft/odata.js +6 -7
- package/lib/transform/forHanaNew.js +19 -22
- package/lib/transform/forOdataNew.js +13 -15
- package/lib/transform/localized.js +35 -25
- package/lib/transform/odata/toFinalBaseType.js +11 -9
- package/lib/transform/odata/typesExposure.js +3 -3
- package/lib/transform/odata/utils.js +1 -38
- package/lib/transform/transformUtilsNew.js +63 -77
- package/lib/transform/translateAssocsToJoins.js +6 -2
- package/lib/transform/universalCsn/.eslintrc.json +2 -2
- package/lib/transform/universalCsn/coreComputed.js +11 -6
- package/lib/transform/universalCsn/universalCsnEnricher.js +33 -5
- package/lib/utils/file.js +31 -21
- package/lib/utils/timetrace.js +20 -21
- package/package.json +34 -4
- package/share/messages/syntax-expected-integer.md +9 -8
- package/doc/ApiMigration.md +0 -237
- package/doc/CommandLineMigration.md +0 -58
- package/doc/ErrorMessages.md +0 -175
- package/doc/FioriAnnotations.md +0 -94
- package/doc/ODataTransformation.md +0 -273
- package/lib/backends.js +0 -529
- package/lib/fix_antlr4-8_warning.js +0 -56
package/doc/CHANGELOG_BETA.md
CHANGED
|
@@ -8,12 +8,11 @@ Note: `beta` fixes, changes and features are listed in this ChangeLog just for i
|
|
|
8
8
|
The compiler behavior concerning `beta` features can change at any time without notice.
|
|
9
9
|
**Don't use `beta` fixes, changes and features in productive mode.**
|
|
10
10
|
|
|
11
|
-
## Version
|
|
11
|
+
## Version 3.0.0 - 2022-XX-YY
|
|
12
12
|
|
|
13
|
-
### Removed `
|
|
13
|
+
### Removed `addTextsLanguageAssoc`
|
|
14
14
|
|
|
15
|
-
Instead,
|
|
16
|
-
`def-unexpected-paramview-assoc` and `def-unexpected-calcview-assoc`.
|
|
15
|
+
Instead, use the option `addTextsLanguageAssoc`, which is available since v2.8.0.
|
|
17
16
|
|
|
18
17
|
## Version 2.12.0 - 2022-01-25
|
|
19
18
|
|
|
@@ -11,7 +11,41 @@ Note: `deprecated` features are listed in this ChangeLog just for information.
|
|
|
11
11
|
**When the `deprecated` option is set, the `beta` option is ignored,
|
|
12
12
|
and several new features are not available.**
|
|
13
13
|
|
|
14
|
-
## Version
|
|
14
|
+
## Version 3.0.0 - 2022-XX-YY
|
|
15
|
+
|
|
16
|
+
Version 3 of the cds-compiler removes all v2 deprecated flags.
|
|
17
|
+
|
|
18
|
+
### Removed `createLocalizedViews`
|
|
19
|
+
|
|
20
|
+
### Removed `downgradableErrors`
|
|
21
|
+
|
|
22
|
+
### Removed `generatedEntityNameWithUnderscore`
|
|
23
|
+
|
|
24
|
+
### Removed `longAutoexposed`
|
|
25
|
+
|
|
26
|
+
### Removed `noElementsExpansion`
|
|
27
|
+
|
|
28
|
+
### Removed `noInheritedAutoexposeViaComposition`
|
|
29
|
+
|
|
30
|
+
### Removed `noScopedRedirections`
|
|
31
|
+
|
|
32
|
+
### Removed `oldVirtualNotNullPropagation`
|
|
33
|
+
|
|
34
|
+
### Removed `parensAsStrings`
|
|
35
|
+
|
|
36
|
+
### Removed `projectionAsQuery`
|
|
37
|
+
|
|
38
|
+
### Removed `redirectInSubQueries`
|
|
39
|
+
|
|
40
|
+
### Removed `renderVirtualElements`
|
|
41
|
+
|
|
42
|
+
### Removed `shortAutoexposed`
|
|
43
|
+
|
|
44
|
+
### Removed `unmanagedUpInComponent`
|
|
45
|
+
|
|
46
|
+
### Removed `v1KeysForTemporal`
|
|
47
|
+
|
|
48
|
+
## Version 2.13.0 - 2022-03-22
|
|
15
49
|
|
|
16
50
|
### Added `redirectInSubQueries`
|
|
17
51
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Deprecated Options and How to Avoid Them
|
|
2
2
|
|
|
3
|
+
__Important__: With compiler v3, these deprecated options were removed!
|
|
4
|
+
|
|
3
5
|
To ease the migration to CDS Compiler Version 2,
|
|
4
6
|
the compiler can be called with an option `deprecated`
|
|
5
|
-
which
|
|
7
|
+
which makes the compiler behave more like Compiler Version 1 for certain features.
|
|
6
8
|
|
|
7
9
|
As the name suggest, this option should be used only for a limited time.
|
|
8
10
|
The support for certain v1 features might also be dropped after a while
|
package/doc/Versioning.md
CHANGED
|
@@ -5,6 +5,17 @@ The cds-compiler uses [Semantic Versioning][SemVer] for its version numbers.
|
|
|
5
5
|
This document clarifies how we use [SemVer] and what you can and what you can‘t
|
|
6
6
|
expect from version updates.
|
|
7
7
|
|
|
8
|
+
<!-- toc: start -->
|
|
9
|
+
|
|
10
|
+
1. [Public API](#public-api)
|
|
11
|
+
2. [Patch Versions](#patch-versions)
|
|
12
|
+
3. [Minor Versions](#minor-versions)
|
|
13
|
+
4. [Beta Flags](#beta-flags)
|
|
14
|
+
5. [Deprecated Flags](#deprecated-flags)
|
|
15
|
+
6. [Command Line Tool `cdsc`](#command-line-tool-cdsc)
|
|
16
|
+
|
|
17
|
+
<!-- toc: end -->
|
|
18
|
+
|
|
8
19
|
## Public API
|
|
9
20
|
|
|
10
21
|
According to [§1] of SemVer, a public API must be made available. Our public
|
|
@@ -41,7 +52,7 @@ we detect invalid CDS code.
|
|
|
41
52
|
|
|
42
53
|
## Beta Flags
|
|
43
54
|
|
|
44
|
-
The compiler provides so
|
|
55
|
+
The compiler provides so-called “beta flags” that enable or disable certain
|
|
45
56
|
features. We do not guarantee that any such flags stay consistent between
|
|
46
57
|
patch versions! Beta flags may change any time.
|
|
47
58
|
|
|
@@ -57,6 +68,14 @@ period.
|
|
|
57
68
|
Refer to [CHANGELOG_DEPRECATED.md](./CHANGELOG_DEPRECATED.md) for changes
|
|
58
69
|
to deprecated flags.
|
|
59
70
|
|
|
71
|
+
## Command Line Tool `cdsc`
|
|
72
|
+
|
|
73
|
+
`bin/cdsc.js` as well as all other command line tools do _not_ guarantee any
|
|
74
|
+
stability. It is considered a compiler internal tool that only serves for
|
|
75
|
+
debugging. The official command line tool `cds` of the `@sap/cds` and
|
|
76
|
+
`@sap/cds-dk` packages are to be used by users. That means commands and
|
|
77
|
+
options may change any time without prior notice. Changes may still be listed
|
|
78
|
+
in [CHANGELOG.md](../CHANGELOG.md).
|
|
60
79
|
|
|
61
80
|
[SemVer]: https://semver.org/
|
|
62
81
|
[§1]: https://semver.org/#spec-item-1
|
package/lib/api/.eslintrc.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"root": true,
|
|
3
3
|
"env": {
|
|
4
|
-
"
|
|
4
|
+
"es2020": true,
|
|
5
5
|
"node": true
|
|
6
6
|
},
|
|
7
7
|
// we actually do not extend airbnb-base, as it weakens some eslint:recommended rules
|
|
8
8
|
"extends": ["../../.eslintrc-ydkjsi.json", "plugin:jsdoc/recommended"],
|
|
9
9
|
"parserOptions": {
|
|
10
|
-
"ecmaVersion":
|
|
10
|
+
"ecmaVersion": 2020,
|
|
11
11
|
"sourceType": "script"
|
|
12
12
|
},
|
|
13
13
|
"plugins": [
|