Browse Source

Jigsaw init

master
Alexander Yakovlev 4 years ago
commit
68020d986d
  1. 3
      .gitignore
  2. 17
      bootstrap.php
  3. 7
      config.php
  4. 11208
      package-lock.json
  5. 25
      package.json
  6. 0
      source/_assets/js/main.js
  7. 18
      source/_assets/sass/main.scss
  8. 12
      source/_layouts/master.blade.php
  9. 7909
      source/assets/build/css/main.css
  10. 91
      source/assets/build/js/main.js
  11. 4
      source/assets/build/mix-manifest.json
  12. BIN
      source/assets/images/jigsaw.png
  13. 93
      source/index.blade.php
  14. 19
      tasks/bin.js
  15. 46
      tasks/build.js
  16. 24
      webpack.mix.js
  17. 7419
      yarn.lock

3
.gitignore vendored

@ -0,0 +1,3 @@
/build_local/
/node_modules/
/vendor/

17
bootstrap.php

@ -0,0 +1,17 @@
<?php
use TightenCo\Jigsaw\Jigsaw;
/** @var $container \Illuminate\Container\Container */
/** @var $events \TightenCo\Jigsaw\Events\EventBus */
/**
* You can run custom code at different stages of the build process by
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
*
* For example:
*
* $events->beforeBuild(function (Jigsaw $jigsaw) {
* // Your code here
* });
*/

7
config.php

@ -0,0 +1,7 @@
<?php
return [
'baseUrl' => '',
'production' => false,
'collections' => [],
];

11208
package-lock.json generated

File diff suppressed because it is too large Load Diff

25
package.json

@ -0,0 +1,25 @@
{
"private": true,
"scripts": {
"local": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --env=local --config=node_modules/laravel-mix/setup/webpack.config.js",
"staging": "cross-env NODE_ENV=staging node_modules/webpack/bin/webpack.js --progress --hide-modules --env=staging --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --env=production --config=node_modules/laravel-mix/setup/webpack.config.js",
"dev": "npm run local",
"watch": "npm run local -- --watch"
},
"devDependencies": {
"browser-sync": "^2.23.6",
"browser-sync-webpack-plugin": "^2.0.1",
"cross-env": "^3.2.3",
"hasbin": "^1.2.3",
"laravel-mix": "^2.0.0",
"node-cmd": "^3.0.0",
"on-build-webpack": "^0.1.0",
"webpack-watch": "^0.2.0",
"yargs": "^4.6.0"
},
"dependencies": {
"bootstrap": "^4.1.3",
"fork-awesome": "^1.1.5"
}
}

0
source/_assets/js/main.js

18
source/_assets/sass/main.scss

@ -0,0 +1,18 @@
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";
@import "node_modules/bootstrap/scss/root";
@import "node_modules/bootstrap/scss/reboot";
@import "node_modules/bootstrap/scss/type";
@import "node_modules/bootstrap/scss/grid";
@import "node_modules/bootstrap/scss/utilities";
@import "node_modules/bootstrap/scss/print";
@import "node_modules/fork-awesome/scss/fork-awesome";
small, .small {
font-weight: 400;
font-size: 14pt;
}
.portfolio-item {
margin-bottom: 25px;
}

12
source/_layouts/master.blade.php

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="stylesheet" href="{{ mix('css/main.css', 'assets/build') }}">
</head>
<body>
@yield('body')
</body>
</html>

7909
source/assets/build/css/main.css

File diff suppressed because it is too large Load Diff

91
source/assets/build/js/main.js

@ -0,0 +1,91 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./source/_assets/js/main.js":
/***/ (function(module, exports) {
/***/ }),
/***/ "./source/_assets/sass/main.scss":
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ 0:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./source/_assets/js/main.js");
module.exports = __webpack_require__("./source/_assets/sass/main.scss");
/***/ })
/******/ });

4
source/assets/build/mix-manifest.json

@ -0,0 +1,4 @@
{
"/js/main.js": "/js/main.js?id=05ad077c374bc8aa0eca",
"/css/main.css": "/css/main.css?id=08a28b14c317ac7c3510"
}

BIN
source/assets/images/jigsaw.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

93
source/index.blade.php

@ -0,0 +1,93 @@
@extends('_layouts.master')
@section('body')
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Работа
</h1>
</div>
</div>
<div class="row">
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://upwork.com">Upwork</a>
</h3>
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://freelancer.com">Freelancer</a>
</h3>
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://destrier.plentiful.shop">MantisBT</a>
</h3>
<p>Управление проектами</p>
</div>
</div>
<div class="row">
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://github.com/issues/assigned">GitHub</a>
</h3>
<p>Задачи</p>
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://trello.com">Trello</a>
</h3>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Разное
<small>В основном новости</small>
</h1>
</div>
</div>
<div class="row">
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://netreader.oreolek.ru">Tiny Tiny RSS</a>
</h3>
<p>Сборник новостей</p>
</div>
<div class="col-md-4 portfolio-item">
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://ideabin.oreolek.ru">
Вики
</a>
</h3>
<p>Собственные проекты (текстовые материалы)</p>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Интерактивная литература
<small></small>
</h1>
</div>
</div>
<div class="row">
<div class="col-md-4 portfolio-item">
<h3>
<a href="https://ifhub.club">Ифхаб</a>
</h3>
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="http://ifiction.ru">Главная ifiction.ru</a>
</h3>
</div>
<div class="col-md-4 portfolio-item">
<h3>
<a href="http://ifwiki.ru">IFWiki.ru</a>
</h3>
</div>
</div>
</div>
@endsection

19
tasks/bin.js

@ -0,0 +1,19 @@
var hasbin = require('hasbin');
var fs = require('fs');
var path = require('path');
module.exports = {
path: function() {
if (fs.existsSync('./vendor/bin/jigsaw')) {
return path.normalize('./vendor/bin/jigsaw')
}
if (hasbin.sync('jigsaw')) {
return 'jigsaw';
}
console.log('Could not find Jigsaw; please install it via Composer, either locally or globally.');
process.exit();
}
};

46
tasks/build.js

@ -0,0 +1,46 @@
let argv = require('yargs').argv;
let bin = require('./bin');
let command = require('node-cmd');
let AfterWebpack = require('on-build-webpack');
let BrowserSync = require('browser-sync');
let BrowserSyncPlugin = require('browser-sync-webpack-plugin');
let Watch = require('webpack-watch');
let browserSyncInstance;
let env = argv.e || argv.env || 'local';
let port = argv.p || argv.port || 3000;
module.exports = {
jigsaw: new AfterWebpack(() => {
command.get(bin.path() + ' build ' + env, (error, stdout, stderr) => {
console.log(error ? stderr : stdout);
if (browserSyncInstance) {
browserSyncInstance.reload();
}
});
}),
watch: function(paths) {
return new Watch({
options: { ignoreInitial: true },
paths: paths,
})
},
browserSync: function(proxy) {
return new BrowserSyncPlugin({
notify: false,
port: port,
proxy: proxy,
server: proxy ? null : { baseDir: 'build_' + env + '/' },
},
{
reload: false,
callback: function() {
browserSyncInstance = BrowserSync.get('bs-webpack-plugin');
},
})
},
};

24
webpack.mix.js

@ -0,0 +1,24 @@
let mix = require('laravel-mix');
let build = require('./tasks/build.js');
mix.disableSuccessNotifications();
mix.setPublicPath('source/assets/build');
mix.webpackConfig({
plugins: [
build.jigsaw,
build.browserSync(),
build.watch(['source/**/*.md', 'source/**/*.php', 'source/**/*.scss', '!source/**/_tmp/*']),
]
});
mix.js('source/_assets/js/main.js', 'js')
.sass('source/_assets/sass/main.scss', 'css')
.options({
processCssUrls: false,
})
if (mix.inProduction()) {
mix.version();
} else {
mix.sourceMaps();
}

7419
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save