Skip to content

First commit #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
[
"@babel/env", {"modules": false}
]
]
}
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"env": {
"browser": true
},
"rules": {
"require-jsdoc": "error",
"no-unused-vars": "warn"
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
consumer
node_modules
.idea
dist
coverage
docs
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# cloudinary-js-base
### Hey there!

This repository is a work in in progress in a pre-alpha state.
Needless to say it's not stable.

Feel free to peak around and play with our new API.

### Interested in Cloudinary?

Feel free to visit our more mature SDKs:

- <a href="https://github.com/cloudinary/cloudinary_js"> Javascript</a>
- <a href="https://github.com/cloudinary/cloudinary-react"> React</a>
- <a href="https://github.com/cloudinary/cloudinary_angular"> Angular</a>
- <a href="https://github.com/cloudinary/cloudinary-vue"> Vue</a>
- <a href="https://github.com/cloudinary/cloudinary_npm"> Node</a>



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __DOC_RESOURCES__/cloudinaryicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions __TESTS__/unit/actions/Resize.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Test', () => {
it('works', () => {
expect(true).toBe(true);
});
});
15 changes: 15 additions & 0 deletions bundlewatch.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const bundlewatchConfig = {
files: [
{
path: './dist/base.esm.js',
maxSize: '10kb'
},
{
path: './dist/base.umd.js',
maxSize: '10kb'
}
],
defaultCompression: 'gzip',
};

module.exports = bundlewatchConfig;
86 changes: 86 additions & 0 deletions dev/base.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}

function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}

function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}

console.log('Side effect');

var Transformation = /*#__PURE__*/function () {
function Transformation() {
_classCallCheck(this, Transformation);

console.log('Transformation! - within constructor');
}
/**
* @return {Transformation}
*/


_createClass(Transformation, [{
key: "chain",
value: function chain() {
return this;
}
/**
* @return {Transformation}
*/

}, {
key: "addAction",
value: function addAction() {
return this;
}
}]);

return Transformation;
}();

/**
*
* @param {string} publicID
* @param {Transformation} transformation
*/

function cloudinaryURL(publicID, transformation) {
console.log('Cloudinary URL!', transformation);
return publicID;
}

/**
*
* @param {number} x
* @return {number}
*/
function resize(x) {
return x;
}

/**
* @description a class
*/

var Base = function Base() {
_classCallCheck(this, Base);

console.log("TADAAAAA, now you see me now don't");
console.log('More magic');
};

export { Base, resize as Resize, Transformation, cloudinaryURL };
4 changes: 4 additions & 0 deletions dev/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {Base} from './base.esm.js'
new Base();

console.log ('this works');
12 changes: 12 additions & 0 deletions dev/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Local Labs Environment</title>
<script type="module" src="./base.esm.js"></script>
<script type="module" src="./dev.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
14 changes: 14 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"bail": true,
"collectCoverageFrom": [
"src/**/*.js"
],
"coverageThreshold": {
"global": {
"branches": 95,
"functions": 95,
"lines": 95,
"statements": 95
}
}
}
30 changes: 30 additions & 0 deletions jsdoc.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"source": {
"include": ["src"],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [
"plugins/markdown"
],
"templates": {
"cleverLinks": true,
"monospaceLinks": true,
"systemColor": "#071BA",
"systemName": "Cloudinary JS.2.0 SDK",
"systemLogo": "__DOC_RESOURCES__/cloudinaryicon.png",
"systemSummary": "@cloudinary/base",
"favicon": "__DOC_RESOURCES__/cloudinary_icon_solid.png",
"copyright": "Copyright © 2020 Cloudinary.com"
},
"opts": {
"destination": "docs",
"recurse": true,
"readme": "README.md",
"template": "./node_modules/foodoc/template"
}
}
Loading