My Module structure is this.
install_logging
├── files
│ └── install_logging.sh
├── Gemfile
├── Gemfile.lock
├── manifests
│ ├── \
│ ├── empty.rb
│ └── init.pp
├── Modulefile
├── Rakefile
├── README
├── spec
│ ├── chkcls_sec.rb
│ ├── classes
│ │ ├── init1_spec.rb
│ │ ├── init_spec.rb
│ │ └── spec_helper.rb
│ ├── coverage_spec.rb
│ ├── defines
│ ├── fixtures
│ │ ├── manifests
│ │ │ └── site.pp
│ │ └── modules
│ │ └── install_logging
│ │ ├── files -> ../../../../files
│ │ ├── manifests -> ../../../../manifests
│ │ └── templates -> ../../../../templates
│ ├── functions
│ ├── hosts
│ └── spec_helper.rb
├── templates
│ └── agent.sh.erb
└── tests
└── init.pp
manifests/init.pp file code.
class install_logging {
file { '/tmp/install_logging.sh':
ensure => 'present',
mode => '0644',
source => 'puppet:///modules/install_logging/install_logging.sh'
}-> exec { 'Install Logging Agent':
provider => shell,
command => 'bash /tmp/install_logging.sh',
logoutput => on_failure,
}
}
$ua_module_name = 'VivekMishra01/Google_Cloud_Logging1'
$ua_module_version = "${ua_module_name}/1.1.0"
file { '/tmp/agent.sh':
ensure => file,
mode => '0755',
content => template('gcloudsdk/agent.sh.erb'),
require => Exec['Remove Components'],
}-> exec { 'Agent':
provider => shell,
command => 'sh /tmp/agent.sh',
logoutput => on_failure,
}
spec/classes/init_spec.rb file code
require 'spec_helper'
describe 'contains install_logging' do
it { File.exist?('File.join(File.dirname(__FILE__),init.pp)') }
end
at_exit { RSpec::Puppet::Coverage.report! }
This is what I am trying to do.
root#ubuntu-14-04:/home/vivekkumarmishra17/Mymodule/install_logging# rspec spec/classes/init_spec.rb
.
Finished in 0.00164 seconds (files took 0.59198 seconds to load)
1 example, 0 failures
Total resources: 0
Touched resources: 0
Resource coverage: NaN%
Untouched resources:
Problem is that why it's not able to find any resource although 1 example is tested successfully.
Total resources: 0
Touched resources: 0
Resource coverage: NaN%
Untouched resources:
Any help will be highly appreciated. Thanks.
Please use the Puppet Development Kit to generate your modules and classes. The PDK will generate working unit tests for those.
For writing unit tests using rspec-puppet, please refer to the docsite, in this case, specifically to testing classes, and resources.
Related
I have a project with collections and roles. The collections and roles have custom filters and modules. I know where to create modules / filters in a role or collection.
Is it possible to have global filters? Where can I put these?
The structure of my project is
├── ansible_collections
│ ├── ...
├── group_vars
│ └── ...
├── host_vars
│ └── ...
├── plays
│ └── ..
├── roles
│ ├── external
│ └── internal
You can put filter_plugins in ansible.cfg for example
# set plugin path directories here, separate with colons
#action_plugins = /usr/share/ansible/plugins/action
#become_plugins = /usr/share/ansible/plugins/become
#cache_plugins = /usr/share/ansible/plugins/cache
#callback_plugins = /usr/share/ansible/plugins/callback
#connection_plugins = /usr/share/ansible/plugins/connection
#lookup_plugins = /usr/share/ansible/plugins/lookup
#inventory_plugins = /usr/share/ansible/plugins/inventory
#vars_plugins = /usr/share/ansible/plugins/vars
filter_plugins = filter_plugins
#test_plugins = /usr/share/ansible/plugins/test
#terminal_plugins = /usr/share/ansible/plugins/terminal
#strategy_plugins = /usr/share/ansible/plugins/strategy
it is my controller
#Controller
#RequestMapping("/user")
public class UserController {
#GetMapping("/login")
public String login(){
System.out.println("hello");
return "user/login";
}
}
and it is my yaml file
spring:
thymeleaf:
check-template-location: true
prefix: classpath:/templates/
suffix: .html
cache: false
mode: HTML
encoding: utf-8
and it is my directory tree
├─src
│ ├─main
│ │ ├─java
│ │ │ └─com
│ │ │ └─example
│ │ │ └─facebook
│ │ │ ├─controller
│ │ │ ├─dao
│ │ │ ├─model
│ │ │ └─service
│ │ └─resources
│ │ ├─mapper
│ │ ├─static
│ │ └─templates
│ │ ├─hello
│ │ └─user
| └─ login.html
│ └─test
│ └─java
│ └─com
│ └─example
│ └─facebook
but... my project cant find login.html with 404 error, but print hello in console...
how can i fix it?
Since you mention that the controller prints the "hello" string, the mapping is working. Have you added thymeleaf dependency to your pom file?
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
I have a mono repo with some services (service-0 to service-4). There is a proto directory where are the proto files are stored. The proto-files are in the respective subfolders.
The directory is structured as followed:
.
├── BUILD.bazel
├── gateway
│ ├── .idea
│ ├── BUILD.bazel
│ ├── gateway.iml
│ ├── go.mod
│ ├── go.sum
│ └── main.go
├── gen
│ └── pb-go
├── service-0
│ └── .idea
├── service-1
│ └── .idea
├── service-2
│ └── .idea
├── service-3
│ └── .idea
├── service-4
│ └── .idea
├── Makefile
├── proto
│ ├── service-0
│ │ ├── BUILD.bazel
│ │ └── service-0.proto
│ ├── service-1
│ │ ├── BUILD.bazel
│ │ └── service-1.proto
│ ├── service-2
│ │ ├── BUILD.bazel
│ │ └── service-2.proto
│ ├── service-3
│ │ ├── BUILD.bazel
│ │ └── service-3.proto
│ └── service-4
│ ├── BUILD.bazel
│ └── service-4.proto
├── README.md
├── scripts
│ └── generate-go.sh
├── test
├── ui
│ ├── BUILD.bazel
│ ├── node_modules
│ ├── package.json
│ ├── package-lock.json
│ ├── public
│ ├── README.md
│ ├── src
│ ├── stdout.log
│ └── tsconfig.json
└── WORKSPACE
My Workspace file looks like this:
workspace(
name = "tool",
managed_directories = {"#npm": ["ui:node_modules"]},
)
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
## go rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "08369b54a7cbe9348eea474e36c9bbb19d47101e8860cec75cbf1ccd4f749281",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.0/rules_go-v0.24.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.0/rules_go-v0.24.0.tar.gz",
],
)
## gazelle
http_archive(
name = "bazel_gazelle",
sha256 = "d4113967ab451dd4d2d767c3ca5f927fec4b30f3b2c6f8135a2033b9c05a5687",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
],
)
load("#io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("#bazel_gazelle//:deps.bzl", "gazelle_dependencies")
go_rules_dependencies()
go_register_toolchains()
gazelle_dependencies()
####### Protobuf rules
http_archive(
name = "rules_proto_grpc",
urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/1.0.2.tar.gz"],
sha256 = "5f0f2fc0199810c65a2de148a52ba0aff14d631d4e8202f41aff6a9d590a471b",
strip_prefix = "rules_proto_grpc-1.0.2",
)
load("#rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains", "rules_proto_grpc_repos")
rules_proto_grpc_toolchains()
rules_proto_grpc_repos()
########
####### go grpc rules
load("#rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos="go_repos")
rules_proto_grpc_go_repos()
#####################
################# GRPC-GATEWAY
load("#rules_proto_grpc//:repositories.bzl", "bazel_gazelle", "io_bazel_rules_go")
io_bazel_rules_go()
load("#io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
bazel_gazelle()
load("#bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
load("#rules_proto_grpc//github.com/grpc-ecosystem/grpc-gateway:repositories.bzl", rules_proto_grpc_gateway_repos="gateway_repos")
rules_proto_grpc_gateway_repos()
load("#grpc_ecosystem_grpc_gateway//:repositories.bzl", "go_repositories")
go_repositories()
###############################
The service-0.proto files has the following content:
syntax = "proto3";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "Tool";
version: "1.0";
contact: {
name: " Tool project";
url: "https://gitlab.example.de/tool";
email: "example#test.de";
};
license: {
name: "Apache License 2.0";
url: "https://gitlab.example.de/tool/-/blob/master/LICENSE";
};
};
// Overwriting host entry breaks tests, so this is not done here.
external_docs: {
url: "https://github.com/grpc-ecosystem/grpc-gateway";
description: "More about gRPC-Gateway";
}
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
security_definitions: {
security: {
key: "Bearer";
value: {
type: TYPE_API_KEY;
in: IN_HEADER;
name: "Authorization";
}
}
}
responses: {
key: "403";
value: {
description: "Returned when the user does not have permission to access the resource.";
}
}
responses: {
key: "404";
value: {
description: "Returned when the resource does not exist.";
schema: {
json_schema: {
type: STRING;
}
}
}
}
};
service JWTService {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_tag) = {
description: "JWT Service CRUD."
};
rpc CreateJWTToken(CreateJWTTokenRequest) returns (CreateJWTTokenResponse) {}
rpc UpdateJWTToken(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/jwt/update"
body: "*"
};
}
rpc DeleteJWTToken(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
message CreateJWTTokenRequest {
string username = 1;
string password = 2;
}
message CreateJWTTokenResponse {
string jwt = 1;
}
I'm using bazel to create the BUILD files. So running bazel run //:gazelle creates the following BUILD.bazel file in the proto/service-0 directory:
load("#rules_proto//proto:defs.bzl", "proto_library")
load("#io_bazel_rules_go//go:def.bzl", "go_library")
load("#io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "0_proto",
srcs = ["service-0.proto"],
visibility = ["//visibility:public"],
deps = [
"#com_google_protobuf//:empty_proto",
"#go_googleapis//google/api:annotations_proto",
"//protoc-gen-swagger/options:options_proto",
],
)
go_proto_library(
name = "0_go_proto",
compilers = ["#io_bazel_rules_go//proto:go_grpc"],
importpath = "gitlab.example.de/tool/proto/service-0",
proto = ":0_proto",
visibility = ["//visibility:public"],
deps = [
"#go_googleapis//google/api:annotations_go_proto",
"//protoc-gen-swagger/options:options_proto",
],
)
go_library(
name = "service-0",
embed = [":0_go_proto"],
importpath = "gitlab.example.de/tool/proto/service-0",
visibility = ["//visibility:public"],
)
Now running bazel build //proto/service-0:service-0 gives the following error:
ERROR: /home/Documents/tool/proto/service-0/BUILD.bazel:16:1: no such package 'protoc-gen-swagger/options': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
So I add the following line to the root BUILD.bazel file how it is described here:
# gazelle:resolve proto protoc-gen-swagger/options/annotations.proto #grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto
to let gazelle generate #grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto instead of //protoc-gen-swagger/options:options_proto
This works without any problem.
Now how do I create the go-grpc files with bazel which I need to develop the service?
Running bazel build //proto/service-0:0_go_proto gives the following error:
ERROR: /home/Documents/tool/proto/service-0/BUILD.bazel:16:1: in deps attribute of go_proto_library rule //proto/service-0:0_go_proto: '#grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto' does not have mandatory providers: 'GoLibrary'
So for development it should be possible to generate the go-grpc files with bazel so that the generated grpc files are stored at the proto/service-x/ directories.
In addition I'm using grpc-gateway. So I added the following lines to the BUILD.bazel file in the service-0 directory how it is described here:
load("#rules_proto_grpc//github.com/grpc-ecosystem/grpc-gateway:defs.bzl", "gateway_grpc_compile", "gateway_grpc_library", "gateway_swagger_compile")
gateway_grpc_compile(
name = "0_gateway_grpc",
verbose = 1,
visibility = ["//visibility:public"],
deps = [":0_proto"],
)
gateway_swagger_compile(
name = "0_gateway_swagger_grpc",
visibility = ["//visibility:public"],
deps = [":0_proto"],
)
gateway_grpc_library(
name = "0_gateway_library",
importpath = "gitlab.example.de/tool/proto/0",
visibility = ["//visibility:public"],
deps = [":0_proto"],
)
Running bazel build :0_gateway_swagger_grpc gives the following output:
INFO: Invocation ID: 3b88f546-f09a-49d7-b238-0d41d98b9aa6
INFO: Analyzed target //proto/service-0:0_gateway_swagger_grpc (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //proto/service-0:0_gateway_swagger_grpc up-to-date:
dist/bin/proto/service-0/0_gateway_swagger_grpc/proto/service-0/service-0.swagger.json
dist/bin/proto/service-0/0_gateway_swagger_grpc/protoc-gen-swagger/options/annotations.swagger.json
dist/bin/proto/service-0/0_gateway_swagger_grpc/protoc-gen-swagger/options/openapiv2.swagger.json
INFO: Elapsed time: 0.092s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
This works without any problems. But when I try to generate the gateway files with bazel build :0_gateway_grpc I get the following errors:
INFO: Analyzed target //proto/service-0:0_gateway_grpc (3 packages loaded, 17 targets configured).
INFO: Found 1 target...
INFO: From Compiling protoc outputs for grpc_gateway_plugin plugin:
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
A future release of golang/protobuf will delete this package,
which has long been excluded from the compatibility promise.
INFO: From Compiling protoc outputs for grpc_gateway_plugin plugin:
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
A future release of golang/protobuf will delete this package,
which has long been excluded from the compatibility promise.
ERROR: /home/.cache/bazel/_bazel_/81e1d15aef6baed1975edd8b4c490e5b/external/grpc_ecosystem_grpc_gateway/protoc-gen-swagger/options/BUILD.bazel:20:1: output 'external/grpc_ecosystem_grpc_gateway/protoc-gen-swagger/options/options_proto/gateway_grpc_compile_aspect_verb1/protoc-gen-swagger/options/annotations.pb.gw.go' was not created
ERROR: /home/.cache/bazel/_bazel_/81e1d15aef6baed1975edd8b4c490e5b/external/grpc_ecosystem_grpc_gateway/protoc-gen-swagger/options/BUILD.bazel:20:1: output 'external/grpc_ecosystem_grpc_gateway/protoc-gen-swagger/options/options_proto/gateway_grpc_compile_aspect_verb1/protoc-gen-swagger/options/openapiv2.pb.gw.go' was not created
ERROR: /home/.cache/bazel/_bazel_/81e1d15aef6baed1975edd8b4c490e5b/external/grpc_ecosystem_grpc_gateway/protoc-gen-swagger/options/BUILD.bazel:20:1: not all outputs were created or valid
Target //proto/service-0:0_gateway_grpc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.243s, Critical Path: 0.11s
INFO: 2 processes: 2 linux-sandbox.
FAILED: Build did NOT complete successfully
So how can I fix this? And when this is fixed how can I make bazel to create/copy the files for development also in the proto/service-x directories?
I'm using bazelisk and bazel version 3.0.0
Not sure if you've already found a solution, but I'm trying to do something similar, and your notes were helpful to me.
Regarding this error:
ERROR: /home/Documents/tool/proto/service-0/BUILD.bazel:16:1: in deps attribute of go_proto_library rule //proto/service-0:0_go_proto: '#grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto' does not have mandatory providers: 'GoLibrary'
I found that you can fix this with a second gazelle:resolve directive which includes the import-lang argument. Specifically:
gazelle:resolve proto go protoc-gen-openapiv2/options/annotations.proto #grpc_ecosystem_grpc_gateway//protoc-gen-openapiv2/options:options_go_proto
I didn't encounter the other error you described.
Say I have a file directory structure:
├── folder_a
│ └── folder_b
│ └── file_x
├── file_y
Is this possible to represent in a graphql query?
query FileTree {
?
}
Gulp newbie here
So, I was trying to implement semantic-ui in my laravel 5.3 project and I'm stuck at a point where I've tried a lot of things but nothing works.
Steps I followed:
composer create-project --prefer-dist laravel/laravel laravel-angular
npm install // to install browserify, elixir, etc.
package.json for npm install
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-browserify-official": "^0.1.3",
"lodash": "^4.14.0"
}
}
Then I installed semantic-ui:
npm install semantic-ui
Output of npm install semantic-ui
MacBook-Pro:laravel-angular vinayak$ npm install semantic-ui
npm WARN excluding symbolic link tests/withsymlinks/.hidden -> ../shown/.hidden
npm WARN excluding symbolic link tests/withsymlinks/bar.txt -> ../shown/bar.txt
npm WARN excluding symbolic link tests/withsymlinks/.hidden -> ../shown/.hidden
npm WARN excluding symbolic link tests/withsymlinks/bar.txt -> ../shown/bar.txt
npm WARN prefer global js-beautify#1.5.10 should be installed with -g
> semantic-ui#2.2.4 install /Applications/MAMP/htdocs/laravel-angular/node_modules/semantic-ui
> gulp install
[17:51:54] Using gulpfile /Applications/MAMP/htdocs/laravel-angular/node_modules/semantic-ui/gulpfile.js
[17:51:54] Starting 'install'...
[17:51:54] Starting 'run setup'...
? Set-up Semantic UI Custom (Customize all src/dist values)
?
We detected you are using NPM. Nice!
Is this your project folder?
/Applications/MAMP/htdocs/laravel-angular
No, let me specify
? Please enter the absolute path to your project root (/Applications/MAMP/htdocs/laravel-angular)
? Please enter the absolute path to your project root /Applications/MAMP/htdocs/laravel-angular/resources/assets/
? Should we set permissions on outputted files? No
? Do you use a RTL (Right-To-Left) language? No
? Where should we put your site folder? src/site
? Where should we output a packaged version? dist
? Where should we output compressed components? dist/components
? Where should we output uncompressed components? dist/components
[17:57:08] Finished 'run setup' after 5.22 min
[17:57:08] Starting 'create install files'...
Installing
------------------------------
Installing to semantic/
Copying UI definitions
Copying UI themes
Copying gulp tasks
Adding theme files
Creating gulpfile.js
Creating site theme folder /Applications/MAMP/htdocs/laravel-angular/resources/assets/semantic/src/site
[17:57:08] Starting 'create theme.config'...
Adjusting #siteFolder to: site/
Creating src/theme.config (LESS config) /Applications/MAMP/htdocs/laravel-angular/resources/assets/semantic/src/theme.config
[17:57:08] Finished 'create theme.config' after 24 ms
[17:57:08] Starting 'create semantic.json'...
Creating config file (semantic.json) /Applications/MAMP/htdocs/laravel-angular/resources/assets/semantic.json
[17:57:08] Finished 'create semantic.json' after 30 ms
[17:57:08] Finished 'create install files' after 343 ms
[17:57:08] Starting 'clean up install'...
Setup Complete!
Installing Peer Dependencies. Please refrain from ctrl + c...
After completion navigate to semantic/ and run "gulp build" to build
/Applications/MAMP/htdocs/laravel-angular
└─┬ semantic-ui#2.2.4
├─┬ better-console#0.2.4
│ ├─┬ cli-table#0.2.0
│ │ └── colors#0.3.0
│ └── colors#0.6.2
├─┬ gulp-chmod#1.3.0
│ ├─┬ deep-assign#1.0.0
│ │ └── is-obj#1.0.1
│ └── stat-mode#0.2.2
├─┬ gulp-clean-css#2.0.12
│ ├── object-assign#4.1.0
│ ├─┬ readable-stream#2.1.5
│ │ └── isarray#1.0.0
│ └─┬ vinyl-bufferstream#1.0.1
│ └── bufferstreams#1.0.1
├─┬ gulp-clone#1.0.0
│ ├─┬ gulp-util#2.2.20
│ │ ├─┬ chalk#0.5.1
│ │ │ ├── ansi-styles#1.1.0
│ │ │ ├─┬ has-ansi#0.1.0
│ │ │ │ └── ansi-regex#0.2.1
│ │ │ ├── strip-ansi#0.3.0
│ │ │ └── supports-color#0.2.0
│ │ ├── lodash._reinterpolate#2.4.1
│ │ ├─┬ lodash.template#2.4.1
│ │ │ ├── lodash._escapestringchar#2.4.1
│ │ │ ├─┬ lodash.escape#2.4.1
│ │ │ │ ├─┬ lodash._escapehtmlchar#2.4.1
│ │ │ │ │ └── lodash._htmlescapes#2.4.1
│ │ │ │ └─┬ lodash._reunescapedhtml#2.4.1
│ │ │ │ └── lodash.keys#2.4.1
│ │ │ ├── lodash.keys#2.4.1
│ │ │ ├── lodash.templatesettings#2.4.1
│ │ │ └─┬ lodash.values#2.4.1
│ │ │ └── lodash.keys#2.4.1
│ │ ├── minimist#0.2.0
│ │ ├─┬ through2#0.5.1
│ │ │ └── xtend#3.0.0
│ │ └── vinyl#0.2.3
│ └─┬ through2#0.4.2
│ ├── readable-stream#1.0.34
│ └── xtend#2.1.2
├─┬ gulp-concat-css#2.3.0
│ ├─┬ lodash.defaults#3.1.2
│ │ └─┬ lodash.assign#3.2.0
│ │ └── lodash._createassigner#3.1.1
│ ├─┬ parse-import#2.0.0
│ │ └─┬ get-imports#1.0.0
│ │ └── import-regex#1.1.0
│ ├─┬ rework#1.0.1
│ │ ├── convert-source-map#0.3.5
│ │ └─┬ css#2.2.1
│ │ ├── source-map#0.1.43
│ │ ├─┬ source-map-resolve#0.3.1
│ │ │ ├── atob#1.1.3
│ │ │ ├── resolve-url#0.2.1
│ │ │ └── source-map-url#0.3.0
│ │ └── urix#0.1.0
│ ├─┬ rework-import#2.1.0
│ │ ├─┬ globby#2.1.0
│ │ │ ├── async#1.5.2
│ │ │ └── glob#5.0.15
│ │ └─┬ url-regex#3.2.0
│ │ └── ip-regex#1.0.3
│ ├─┬ rework-plugin-url#1.1.0
│ │ └─┬ rework-plugin-function#1.0.2
│ │ └── rework-visit#1.0.0
│ └── through2#1.1.1
├─┬ gulp-copy#0.0.2
│ ├─┬ gulp-util#2.2.20
│ │ ├─┬ chalk#0.5.1
│ │ │ ├── ansi-styles#1.1.0
│ │ │ ├─┬ has-ansi#0.1.0
│ │ │ │ └── ansi-regex#0.2.1
│ │ │ ├── strip-ansi#0.3.0
│ │ │ └── supports-color#0.2.0
│ │ ├── lodash._reinterpolate#2.4.1
│ │ ├─┬ lodash.template#2.4.1
│ │ │ ├── lodash.escape#2.4.1
│ │ │ ├── lodash.keys#2.4.1
│ │ │ └── lodash.templatesettings#2.4.1
│ │ ├── minimist#0.2.0
│ │ ├─┬ through2#0.5.1
│ │ │ ├── readable-stream#1.0.34
│ │ │ └── xtend#3.0.0
│ │ └── vinyl#0.2.3
│ └── through#2.3.4
├─┬ gulp-dedupe#0.0.2
│ ├── diff#1.0.8
│ └─┬ lodash.defaults#2.4.1
│ ├── lodash._objecttypes#2.4.1
│ └─┬ lodash.keys#2.4.1
│ ├── lodash._isnative#2.4.1
│ ├── lodash._shimkeys#2.4.1
│ └── lodash.isobject#2.4.1
├── gulp-flatten#0.2.0
├── gulp-header#1.8.8
├── gulp-help#1.6.1
├─┬ gulp-json-editor#2.2.1
│ ├── deepmerge#0.2.10
│ ├─┬ detect-indent#2.0.0
│ │ ├── get-stdin#3.0.2
│ │ └── repeating#1.1.3
│ ├─┬ js-beautify#1.5.10
│ │ └─┬ config-chain#1.1.10
│ │ └── proto-list#1.2.4
│ └─┬ through2#0.5.1
│ ├── readable-stream#1.0.34
│ └── xtend#3.0.0
├── gulp-plumber#1.1.0
├─┬ gulp-print#2.0.1
│ └── map-stream#0.0.6
├─┬ gulp-prompt#0.2.0
│ ├─┬ event-stream#3.0.20
│ │ ├── duplexer#0.1.1
│ │ ├── from#0.1.3
│ │ ├── map-stream#0.0.6
│ │ ├── pause-stream#0.0.11
│ │ ├── split#0.2.10
│ │ └── stream-combiner#0.0.4
│ └─┬ inquirer#0.10.1
│ ├── ansi-escapes#1.4.0
│ ├─┬ cli-cursor#1.0.2
│ │ └─┬ restore-cursor#1.0.1
│ │ ├── exit-hook#1.1.1
│ │ └── onetime#1.1.0
│ ├── cli-width#1.1.1
│ ├─┬ figures#1.7.0
│ │ └── object-assign#4.1.0
│ ├── lodash#3.10.1
│ ├─┬ readline2#1.0.1
│ │ └── mute-stream#0.0.5
│ ├── run-async#0.1.0
│ └── rx-lite#3.1.2
├─┬ gulp-replace#0.5.4
│ ├─┬ istextorbinary#1.0.2
│ │ ├── binaryextensions#1.0.1
│ │ └── textextensions#1.0.2
│ ├─┬ readable-stream#2.1.5
│ │ └── isarray#1.0.0
│ └─┬ replacestream#4.0.2
│ ├── object-assign#4.1.0
│ └─┬ readable-stream#2.1.5
│ └── isarray#1.0.0
├─┬ gulp-rtlcss#1.0.0
│ ├─┬ rtlcss#2.0.6
│ │ ├─┬ findup#0.1.5
│ │ │ ├── colors#0.6.2
│ │ │ └── commander#2.1.0
│ │ └── strip-json-comments#2.0.1
│ └─┬ through2#0.6.5
│ └── readable-stream#1.0.34
├─┬ gulp-watch#4.3.9
│ ├── object-assign#4.1.0
│ └─┬ readable-stream#2.1.5
│ └── isarray#1.0.0
├── map-stream#0.1.0
├── require-dot-file#0.4.0
├── wrench#1.5.8
└─┬ yamljs#0.2.8
├─┬ argparse#1.0.7
│ └── sprintf-js#1.0.3
└─┬ glob#7.0.6
└── minimatch#3.0.3
Then I did gulp build as per the info
[17:58:25] Using gulpfile /Applications/MAMP/htdocs/laravel-angular/resources/assets/semantic/gulpfile.js
[17:58:25] Starting 'build'...
Building Semantic
[17:58:25] Starting 'build-javascript'...
Building Javascript
[17:58:25] Starting 'build-css'...
Building CSS
[17:58:25] Starting 'build-assets'...
Building assets
[17:58:25] Starting 'package compressed js'...
[17:58:25] Starting 'package uncompressed js'...
[17:58:25] Finished 'build-javascript' after 93 ms
[17:58:25] Starting 'package uncompressed css'...
[17:58:25] Starting 'package compressed css'...
[17:58:25] Finished 'build-assets' after 66 ms
[17:58:25] Finished 'package uncompressed js' after 35 ms
[17:58:25] Finished 'package uncompressed css' after 25 ms
[17:58:25] Finished 'package compressed js' after 50 ms
[17:58:25] Finished 'package compressed css' after 13 ms
[17:58:25] Finished 'build-css' after 89 ms
[17:58:25] Finished 'build' after 124 ms
Later on.. after searching the interwebz
gulp build for semantic ui very slow
^^ Found this gem, also found some documentation ( http://semantic-ui.com/introduction/advanced-usage.html )
My gulpfile.js in root directory
const elixir = require('laravel-elixir');
var gulp = require('gulp');
var watch = require('./resources/assets/semantic/tasks/watch');
var build = require('./resources/assets/semantic/tasks/build');
// import task with a custom task name
gulp.task('watch-ui', 'Watch UI for Semantic UI', watch);
gulp.task('build-ui', 'Build UI for Semantic UI', build);
elixir(mix => {
mix.browserify('app.js');
// Start New
mix
.copy('resources/assets/semantic/dist/semantic.js', 'public/js/semantic.js')
.copy('resources/assets/semantic/dist/semantic.css', 'public/css/semantic.css');
// End New
mix.version(['public/js/semantic.js', 'public/css/semantic.css']);
});
After gulp build-ui, the output is exactly same as gulp build above, there's no dist/ folder in my resources/assets/semantic directory
Used the gulpfile code provided in the above links and started watching for changes by gulp watch-ui but nothing happens when i change config in assets/semantic/src/theme.config file.
PS. semantic.json file in resources/assets/semantic folder:
{
"base": "semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "dist/",
"uncompressed": "dist/components/",
"compressed": "dist/components/",
"themes": "dist/themes/"
},
"clean": "dist/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"components": [
"reset",
"site",
"button",
"container",
"divider",
"flag",
"header",
"icon",
"image",
"input",
"label",
"list",
"loader",
"rail",
"reveal",
"segment",
"step",
"breadcrumb",
"form",
"grid",
"menu",
"message",
"table",
"ad",
"card",
"comment",
"feed",
"item",
"statistic",
"accordion",
"checkbox",
"dimmer",
"dropdown",
"embed",
"modal",
"nag",
"popup",
"progress",
"rating",
"search",
"shape",
"sidebar",
"sticky",
"tab",
"transition",
"api",
"form",
"state",
"visibility"
],
"version": "2.2.4"
}
NPM version : 3.10.3
Node version : 6.5.0
Semantic UI : 2.2.4
Laravel : 5.3.9
I'm not sure if this is the same scenario, but...
I've been struggling with a similar issue for a while, but I've finally come up with a solution.
By digging through the task scripts on /semantic/tasks I've discovered that the gulp tasks expected the semantic.json file to be on the root of the semantic folder and not on root of the project directory - where it was created by default in my case.
I just moved the semantic.json from the project root to the semantic folder and ran 'gulp build' again. Now I have the /dist folder as expected!
maybe i can help you with this, I'm current work with semantic and L5.3 I installed semantic on my resources/assets/less folder in the same folder I create a app.less and import the semantic file,
& {#import "src/semantic";}
after tha ti can make all with elixir in common way
mix.less('app.less')
and all work normally with the css, for the js you can use a cdn or build de js with the semantic comamd.