codesandboxer
Advanced tools
Comparing version 0.7.2 to 1.0.0
# Changelog | ||
## 1.0.0 | ||
- [minor] [0b60604](https://github.com/codesandbox/codesandboxer/commit/0b60604): | ||
- Centralise decision around what template to use into one location, and allow it to be exported for downstream packages. | ||
- [major] [b46e059](https://github.com/codesandbox/codesandboxer/commit/b46e059): | ||
- Move codesandboxer and codesandboxer-fs to first major version, as they exist in a fairly stable and used state. | ||
## 0.7.2 | ||
@@ -4,0 +10,0 @@ - [patch] [82a4f5f](https://github.com/Noviny/codesandboxer/commit/82a4f5f): |
@@ -19,6 +19,2 @@ 'use strict'; | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); | ||
@@ -44,2 +40,6 @@ | ||
var _ensureExtensionAndTemplate = require('./ensureExtensionAndTemplate'); | ||
var _ensureExtensionAndTemplate2 = _interopRequireDefault(_ensureExtensionAndTemplate); | ||
var _fetchInternalDependencies = require('./fetchInternalDependencies'); | ||
@@ -71,3 +71,3 @@ | ||
var extensionsSet, extension, baseFilesToUse, config, pkg, _ref3, file, deps, internalImports, fileName, files, final; | ||
var extension, config, pkg, _ref3, file, deps, internalImports, fileName, files, final; | ||
@@ -78,34 +78,13 @@ return _regenerator2.default.wrap(function _callee$(_context) { | ||
case 0: | ||
extensionsSet = new _set2.default(extensions); | ||
extension = _pathBrowserify2.default.extname(examplePath) || '.js'; | ||
extensionsSet.add(extension); | ||
if (['.ts', '.tsx'].includes(extension) || template === 'create-react-app-typescript') { | ||
if (!template) template = 'create-react-app-typescript'; | ||
extensionsSet.add('.ts'); | ||
extensionsSet.add('.tsx'); | ||
} | ||
if (extension === '.vue' || template === 'vue-cli') { | ||
if (!template) template = 'vue-cli'; | ||
extensionsSet.add('.vue'); | ||
} | ||
baseFilesToUse = _templates2.default[template]; | ||
if (!baseFilesToUse) baseFilesToUse = _templates2.default['create-react-app']; | ||
if (!template) template = 'create-react-app'; | ||
config = { extensions: extensions, template: template }; | ||
_context.next = 11; | ||
config = (0, _ensureExtensionAndTemplate2.default)(extension, extensions, template); | ||
_context.next = 4; | ||
return (0, _ensurePkgJSON2.default)(pkgJSON, importReplacements, gitInfo, config); | ||
case 11: | ||
case 4: | ||
pkg = _context.sent; | ||
_context.next = 14; | ||
_context.next = 7; | ||
return (0, _ensureExample2.default)(example, importReplacements, pkg, examplePath, gitInfo, config); | ||
case 14: | ||
case 7: | ||
_ref3 = _context.sent; | ||
@@ -116,3 +95,3 @@ file = _ref3.file; | ||
fileName = 'example' + extension; | ||
files = (0, _extends4.default)({}, baseFilesToUse, (0, _defineProperty3.default)({}, fileName, { | ||
files = (0, _extends4.default)({}, _templates2.default[config.template], (0, _defineProperty3.default)({}, fileName, { | ||
content: (0, _replaceImports2.default)(file, internalImports.map(function (m) { | ||
@@ -122,3 +101,3 @@ return [m, './' + (0, _resolvePath2.default)(examplePath, m)]; | ||
})); | ||
_context.next = 22; | ||
_context.next = 15; | ||
return (0, _fetchInternalDependencies2.default)(internalImports.map(function (m) { | ||
@@ -128,7 +107,7 @@ return (0, _resolvePath2.default)(examplePath, m); | ||
case 22: | ||
case 15: | ||
final = _context.sent; | ||
return _context.abrupt('return', (0, _extends4.default)({}, final, { template: template, fileName: fileName })); | ||
return _context.abrupt('return', (0, _extends4.default)({}, final, { template: config.template, fileName: fileName })); | ||
case 24: | ||
case 17: | ||
case 'end': | ||
@@ -135,0 +114,0 @@ return _context.stop(); |
@@ -1,12 +0,12 @@ | ||
"use strict"; | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
var _stringify = require("babel-runtime/core-js/json/stringify"); | ||
var _stringify = require('babel-runtime/core-js/json/stringify'); | ||
var _stringify2 = _interopRequireDefault(_stringify); | ||
var _lzString = require("lz-string"); | ||
var _lzString = require('lz-string'); | ||
@@ -18,9 +18,9 @@ var _lzString2 = _interopRequireDefault(_lzString); | ||
function compress(input) { | ||
return _lzString2.default.compressToBase64(input).replace(/\+/g, "-") // Convert '+' to '-' | ||
.replace(/\//g, "_") // Convert '/' to '_' | ||
.replace(/=+$/, ""); // Remove ending '=' | ||
return _lzString2.default.compressToBase64(input).replace(/\+/g, '-') // Convert '+' to '-' | ||
.replace(/\//g, '_') // Convert '/' to '_' | ||
.replace(/=+$/, ''); // Remove ending '=' | ||
} | ||
function getParameters(files) { | ||
return compress((0, _stringify2.default)(files)); | ||
return compress((0, _stringify2.default)(files)); | ||
} | ||
exports.default = getParameters; |
@@ -55,2 +55,11 @@ 'use strict'; | ||
var _ensureExtensionAndTemplate = require('./fetchFiles/ensureExtensionAndTemplate'); | ||
Object.defineProperty(exports, 'ensureExtensionAndTemplate', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_ensureExtensionAndTemplate).default; | ||
} | ||
}); | ||
var _sendFilesToCSB = require('./sendFilesToCSB'); | ||
@@ -57,0 +66,0 @@ |
{ | ||
"name": "codesandboxer", | ||
"version": "0.7.2", | ||
"version": "1.0.0", | ||
"description": "Fetch files from a git repository and upload them to codesandbox", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
67683
32
1307
1