Web Starter Kitããã¯ãããã¢ãã³ãªã¦ã§ããµã¤ãå¶ä½ (201512ç)
ã¯ããã«
ãã®è¨äºã¯ããªã³ã ã¢ããã³ãã«ã¬ã³ãã¼ãã®1ã®22æ¥ç®ã®è¨äºã§ãã 21æ¥ç®ã¯ãshinya131ããã® エンジニアからデータ分析になって3ヶ月が経った - 機略戦記 ã§ããã
ã¾ããããªã³ã ã¢ããã³ãã«ã¬ã³ãã¼ãã®2ãããã¾ãã
whoami
æ°å1å¹´ç®ã®ã¨ã³ã¸ãã¢ã®Fuyaã§ãã社å ã§ã¯ãã¤ã¶ãããã¨å¼ã°ãã¦ãã¾ãã 大å¦æ代ããããã°ã©ãã³ã°ãã¯ããã¦ã"ãã¼ã ãã¼ã¸ãä½ãã"Webæè¡ã好ãã«ãªã£ã¦ãã¾ãä»ã«ãããã¾ãã
æ®æ®µã¯Railsã¨ã³ã¸ãã¢ã¨ãã¦ä»äºããã¦ãã¾ãããããã³ãã¨ã³ãçãªã°ã«ã¼ãã«ãæå±ãã¦ãã¦ã ã¦ã¼ã¶ããã«è¿ãããã³ãã¨ã³ãé åãããµã¼ãã¹ãä½ãããã¨æã£ã¦ã¾ãã
æè¿meguro.esã¨ããåå¼·ä¼ã§çºè¡¨ãã¾ããã
ããã³ãã¨ã³ãçéã«ã¤ãã¦
ããã³ãã¨ã³ãã®åéã¯æ°ãããã®ã次ã ã¨çã¾ãã¦ã¯æ¶ãã¦ãã¾ãã 2é±éãæ å ±ãéããã®ãæ ã£ã¦ãã¾ãã¨ãããã«å¨ãã®ã¨ã³ã¸ãã¢ãä½ã«å¤¢ä¸ã«ãªã£ã¦ããã®ããããªããªãã¾ãã浦島太éç¶æ ã§ãã
å ¨é¨ã®æè¡ã»ãã¼ã«ãæ¯æ¥è¿½ãç¶ããã®ã¯ã¨ã¦ãããã©ãã§ããæéã足ãã¾ããã楽ããã§ããããã©ãã§ãã ä»åã¯ãWeb Starter Kitã使ã£ããã¼ã¸ä½æãç´¹ä»ãã¦ãæè¿ã®Webæè¡ã®ç¾å³ããã¨ãããå°ããã¤ç°¡åã«ããã ããã¨æãã¾ãã
Web Starter Kitã¨ã¯
Web Starter Kitã¯Googleãæä¾ãããWebãã¼ã¸ãä½æãããã¤ã©ã¼ãã¬ã¼ãã§ãã ãéçãªWebãã¼ã¸ãçéã§ä½ããã¼ã«ãã§ãã
ä»åã®è¨äºã§ã¯ã2015å¹´12æ15æ¥æç¹ã®ææ°çãv0.6.0ãå ã«ã話ããã¾ãã*1 github.com
使ãæ¹
詳ãã使ãæ¹ã¯ãREADME.mdã«ããã¦ããã¾ãã®ã§ãã®è¨äºã§ã¯ç°¡åãªä½¿ãæ¹ã ã説æãã¾ãã ã¾ããã使ãã®ãã·ã³ã«Node.js ãã¤ã³ã¹ãã¼ã«ããã¦ããå¿ è¦ãããã¾ãã
対象ã®ãã£ã¬ã¯ããªã«ç§»åãã¦ã$ npm install
ã§å¿
è¦ãªãã®ãã¤ã³ã¹ãã¼ã«ãã¾ãã
次ã«ã$ gulp serve
ãå©ãã¾ããããã ãã§çµäºã§ãã
http://logalhost:3000 ã«ã¢ã¯ã»ã¹ãã¦ã¿ãã¨Webãã¼ã¸ãè¦ããã¾ãã
ããã©ã«ãã§ã¯ãã¬ã¹ãã³ã·ããã¶ã¤ã³ã®ã¢ãã³ãªãµã¤ãã表示ããã¾ãã ã§ã¯ããã®Webãã¼ã¸ã«ã¯ã©ããªæè¡ã使ããã¦ãããç°¡åã«èª¬æãã¦ããã¾ãã
headã¿ã°
Webãã¼ã¸ã§èããªããã°ãªããªãã®ããã¢ãã¤ã«å¯¾å¿ã§ãã ã¢ãã¤ã«å¯¾å¿ã«ã¯ãã¶ã¤ã³ä»¥å¤ã«ãè¨å®ããæ¹ããããã®ãå¤ãããã¾ãã Web Starter Kitã使ã£ã¦ä½ããããã¼ã¸ã«ã¯ããã¼ã ç»é¢ã«ç½®ããæã®ã¢ã¤ã³ã³ãè²ã®è¨å®ãªã©ãããã¾ãã®ç¨æãããã®ãæã£ã¦ãã¾ãã
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Add to homescreen for Chrome on Android --> <meta name="mobile-web-app-capable" content="yes"> <meta name="application-name" content="Web Starter Kit"> <link rel="icon" sizes="192x192" href="images/touch/chrome-touch-icon-192x192.png"> <!-- Add to homescreen for Safari on iOS --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="Web Starter Kit"> <link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png"> <!-- Tile icon for Win8 (144x144 + tile color) --> <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png"> <meta name="msapplication-TileColor" content="#2F3BA2"> <!-- Color the status bar on mobile devices --> <meta name="theme-color" content="#2F3BA2">
MDL
ããã©ã«ãã§è¨å®ããã¦ããCSSã®ã©ã¤ãã©ãªã¯MDLã§ãã MDLã¯ããããªã¢ã«ãã¶ã¤ã³(Introduction - Material design - Google design guidelines)ãå®ç¾ããGoogle製ã®CSSã©ã¤ãã©ãªã§ããAndroidã§ä½¿ããããããªã¢ã«ãã¶ã¤ã³ã®é¨åãã«ã¼ãããããã¿ã³ãã使ãã¾ãã
ServiceWorker
ServiceWorkerã使ã£ãããªãã©ã¤ã³ãã¼ã¸æ©è½ãWeb Stater Kitã«ã¯å«ã¾ãã¦ãã¾ãã
gulp generate-service-worker
ããã§å¿
è¦ãªã¹ã¯ãªãããçæããã¾ãã
ããã ãã§ãä¸åº¦è¦ããã¼ã¸ã¯ãã£ãã·ã¥ãè¡ãéä¿¡ç°å¢ããªãã¨ããã¼ã¸ãè¦ããã¨ãã§ãã¾ãã*2
ã¾ããServiceWorkerã使ãã¨ããã·ã¥éç¥ãã§ãã¾ãã詳ããã¯meguro.esã®çºè¡¨è³æãããããã ããã meguroes#1f - Google スライド
deploy
v0.6.0ã§ã¯ã ãããã¤ãã§ããããã«ãªãã¾ããã ãããã¤å ã¯GAEãHerokuãªã©ããã¤ãé¸ã¹ã¾ãããä»åã¯Github Pagesã使ã£ã¦è¦ããã¨æãã¾ãã
ã¯ããã«ãGithubã§ãªãã¸ããªãä½ãã¾ãã
次ã«ãããã¤ã«å¿
è¦ãªã¢ã¸ã¥ã¼ã«ãå
¥ãã¦ããã¾ããWeb Starter Kitã®ã«ã¼ããã£ã¬ã¯ããªã§ npm install --save-dev gulp-subtree
ãå®è¡ãã¾ãã
次ã«ãgulpfile.babel.jsã«ãããªã¿ã¹ã¯ãæ¸ãã¦ãã ããã
gulp.task('deploy', ['default'], () => { return gulp.src('dist') .pipe($.subtree()) });
ã¾ãã.gitignoreãã dist/
ãå¤ãã¦ãã ããã
ããã§ãããã¤æºåã¯å®äºã§ãã
æå¾ã«ãgulp deploy
ã³ãã³ããæã¤ã¨gh-pageãã©ã³ããä½æããGithubã«pushããã¾ãã
æ°åæéãçµã¦ã°Github Pagesã§é²è¦§ã§ãã¾ãã
å®éã«å ¬éãã¦ã¿ã¾ããã http://fuya.github.io/wsk/ ãªãã©ã¤ã³ãã£ãã·ã¥ã«ã対å¿ãã¦ãã¾ãã Github Pagesã¯å ¨ãã¼ã¸ãHTTPSãªã®ã§ãServiceWorkerã使ãã¾ããã
ãããã«
Web Starter Kitã¯ãå¤ãã®æè¡ããã¼ã«ãå«ã¾ãã¦ãã¾ãã
æµè¡ãã®æè¡(ã¾ãã¯Googleãæµè¡ããããæè¡)ãå«ã¾ãã¦ããã®ã§ã試ãã«è§¦ã£ã¦ã¿ããã¨ã§ é·ãä»ãåãã«ãªããã¼ã«ã¨åºä¼ããããããã¾ããã
åãWeb Starter Kitã使ã£ã¦gruntããgulpã«ä¹ãæãã¾ããã ãªãªã¼ã¹ããã¦1年以ä¸çµã¡ã¾ãããã¾ã ã¾ã æ´æ°ããã¦æ°ããªè¦ç´ ãå ¥ã£ã¦ãã¾ãã å¿ããæã¯Web Starter Kitã®ä¸èº«ã ã追ã£ã¦ã¿ãã¨ããã®ã§ãè¯ãã®ã§ã¯ãªããã¨æã£ã¦ãã¾ãã
ããããã³ãã¨ã³ãã©ã¤ãããéããã ããï¼ï¼
ææ¥ã¯...
ææ¥ã¯ãåæå ¥ç¤¾ã®wagiããã®è¨äºã§ãã