codesandboxer
Advanced tools
Comparing version 0.7.0 to 0.7.1
# Changelog | ||
## 0.7.1 | ||
- [patch] af01387: | ||
- Share information on the main example's filename and use this in the url | ||
## 0.7.0 | ||
@@ -4,0 +9,0 @@ - [patch] 4b2b662: |
@@ -11,3 +11,4 @@ 'use strict'; | ||
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 's'; | ||
return 'https://codesandbox.io/' + type + '/' + id + '?module=/example'; | ||
var fileName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'example'; | ||
return 'https://codesandbox.io/' + type + '/' + id + '?module=/' + fileName; | ||
}; |
@@ -69,3 +69,3 @@ 'use strict'; | ||
var extensionsSet, extension, baseFilesToUse, config, pkg, _ref3, file, deps, internalImports, files, final; | ||
var extensionsSet, extension, baseFilesToUse, config, pkg, _ref3, file, deps, internalImports, fileName, files, final; | ||
@@ -112,3 +112,4 @@ return _regenerator2.default.wrap(function _callee$(_context) { | ||
internalImports = _ref3.internalImports; | ||
files = (0, _extends4.default)({}, baseFilesToUse, (0, _defineProperty3.default)({}, 'example' + extension, { | ||
fileName = 'example' + extension; | ||
files = (0, _extends4.default)({}, baseFilesToUse, (0, _defineProperty3.default)({}, fileName, { | ||
content: (0, _replaceImports2.default)(file, internalImports.map(function (m) { | ||
@@ -118,3 +119,3 @@ return [m, './' + (0, _resolvePath2.default)(examplePath, m)]; | ||
})); | ||
_context.next = 21; | ||
_context.next = 22; | ||
return (0, _fetchInternalDependencies2.default)(internalImports.map(function (m) { | ||
@@ -124,7 +125,7 @@ return (0, _resolvePath2.default)(examplePath, m); | ||
case 21: | ||
case 22: | ||
final = _context.sent; | ||
return _context.abrupt('return', (0, _extends4.default)({}, final, { template: template })); | ||
return _context.abrupt('return', (0, _extends4.default)({}, final, { template: template, fileName: fileName })); | ||
case 23: | ||
case 24: | ||
case 'end': | ||
@@ -131,0 +132,0 @@ return _context.stop(); |
@@ -26,3 +26,5 @@ 'use strict'; | ||
name = _config.name, | ||
main = _config.main; | ||
main = _config.main, | ||
_config$fileName = _config.fileName, | ||
fileName = _config$fileName === undefined ? 'example' : _config$fileName; | ||
@@ -57,3 +59,4 @@ var dependencies = (0, _extends3.default)({}, deps, extraDependencies); | ||
dependencies: dependencies, | ||
parameters: parameters | ||
parameters: parameters, | ||
fileName: fileName | ||
}; | ||
@@ -60,0 +63,0 @@ }; |
@@ -16,4 +16,4 @@ 'use strict'; | ||
var sendFilesToCSB = function () { | ||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(parameters) { | ||
var formData; | ||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(parameters, config) { | ||
var fileName, type, formData; | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
@@ -23,2 +23,5 @@ while (1) { | ||
case 0: | ||
if (!config) config = {}; | ||
fileName = config.fileName ? config.fileName : 'example'; | ||
type = config.type ? config.type : 's'; | ||
formData = new _formData2.default(); | ||
@@ -41,7 +44,7 @@ | ||
sandboxId: sandbox_id, | ||
sandboxUrl: (0, _constants.getSandboxUrl)(sandbox_id) | ||
sandboxUrl: (0, _constants.getSandboxUrl)(sandbox_id, type, fileName) | ||
}; | ||
})); | ||
case 3: | ||
case 6: | ||
case 'end': | ||
@@ -54,3 +57,3 @@ return _context.stop(); | ||
return function sendFilesToCSB(_x) { | ||
return function sendFilesToCSB(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
@@ -57,0 +60,0 @@ }; |
{ | ||
"name": "codesandboxer", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Fetch files from a git repository and upload them to codesandbox", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
65572
1265