Upgrade to Pro — share decks privately, control downloads, hide ads and more …

一休.comにおけるfrontend開発

yusuke sasajima
March 29, 2016
1.3k

 一休.comにおけるfrontend開発

yusuke sasajima

March 29, 2016
Tweet

Transcript

  1. ࣮ࡍͷbatϑΝΠϧʢҰ෦ʣ @call npm -g list | findstr /I "[email protected]" >

    nul 2>&1 @if errorlevel 1 ( %LOGGER% "### Installing TypeScript with npm." @call npm install -g [email protected] >> %LOGFILE% 2>&1 ) else ( %LOGGER% "### typescript is installed." ) @call npm -g list | findstr /I "gulp" > nul 2>&1 @if errorlevel 1 ( %LOGGER% "### Installing gulp with npm." @call npm install -g gulp >> %LOGFILE% 2>&1 ) else ( %LOGGER% "### gulp is installed." ) @call npm -g list | findstr /I "[email protected]" > nul 2>&1 @if errorlevel 1 ( %LOGGER% "### Installing bower with npm." @call npm install -g [email protected] >> %LOGFILE% 2>&1 ) else ( %LOGGER% "### bower is installed." )
  2. TypeScriptͷϏϧυʢൈਮʣ var gulp = require('gulp'); var typescript = require('gulp-typescript'); var

    uglify = require('gulp-uglify'); var sourcemaps = require('gulp-sourcemaps'); var plumber = require('gulp-plumber'); var notify = require('gulp-notify'); exports.createGulpTask = function (subDir, taskName) { return function () { gulp.src([INPUT_ROOT_DIR + subDir + taskName + '.ts']) .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) .pipe(sourcemaps.init()) .pipe(typescript(createTypeScriptConfig(taskName + '.js'))) .js .pipe(uglify()) .pipe(sourcemaps.write('.', { sourceRoot: INPUT_ROOT_DIR })) .pipe(gulp.dest(OUTPUT_ROOT_DIR + subDir)); } }
  3. SassͷϏϧυʢൈਮʣ var gulp = require('gulp'); var compass = require('gulp-compass'); var

    plumber = require('gulp-plumber'); var notify = require('gulp-notify'); exports.createGulpTask = function (subDir, taskName) { return function(){ gulp.src(INPUT_ROOT_DIR + subDir + taskName + '.scss') .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) .pipe(compass({ config_file: INPUT_ROOT_DIR + 'config.rb', comments: false, css: OUTPUT_ROOT_DIR, sass: INPUT_ROOT_DIR })); } }
  4. ݱঢ়ͷ՝୊ • ॓ധαΠτ͸ϦϓϨΠεͯ͠ɺ6೥͕ܦա • ൃੜͨ͠՝୊ • ࠶ར༻͞Εͳ͍ؔ਺ʢྨࣅؔ਺͕ଟ͍ʣ • Ͳ͔͜Βࢀর͞Ε͍ͯΔ͔Θ͔Βͳ͍jsϑΝΠϧ •

    1ϖʔδͰࢀর͢ΔjsϑΝΠϧ͕ଟ͗͢Δ • jqueryґଘʢjqueryϥΠϒϥϦଟਿʣ • ΈΜͳ޷͖উखʹೖΕͯ͠·ͬͯɺ΋͸΍Կ͕ਖ਼͍͠ͷ͔Θ͔Βͳ͍ • ࠞࡏ͢Δjqueryͷόʔδϣϯ • ΋͸΍lint͕ྲྀͤͳ͍ɻɻɻ
  5. lintͰൃੜͨ͠Τϥʔ͕Θ͔Γͮ Β͍ Error: public\ts\member\xxx.ts(42,56): error TS2345: Argument of type 'JQuery'

    is not assignable to parameter of type '(index: number, value: number) => string[]'. toString()ͷఆٛ࿙Ε
  6. jslintΛ࣮ߦ͢Δ function checkOffCoupon(msg) { var input = document.getElementById("<%= x.ClientID %>").value;

    var apply = window.document.aspnetForm.elements["<%= Me.b.CdName %>"].value; if (input != '') { if (apply == '') { if (window.document.aspnetForm.elements["<%= Me.b.StatusName %>"].value == "<%= CodeMasterFlg.False %>") { msg = msg + \n"; } else { msg = msg + \n"; } } else if (input != apply) { msg = msg + \n"; } } return msg; }
  7. jslintΛ࣮ߦ͢Δ function checkOffCoupon(msg) { var input = document.getElementById("<%= x.ClientID %>").value;

    var apply = window.document.aspnetForm.elements["<%= Me.b.CdName %>"].value; if (input != '') { if (apply == '') { if (window.document.aspnetForm.elements["<%= Me.b.StatusName %>"].value == "<%= CodeMasterFlg.False %>") { msg = msg + \n"; } else { msg = msg + \n"; } } else if (input != apply) { msg = msg + \n"; } } return msg; } ୯७ʹͦͷ··Ͱͷ࣮ߦ͸೉͍͠