Skip to content

Commit 28bcbdf

Browse files
authored
Enable to use gqlgenc from both content-kit and onix-kit (#11)
* unify api version * move gqlgenc binary * enable to generate client for multiple packages * add query for retrieving ISBN * add blog scaffold * fetch products
1 parent af68abc commit 28bcbdf

25 files changed

+1257
-135
lines changed

.gqlgenc.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
model:
2-
package: generated
3-
filename: ./syncdata/generated/model.go # https://github.com/99designs/gqlgen/tree/master/plugin/modelgen
2+
package: client
3+
filename: ./gqlgenc/client/model.go # https://github.com/99designs/gqlgen/tree/master/plugin/modelgen
44
client:
5-
package: generated
6-
filename: ./syncdata/generated/client.go # Where should any generated client go?
5+
package: client
6+
filename: ./gqlgenc/client/client.go # Where should any generated client go?
77
models:
88
Int:
99
model: github.com/99designs/gqlgen/graphql.Int64
1010
Date:
1111
model: github.com/99designs/gqlgen/graphql.Time
1212
endpoint:
13-
url: https://k9books.myshopify.com/admin/api/2020-07/graphql.json
13+
url: https://k9books.myshopify.com/admin/api/2020-10/graphql.json
1414
headers:
1515
X-Shopify-Access-Token: ${GRAPHQL_ADMIN_API_SECRET}
1616
query:
17-
- "./syncdata/*.gql"
17+
- "./gqlgenc/**/*.gql"

.graphqlrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
schema:
2-
- https://k9books.myshopify.com/admin/api/2020-07/graphql.json:
2+
- https://k9books.myshopify.com/admin/api/2020-10/graphql.json:
33
headers:
44
X-Shopify-Access-Token: ${GRAPHQL_ADMIN_API_SECRET}

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ download/theme:
2525
lint:
2626
$(LINT) ./theme
2727

28-
syncdata/generated/client.go: syncdata/gqlgenc/main.go syncdata/*.gql
29-
$(BZL) run syncdata/gqlgenc
30-
cp -r $(BZL_BIN)/syncdata/gqlgenc/gqlgenc_/gqlgenc.runfiles/k9books/syncdata/generated $(CURDIR)/syncdata
28+
gqlgenc/client/client.go: gqlgenc/main.go gqlgenc/*.gql
29+
$(BZL) run gqlgenc
30+
cp -r $(BZL_BIN)/gqlgenc/gqlgenc_/gqlgenc.runfiles/k9books/gqlgenc/client $(CURDIR)/gqlgenc
3131

3232
bin/*: $(GO_FILES) WORKSPACE
3333
mkdir -p bin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

contents/products/language-implementation-patterns-create-your-own-domain-specific-and-general-programming-languages.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
## 出版社より
22

3-
Learn to build configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. You don't need a background in computer science--ANTLR creator Terence Parr demystifies language implementation by breaking it down into the most common design patterns. Pattern by pattern, you'll learn the key skills you need to implement your own computer languages.
3+
Learn to build configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. You dont need a background in computer scienceANTLR creator Terence Parr demystifies language implementation by breaking it down into the most common design patterns. Pattern by pattern, youll learn the key skills you need to implement your own computer languages.
44

55
Knowing how to create domain-specific languages (DSLs) can give you a huge productivity boost. Instead of writing code in a general-purpose programming language, you can first build a custom language tailored to make you efficient in a particular domain.
66

77
The key is understanding the common patterns found across language implementations. Language Design Patterns identifies and condenses the most common design patterns, providing sample implementations of each.
88

99
The pattern implementations use Java, but the patterns themselves are completely general. Some of the implementations use the well-known ANTLR parser generator, so readers will find this book an excellent source of ANTLR examples as well. But this book will benefit anyone interested in implementing languages, regardless of their tool of choice. Other language implementation books focus on compilers, which you rarely need in your daily life. Instead, Language Design Patterns shows you patterns you can use for all kinds of language applications.
1010

11-
You'll learn to create configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. Each chapter groups related design patterns and, in each pattern, you'll get hands-on experience by building a complete sample implementation. By the time you finish the book, you'll know how to solve most common language implementation problems.
11+
Youll learn to create configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. Each chapter groups related design patterns and, in each pattern, youll get hands-on experience by building a complete sample implementation. By the time you finish the book, youll know how to solve most common language implementation problems.
1212

13-
------
13+
14+
---
1415

1516
表題の通り、言語実装のデザインパターンを色々紹介していく本です。 いくつかのパートに分けて言語解析器、インタープリタ、コンパイラ(Translator&Generatorとして紹介)の内部に現れるパターンを紹介していきます。
1617

contents/products/node-js-design-patterns-third-edition-design-and-implement-production-grade-node-js-applications-using-proven-patterns-and-techniques.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,33 @@ Learn proven patterns, techniques, and tricks to take full advantage of the Node
44

55
**Key Features**
66

7-
- Learn how to create solid server-side applications by leveraging the full power of Node.js 14
8-
- Understand how Node.js works and learn how to take full advantage of its core components as well as the solutions offered by its ecosystem
9-
- Avoid common mistakes and use proven patterns to create production grade Node.js applications
10-
7+
* Learn how to create solid server-side applications by leveraging the full power of Node.js 14
8+
* Understand how Node.js works and learn how to take full advantage of its core components as well as the solutions offered by its ecosystem
9+
* Avoid common mistakes and use proven patterns to create production grade Node.js applications
1110
**Book Description**
1211

1312
In this book, we will show you how to implement a series of best practices and design patterns to help you create efficient and robust Node.js applications with ease.
1413

1514
We kick off by exploring the basics of Node.js, analyzing its asynchronous event driven architecture and its fundamental design patterns. We then show you how to build asynchronous control flow patterns with callbacks, promises and async/await. Next, we dive into Node.js streams, unveiling their power and showing you how to use them at their full capacity. Following streams is an analysis of different creational, structural, and behavioral design patterns that take full advantage of JavaScript and Node.js. Lastly, the book dives into more advanced concepts such as Universal JavaScript, scalability and messaging patterns to help you build enterprise-grade distributed applications.
1615

17-
Throughout the book, you'll see Node.js in action with the help of several real-life examples leveraging technologies such as LevelDB, Redis, RabbitMQ, ZeroMQ, and many others. They will be used to demonstrate a pattern or technique, but they will also give you a great introduction to the Node.js ecosystem and its set of solutions.
16+
Throughout the book, youll see Node.js in action with the help of several real-life examples leveraging technologies such as LevelDB, Redis, RabbitMQ, ZeroMQ, and many others. They will be used to demonstrate a pattern or technique, but they will also give you a great introduction to the Node.js ecosystem and its set of solutions.
1817

1918
**What you will learn**
2019

21-
- Become comfortable with writing asynchronous code by leveraging callbacks, promises, and the async/await syntax
22-
- Leverage Node.js streams to create data-driven asynchronous processing pipelines
23-
- Implement well-known software design patterns to create production grade applications
24-
- Share code between Node.js and the browser and take advantage of full-stack JavaScript
25-
- Build and scale microservices and distributed systems powered by Node.js
26-
- Use Node.js in conjunction with other powerful technologies such as Redis, RabbitMQ, ZeroMQ, and LevelDB
27-
20+
* Become comfortable with writing asynchronous code by leveraging callbacks, promises, and the async/await syntax
21+
* Leverage Node.js streams to create data-driven asynchronous processing pipelines
22+
* Implement well-known software design patterns to create production grade applications
23+
* Share code between Node.js and the browser and take advantage of full-stack JavaScript
24+
* Build and scale microservices and distributed systems powered by Node.js
25+
* Use Node.js in conjunction with other powerful technologies such as Redis, RabbitMQ, ZeroMQ, and LevelDB
2826
**Who this book is for**
2927

3028
This book is for developers and software architects who have some prior basic knowledge of JavaScript and Node.js and now want to get the most out of these technologies in terms of productivity, design quality, and scalability. Software professionals with intermediate experience in Node.js and JavaScript will also find valuable the more advanced patterns and techniques presented in this book.
3129

3230
This book assumes that you have an intermediate understanding of web application development, databases, and software design principles.
3331

34-
------
32+
33+
---
3534

3635
Node.jsでコードを書くときのデザインプラクティスやそのプラクティスが重要である理由について解説した書籍です。 JavaScriptのイベントループによる実行モデルを、時に分かりやすい図を挟みながら詳細に解説が載っています。 業務でJavaScriptを書いていて、普通に書けるようにはなってきたけど、もう一歩深入りしたいという方にオススメです。(特にJavaScriptが最初の言語である方)
3736

contents/products/programming-webassembly-with-rust.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
WebAssembly fulfills the long-awaited promise of web technologies: fast code, type-safe at compile time, execution in the browser, on embedded devices, or anywhere else. Rust delivers the power of C in a language that strictly enforces type safety. Combine both languages and you can write for the web like never before! Learn how to integrate with JavaScript, run code on platforms other than the browser, and take a step into IoT. Discover the easy way to build cross-platform applications without sacrificing power, and change the way you write code for the web.
44

5-
WebAssembly is more than just a revolutionary new technology. It's reshaping how we build applications for the web and beyond. Where technologies like ActiveX and Flash have failed, you can now write code in whatever language you prefer and compile to WebAssembly for fast, type-safe code that runs in the browser, on mobile devices, embedded devices, and more. Combining WebAssembly's portable, high-performance modules with Rust's safety and power is a perfect development combination.
5+
WebAssembly is more than just a revolutionary new technology. Its reshaping how we build applications for the web and beyond. Where technologies like ActiveX and Flash have failed, you can now write code in whatever language you prefer and compile to WebAssembly for fast, type-safe code that runs in the browser, on mobile devices, embedded devices, and more. Combining WebAssemblys portable, high-performance modules with Rusts safety and power is a perfect development combination.
66

7-
Learn how WebAssembly's stack machine architecture works, install low-level wasm tools, and discover the dark art of writing raw wast code. Build on that foundation and learn how to compile WebAssembly modules from Rust by implementing the logic for a checkers game. Create wasm modules in Rust to interoperate with JavaScript in many compelling ways. Apply your new skills to the world of non-web hosts, and create everything from an app running on a Raspberry Pi that controls a lighting system, to a fully-functioning online multiplayer game engine where developers upload their own arena-bound WebAssembly combat modules.
8-
Get started with WebAssembly today, and change the way you think about the web.
7+
Learn how WebAssembly’s stack machine architecture works, install low-level wasm tools, and discover the dark art of writing raw wast code. Build on that foundation and learn how to compile WebAssembly modules from Rust by implementing the logic for a checkers game. Create wasm modules in Rust to interoperate with JavaScript in many compelling ways. Apply your new skills to the world of non-web hosts, and create everything from an app running on a Raspberry Pi that controls a lighting system, to a fully-functioning online multiplayer game engine where developers upload their own arena-bound WebAssembly combat modules. Get started with WebAssembly today, and change the way you think about the web.
98

109
**What You Need:**
1110

12-
You'll need a Linux, Mac, or Windows workstation with an Internet connection. You'll need an up-to-date web browser that supports WebAssembly. To work with the sample code, you can use your favorite text editor or IDE. The book will guide you through installing the Rust and WebAssembly tools needed for each chapter.
11+
Youll need a Linux, Mac, or Windows workstation with an Internet connection. Youll need an up-to-date web browser that supports WebAssembly. To work with the sample code, you can use your favorite text editor or IDE. The book will guide you through installing the Rust and WebAssembly tools needed for each chapter.
1312

14-
------
13+
14+
---
1515

1616
2020年末時点でもまだ珍しい、WebAssemblyをテーマに据えた本です。 WebAssemblyの背景・基礎から解説を始めて、Web環境での実行へと進めます。 ステップ・バイ・ステップのチュートリアル的な内容なので、初学者にオススメできます。ただしRustは普通に書ける程度が期待されているのでご注意を(特に難しい表現は出てきませんが)。
1717

contents/products/the-makers-guide-to-the-zombie-apocalypse-defend-your-base-with-simple-circuits-arduino-and-raspberry-pi.md

+6-14
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,18 @@
22

33
Where will you be when the zombie apocalypse hits? Trapping yourself in the basement? Roasting the family pet? Beheading reanimated neighbors?
44

5-
No way. You'll be building fortresses, setting traps, and hoarding supplies, because you, savvy survivor, have snatched up your copy of The Maker's Guide to the Zombie Apocalypse before it's too late. This indispensable guide to survival after Z-day, written by hardware hacker and zombie anthropologist Simon Monk, will teach you how to generate your own electricity, salvage parts, craft essential electronics, and out-survive the undead., p>Take charge of your environment:
6-
-Monitor zombie movement with trip wires and motion sensors
7-
-Keep vigilant watch over your compound with Arduino and Raspberry Pi surveillance systems
8-
-Power zombie defense devices with car batteries, bicycle generators, and solar power
5+
No way. You’ll be building fortresses, setting traps, and hoarding supplies, because you, savvy survivor, have snatched up your copy of The Maker’s Guide to the Zombie Apocalypse before it’s too late. This indispensable guide to survival after Z-day, written by hardware hacker and zombie anthropologist Simon Monk, will teach you how to generate your own electricity, salvage parts, craft essential electronics, and out-survive the undead., p>Take charge of your environment: -Monitor zombie movement with trip wires and motion sensors -Keep vigilant watch over your compound with Arduino and Raspberry Pi surveillance systems -Power zombie defense devices with car batteries, bicycle generators, and solar power
96

10-
Escape imminent danger:
11-
-Repurpose old disposable cameras for zombie-distracting flashbangs
12-
-Open doors remotely for a successful sprint home
13-
-Forestall subplot disasters with fire and smoke detectors
7+
Escape imminent danger: -Repurpose old disposable cameras for zombie-distracting flashbangs -Open doors remotely for a successful sprint home -Forestall subplot disasters with fire and smoke detectors
148

15-
Communicate with other survivors:
16-
-Hail nearby humans using Morse code
17-
-Pass silent messages with two-way vibration walkie-talkies
18-
-Fervently scan the airwaves with a frequency hopper
9+
Communicate with other survivors: -Hail nearby humans using Morse code -Pass silent messages with two-way vibration walkie-talkies -Fervently scan the airwaves with a frequency hopper
1910

20-
For anyone from the budding maker to the keen hobbyist, The Maker's Guide to the Zombie Apocalypse is an essential survival tool.
11+
For anyone from the budding maker to the keen hobbyist, The Makers Guide to the Zombie Apocalypse is an essential survival tool.
2112

2213
**Uses the Arduino Uno board and Raspberry Pi Model B+ or Model 2**
2314

24-
------
15+
16+
---
2517

2618
フィクションのジャンルに[ポスト・アポカリプス物](https://en.wikipedia.org/wiki/Apocalyptic_and_post-apocalyptic_fiction)というのがありまして、 災害や戦争などで文明社会が壊滅的な被害を受けて、文明の連続性が失われた世界で起こる事件を追う、といったものです。
2719

syncdata/gqlgenc/BUILD.bazel renamed to gqlgenc/BUILD.bazel

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
33
go_library(
44
name = "go_default_library",
55
srcs = ["main.go"],
6-
importpath = "k9bookshelf/syncdata/gqlgenc",
6+
importpath = "k9bookshelf/gqlgenc",
77
visibility = ["//visibility:private"],
88
deps = [
99
"@com_github_99designs_gqlgen//api:go_default_library",
@@ -18,11 +18,8 @@ go_binary(
1818
name = "gqlgenc",
1919
data = [
2020
"//:.gqlgenc.yml",
21-
"//syncdata:deploy.gql",
22-
"//syncdata:productByHandle.gql",
23-
"//syncdata:products.gql",
2421
"@com_github_yamashou_gqlgenc//clientgen:template.gotpl",
25-
],
22+
] + glob(["*.gql"]),
2623
embed = [":go_default_library"],
2724
visibility = ["//visibility:public"],
2825
)

syncdata/generated/BUILD.bazel renamed to gqlgenc/client/BUILD.bazel

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ go_library(
44
name = "go_default_library",
55
srcs = [
66
"client.go",
7+
"gql.go",
78
"model.go",
89
],
9-
importpath = "k9bookshelf/syncdata/generated",
10+
importpath = "k9bookshelf/gqlgenc/client",
1011
visibility = ["//visibility:public"],
1112
deps = ["@com_github_yamashou_gqlgenc//client:go_default_library"],
1213
)

0 commit comments

Comments
 (0)