mirror of
https://github.com/atom/atom.git
synced 2026-01-25 23:08:18 -05:00
more progress
This commit is contained in:
@@ -6,7 +6,7 @@ const transpileBabelPaths = require('./lib/transpile-babel-paths')
|
||||
const transpileCoffeeScriptPaths = require('./lib/transpile-coffee-script-paths')
|
||||
|
||||
function transpile () {
|
||||
// transpileBabelPaths()
|
||||
transpileBabelPaths()
|
||||
transpileCoffeeScriptPaths()
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,14 @@ const appMetadata = require('../package.json')
|
||||
const repositoryRootPath = path.resolve(__dirname, '..')
|
||||
const buildOutputPath = path.join(repositoryRootPath, 'out')
|
||||
|
||||
const appName = appMetadata.productName
|
||||
let appName = appMetadata.productName
|
||||
const appFileName = appMetadata.name
|
||||
|
||||
let electronRootPath, electronAppPath
|
||||
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
appName += '.app'
|
||||
electronRootPath = path.join(buildOutputPath, appName, 'Contents')
|
||||
electronAppPath = path.join(electronRootPath, 'Resources', 'app')
|
||||
break;
|
||||
|
||||
@@ -24,6 +24,7 @@ const PREFIX_LENGTH = Math.max.apply(null, BABEL_PREFIXES.map(prefix => prefix.l
|
||||
const BUFFER = Buffer(PREFIX_LENGTH)
|
||||
|
||||
function transpileBabelPaths () {
|
||||
console.log('Transpiling Babel paths...');
|
||||
for (let srcPath of glob.sync(`${CONFIG.repositoryRootPath}/src/**/*.js`)) {
|
||||
if (usesBabel(srcPath)) {
|
||||
transpileBabelPath(srcPath, computeDestinationPath(srcPath))
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const coffee = require('coffee-script')
|
||||
const fs = require('fs')
|
||||
const glob = require('glob')
|
||||
const mkdirp = require('mkdirp')
|
||||
const path = require('path')
|
||||
|
||||
const CONFIG = require('../config')
|
||||
@@ -18,8 +21,9 @@ const GLOBS = [
|
||||
|
||||
module.exports =
|
||||
function transpileCoffeeScriptPaths () {
|
||||
console.log('Transpiling CoffeeScript paths...');
|
||||
for (let srcPath of getPathsToTranspile()) {
|
||||
transpileCoffeeScriptPath(srcPath, computeDestinationPath(srcPath))
|
||||
transpileCoffeeScriptPath(srcPath, computeDestinationPath(srcPath).replace(/coffee$/, 'js'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +36,8 @@ function getPathsToTranspile () {
|
||||
}
|
||||
|
||||
function transpileCoffeeScriptPath (srcPath, destPath) {
|
||||
console.log(srcPath);
|
||||
const inputCode = fs.readFileSync(srcPath, 'utf8')
|
||||
let outputCode = coffee.compile(inputCode)
|
||||
mkdirp.sync(path.dirname(destPath))
|
||||
fs.writeFileSync(destPath, outputCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user