Skip to content

Commit 774f353

Browse files
First commit (#1)
1 parent eb82142 commit 774f353

27 files changed

+10228
-1
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/env", {"modules": false}
5+
]
6+
]
7+
}

.eslintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"parserOptions": {
4+
"ecmaVersion": 2018,
5+
"sourceType": "module"
6+
},
7+
"env": {
8+
"browser": true
9+
},
10+
"rules": {
11+
"require-jsdoc": "error",
12+
"no-unused-vars": "warn"
13+
}
14+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
consumer
2+
node_modules
3+
.idea
4+
dist
5+
coverage
6+
docs

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
# cloudinary-js-base
1+
### Hey there!
2+
3+
This repository is a work in in progress in a pre-alpha state.
4+
Needless to say it's not stable.
5+
6+
Feel free to peak around and play with our new API.
7+
8+
### Interested in Cloudinary?
9+
10+
Feel free to visit our more mature SDKs:
11+
12+
- <a href="https://github.com/cloudinary/cloudinary_js"> Javascript</a>
13+
- <a href="https://github.com/cloudinary/cloudinary-react"> React</a>
14+
- <a href="https://github.com/cloudinary/cloudinary_angular"> Angular</a>
15+
- <a href="https://github.com/cloudinary/cloudinary-vue"> Vue</a>
16+
- <a href="https://github.com/cloudinary/cloudinary_npm"> Node</a>
17+
18+
19+

__DOC_RESOURCES__/cloudinary_icon_solid.png

Loading

__DOC_RESOURCES__/cloudinaryicon.png

2.12 KB
Loading

__TESTS__/unit/actions/Resize.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('Test', () => {
2+
it('works', () => {
3+
expect(true).toBe(true);
4+
});
5+
});

bundlewatch.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const bundlewatchConfig = {
2+
files: [
3+
{
4+
path: './dist/base.esm.js',
5+
maxSize: '10kb'
6+
},
7+
{
8+
path: './dist/base.umd.js',
9+
maxSize: '10kb'
10+
}
11+
],
12+
defaultCompression: 'gzip',
13+
};
14+
15+
module.exports = bundlewatchConfig;

dev/base.esm.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
function _classCallCheck(instance, Constructor) {
2+
if (!(instance instanceof Constructor)) {
3+
throw new TypeError("Cannot call a class as a function");
4+
}
5+
}
6+
7+
function _defineProperties(target, props) {
8+
for (var i = 0; i < props.length; i++) {
9+
var descriptor = props[i];
10+
descriptor.enumerable = descriptor.enumerable || false;
11+
descriptor.configurable = true;
12+
if ("value" in descriptor) descriptor.writable = true;
13+
Object.defineProperty(target, descriptor.key, descriptor);
14+
}
15+
}
16+
17+
function _createClass(Constructor, protoProps, staticProps) {
18+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
19+
if (staticProps) _defineProperties(Constructor, staticProps);
20+
return Constructor;
21+
}
22+
23+
console.log('Side effect');
24+
25+
var Transformation = /*#__PURE__*/function () {
26+
function Transformation() {
27+
_classCallCheck(this, Transformation);
28+
29+
console.log('Transformation! - within constructor');
30+
}
31+
/**
32+
* @return {Transformation}
33+
*/
34+
35+
36+
_createClass(Transformation, [{
37+
key: "chain",
38+
value: function chain() {
39+
return this;
40+
}
41+
/**
42+
* @return {Transformation}
43+
*/
44+
45+
}, {
46+
key: "addAction",
47+
value: function addAction() {
48+
return this;
49+
}
50+
}]);
51+
52+
return Transformation;
53+
}();
54+
55+
/**
56+
*
57+
* @param {string} publicID
58+
* @param {Transformation} transformation
59+
*/
60+
61+
function cloudinaryURL(publicID, transformation) {
62+
console.log('Cloudinary URL!', transformation);
63+
return publicID;
64+
}
65+
66+
/**
67+
*
68+
* @param {number} x
69+
* @return {number}
70+
*/
71+
function resize(x) {
72+
return x;
73+
}
74+
75+
/**
76+
* @description a class
77+
*/
78+
79+
var Base = function Base() {
80+
_classCallCheck(this, Base);
81+
82+
console.log("TADAAAAA, now you see me now don't");
83+
console.log('More magic');
84+
};
85+
86+
export { Base, resize as Resize, Transformation, cloudinaryURL };

dev/dev.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {Base} from './base.esm.js'
2+
new Base();
3+
4+
console.log ('this works');

dev/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Local Labs Environment</title>
6+
<script type="module" src="./base.esm.js"></script>
7+
<script type="module" src="./dev.js"></script>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
</body>
12+
</html>

jest.config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"bail": true,
3+
"collectCoverageFrom": [
4+
"src/**/*.js"
5+
],
6+
"coverageThreshold": {
7+
"global": {
8+
"branches": 95,
9+
"functions": 95,
10+
"lines": 95,
11+
"statements": 95
12+
}
13+
}
14+
}

jsdoc.config.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true,
4+
"dictionaries": ["jsdoc","closure"]
5+
},
6+
"source": {
7+
"include": ["src"],
8+
"includePattern": ".+\\.js(doc|x)?$",
9+
"excludePattern": "(^|\\/|\\\\)_"
10+
},
11+
"plugins": [
12+
"plugins/markdown"
13+
],
14+
"templates": {
15+
"cleverLinks": true,
16+
"monospaceLinks": true,
17+
"systemColor": "#071BA",
18+
"systemName": "Cloudinary JS.2.0 SDK",
19+
"systemLogo": "__DOC_RESOURCES__/cloudinaryicon.png",
20+
"systemSummary": "@cloudinary/base",
21+
"favicon": "__DOC_RESOURCES__/cloudinary_icon_solid.png",
22+
"copyright": "Copyright © 2020 Cloudinary.com"
23+
},
24+
"opts": {
25+
"destination": "docs",
26+
"recurse": true,
27+
"readme": "README.md",
28+
"template": "./node_modules/foodoc/template"
29+
}
30+
}

0 commit comments

Comments
 (0)