Skip to content

Commit bd67553

Browse files
Merge pull request #543 from cloudinary/ME-3762-import-statements-in-code-snippets
Add importStatementsTemplate to langConfig
2 parents 93e9d0a + 1c52c64 commit bd67553

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

.code-generation/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ module.exports = {
6262
}
6363
},
6464
unsupportedTxParams: ['fl_waveform', 'e_theme', 'af_'],
65-
unsupportedSyntaxList: ['.stroke(', '.textFit(', 'Animated.edit', '.RoundCorners(', 'getVideoFrame']
65+
unsupportedSyntaxList: ['.stroke(', '.textFit(', 'Animated.edit', '.RoundCorners(', 'getVideoFrame'],
66+
importStatementsTemplate: {
67+
action: `import { <NAME> } from "@cloudinary/url-gen/actions/<GROUP>";`,
68+
qualifier: `import { <NAME> } from "@cloudinary/url-gen/qualifiers/<GROUP>";`,
69+
}
6670
},
6771
"overwrites": {
6872
qualifiers: {

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
dist: focal
12
language: node_js
23
node_js:
3-
- "12"
44
- "14"
5+
- "16"
6+
# - "18" # Not supported yet (ref. error:0308010C:digital envelope routines::unsupported)
57
script:
68
- npm run lint
79
- npm run test

__TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const bundleSizeTestCases:ITestCase[] = [
7474
},
7575
{
7676
name: 'Import all of the SDK',
77-
sizeLimitInKB: 128,
77+
sizeLimitInKB: 129,
7878
importsArray: [
7979
importFromPackage('* as CloudinaryURLGEN')
8080
]
@@ -88,7 +88,7 @@ const bundleSizeTestCases:ITestCase[] = [
8888
},
8989
{
9090
name: 'Import All Actions',
91-
sizeLimitInKB: 55,
91+
sizeLimitInKB: 56,
9292
importsArray: [
9393
importFromPackage('Actions')
9494
]

src/backwards/utils/legacyBaseUtil.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const withCamelCaseKeys = function(source: {}) {
1818
* @return {string} in camelCase format
1919
*/
2020
export const camelCase = function(source: string) {
21-
var words = source.match(reWords);
21+
let words : string[] = source.match(reWords);
22+
2223
words = words.map(word=> word.charAt(0).toLocaleUpperCase() + word.slice(1).toLocaleLowerCase());
2324
words[0] = words[0].toLocaleLowerCase();
2425

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"esModuleInterop": true,
99
"resolveJsonModule": true,
1010
"allowJs": true,
11+
"skipLibCheck": true
1112
},
1213
"include": [
1314
"src"

tsconfig.test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"moduleResolution": "node",
77
"esModuleInterop": true,
88
"noEmit": true,
9-
"resolveJsonModule": true
9+
"resolveJsonModule": true,
10+
"skipLibCheck": true
1011
},
1112
"include": [
1213
"src",

0 commit comments

Comments
 (0)