gamefic-sdk 2.0.4 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33f493dc96f3c27065f78900fcddbf966da5772770c9ed40f7e8bc665e93851f
4
- data.tar.gz: 6a9cde8c298e3640852d34bfa50ecd77df2d0998cec43cf13c3c67855b0c53b2
3
+ metadata.gz: a5ee344b4b5abb09130b616bb599493ad3fbcc17038aa0f306497dfe9311feab
4
+ data.tar.gz: f84186419a9963616f6e0b5447cd83609659fb80383315a384ec433623db4740
5
5
  SHA512:
6
- metadata.gz: 8d7508ff80cb9457cad967c340ad023616df7c25b746d2906a036a737b3da2eae2f04ab94c1cbba85465ac8241c56c3129614a049b0e6ec949b3009e6def7aa0
7
- data.tar.gz: 39e7fce05531a992ce3e1de4b01a9869a68103957a999f259559e651fb31fefa69e098956da1d6574778c3c1789c4c2164533b91fcd11775733359014f60dfe1
6
+ metadata.gz: 9f88ab68b9ef0fb62b06ee12ed91e073fc8a971ec31c7b74ebd9b53671dc62f686b8b66dc1925ccc7ab27f4df4874a01b4992d995b7501a5255fca5db06a950e
7
+ data.tar.gz: 03f287863bda66c3b6c8553c323553f8daad83e83555bddfdf49e75c6a8e5b7b8890671b8a0b615d677c334c7461cdcf57a6987e2c193d57768ec8bde4d4f242
data/.gitignore CHANGED
@@ -6,7 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- /guides/
10
9
 
11
10
  # rspec failure tracking
12
11
  .rspec_status
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 2.3.2 - March 11, 2021
2
+ - Add READMEs to project scaffolds
3
+ - Disable css-loader esModule option in webpack config
4
+
5
+ ## 2.3.1 - March 3, 2021
6
+ - Update opal dependency
7
+
8
+ ## 2.3.0 - December 14, 2020
9
+ - Update package dependencies for web builds
10
+
11
+ ## 2.2.0 - August 29, 2020
12
+ - Update to react-gamefic 0.4.0
13
+
14
+ ## 2.1.0 - August 27, 2020
15
+ - Update web app with customizable scene components
16
+
1
17
  ## 2.0.4 - April 25, 2020
2
18
  - Server does not symbolize snapshot keys
3
19
  - Update dependencies
data/gamefic-sdk.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency 'gamefic-standard', '~> 2.0'
29
29
  s.add_runtime_dependency 'gamefic-tty', '~> 2.0', '>= 2.0.1'
30
30
  s.add_runtime_dependency 'listen', '~> 3.0'
31
- s.add_runtime_dependency 'opal', '~> 1.0'
31
+ s.add_runtime_dependency 'opal', '~> 1.1'
32
32
  s.add_runtime_dependency 'sinatra', '~> 2'
33
33
  s.add_runtime_dependency 'thor', '~> 1.0'
34
34
 
@@ -41,7 +41,6 @@ module Gamefic
41
41
  def build
42
42
  check_for_web_build
43
43
  Dir.chdir absolute_path do
44
- # exec 'npm run build'
45
44
  pid = Process.spawn 'npm run build'
46
45
  Process.wait pid
47
46
  end
@@ -1,5 +1,5 @@
1
1
  module Gamefic
2
2
  module Sdk
3
- VERSION = '2.0.4'
3
+ VERSION = '2.3.2'
4
4
  end
5
5
  end
@@ -0,0 +1,19 @@
1
+ # <%= name %>
2
+
3
+ An extension library for Gamefic
4
+
5
+ ## Installation
6
+
7
+ Add this line to your Gamefic project's Gemfile:
8
+
9
+ ```ruby
10
+ gem '<%= name %>'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
@@ -0,0 +1,49 @@
1
+ # <%= name %>
2
+
3
+ A Gamefic game project
4
+
5
+ ## Installation
6
+
7
+ $ bundle install
8
+
9
+ ## Running on the Command Line
10
+
11
+ $ rake ruby:run
12
+
13
+ ## Building a CLI Game
14
+
15
+ $ rake ruby:build
16
+
17
+ The script will be saved in the `builds/ruby` directory.
18
+
19
+ ## Web-Based Games
20
+
21
+ The Gamefic SDK also supports web-based versions of games. The project gets built into a single-page application with the Ruby game code compiled into JavaScript.
22
+
23
+ First you need to install the web project scaffold:
24
+
25
+ ```
26
+ $ rake web:generate
27
+ ```
28
+
29
+ ## Running a Web Game
30
+
31
+ To run the app in debug mode:
32
+
33
+ ```
34
+ $ rake web:run
35
+ ```
36
+
37
+ Open http://localhost:4342 in a browser.
38
+
39
+ ## Building a Web Game
40
+
41
+ ```
42
+ $ rake web:build
43
+ ```
44
+
45
+ The application will be saved in the `builds/web/production` directory.
46
+
47
+ ## More Information
48
+
49
+ Go to https://gamefic.com for documentation.
@@ -1,3 +1,3 @@
1
1
  {
2
- "presets" : ["env", "react"]
2
+ "presets" : ["@babel/preset-env", "@babel/preset-react"]
3
3
  }
@@ -8,27 +8,27 @@
8
8
  "private": true,
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "webpack --env=production -p",
12
- "develop": "webpack --env=development -d"
11
+ "build": "webpack --mode production",
12
+ "develop": "webpack --mode development"
13
13
  },
14
14
  "devDependencies": {
15
- "babel-core": "^6.26.3",
16
- "babel-loader": "^7.1.5",
17
- "babel-preset-env": "^1.7.0",
18
- "babel-preset-react": "^6.24.1",
19
- "copy-webpack-plugin": "^4.5.3",
20
- "css-loader": "^1.0.0",
21
- "file-loader": "^3.0.1",
15
+ "@babel/core": "^7.12.0",
16
+ "babel-loader": "^8.2.2",
17
+ "@babel/preset-env": "^7.12.10",
18
+ "@babel/preset-react": "^7.12.10",
19
+ "copy-webpack-plugin": "^7.0.0",
20
+ "css-loader": "^5.0.1",
21
+ "file-loader": "^6.2.0",
22
22
  "opal-webpack-bundler": "^0.0.1",
23
23
  "style-loader": "^0.23.1",
24
- "url-loader": "^1.1.2",
25
- "webpack": "^4.20.2",
26
- "webpack-cli": "^3.1.2"
24
+ "url-loader": "^4.1.1",
25
+ "webpack": "^5.10.1",
26
+ "webpack-cli": "^4.2.0"
27
27
  },
28
28
  "dependencies": {
29
29
  "gamefic-driver": "^0.2.1",
30
30
  "react": "^16.5.2",
31
31
  "react-dom": "^16.5.2",
32
- "react-gamefic": "^0.2.2"
32
+ "react-gamefic": "^0.5.0"
33
33
  }
34
34
  }
@@ -1,13 +1,24 @@
1
1
  import React from 'react';
2
2
  import { render } from 'react-dom';
3
3
  import { Console, Terminal } from 'react-gamefic';
4
+
4
5
  import { driver } from 'driver';
6
+
7
+ import { Activity, Pause, MultipleChoice, Conclusion } from './scenes';
5
8
  import 'react-gamefic/styles/ebook';
6
9
  import './style.css';
7
10
 
11
+ const sceneComponents = {
12
+ Activity: Activity,
13
+ Pause: Pause,
14
+ MultipleChoice: MultipleChoice,
15
+ YesOrNo: MultipleChoice,
16
+ Conclusion: Conclusion
17
+ }
18
+
8
19
  render(
9
20
  <Console driver={driver}>
10
- <Terminal />
21
+ <Terminal sceneComponents={sceneComponents} autoScroll={true} />
11
22
  </Console>,
12
23
  document.getElementById('root')
13
24
  );
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ActivityScene, Output, CommandForm } from 'react-gamefic';
3
+
4
+ export class Activity extends React.Component {
5
+ render() {
6
+ return (
7
+ <ActivityScene>
8
+ <Output {...this.props} transcribe={true} />
9
+ <CommandForm prompt={this.props.state.prompt} />
10
+ </ActivityScene>
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ConclusionScene, Output } from 'react-gamefic';
3
+
4
+ export class Conclusion extends React.Component {
5
+ render() {
6
+ return (
7
+ <ConclusionScene>
8
+ <Output {...this.props} transcribe={true} />
9
+ </ConclusionScene>
10
+ );
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { MultipleChoiceScene, ChoiceList } from 'react-gamefic';
3
+
4
+ export class MultipleChoice extends React.Component {
5
+ render() {
6
+ return (
7
+ <MultipleChoiceScene>
8
+ <Output {...this.props} transcribe={true} />,
9
+ <ChoiceList options={this.props.state.options} prompt={this.props.state.prompt} />
10
+ </MultipleChoiceScene>
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { PauseScene, Output, CommandLink } from 'react-gamefic';
3
+
4
+ export class Pause extends React.Component {
5
+ render() {
6
+ return (
7
+ <PauseScene>
8
+ <Output {...this.props} transcribe={true} />
9
+ <CommandLink command="">Continue</CommandLink>
10
+ </PauseScene>
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ import { Activity } from './Activity.jsx';
2
+ import { Pause } from './Pause.jsx';
3
+ import { MultipleChoice } from './MultipleChoice.jsx';
4
+ import { Conclusion } from './Conclusion.jsx';
5
+
6
+ export {
7
+ Activity,
8
+ Pause,
9
+ MultipleChoice,
10
+ Conclusion
11
+ }
@@ -1,51 +1,56 @@
1
1
  const path = require('path');
2
2
  const CopyWebpackPlugin = require('copy-webpack-plugin');
3
3
 
4
- module.exports = (env) => {
4
+ module.exports = (_env, argv) => {
5
5
  var config = {
6
6
  entry: path.resolve(__dirname, 'web', 'src', 'index.js'),
7
7
  output: {
8
8
  filename: 'bundle.js',
9
- path: path.resolve(__dirname, "builds", "web", env)
9
+ path: path.resolve(__dirname, "builds", "web", argv.mode)
10
10
  },
11
11
  resolve: {
12
12
  alias: {
13
- driver: path.join(__dirname, 'web', 'src', 'driver', env)
13
+ driver: path.join(__dirname, 'web', 'src', 'driver', argv.mode)
14
14
  }
15
15
  },
16
16
  plugins: [
17
- new CopyWebpackPlugin([
18
- {
19
- from: path.resolve(__dirname, 'web', 'public')
20
- },
21
- ])
17
+ new CopyWebpackPlugin({
18
+ patterns: [
19
+ {
20
+ from: path.resolve(__dirname, 'web', 'public')
21
+ }
22
+ ]
23
+ })
22
24
  ],
23
25
  module: {
24
- rules: [
25
- {
26
- test: /\.css$/,
27
- use: ['style-loader', 'css-loader']
28
- },
29
- {
30
- test: /\.(png|jp(e*)g|svg)$/,
31
- use: [{
32
- loader: 'url-loader',
33
- options: {
34
- limit: 8000, // Convert images < 8kb to base64 strings
35
- name: 'images/[hash]-[name].[ext]'
36
- }
37
- }]
38
- },
39
- {
40
- test: /\.jsx?/,
41
- include: path.resolve(__dirname, 'web'),
42
- use: 'babel-loader'
26
+ rules: [
27
+ {
28
+ test: /\.css$/,
29
+ use: [
30
+ 'style-loader',
31
+ { loader: 'css-loader', options: { esModule: false } }
32
+ ]
33
+ },
34
+ {
35
+ test: /\.(png|jp(e*)g|svg)$/,
36
+ use: [{
37
+ loader: 'url-loader',
38
+ options: {
39
+ limit: 8000, // Convert images < 8kb to base64 strings
40
+ name: 'images/[hash]-[name].[ext]'
43
41
  }
44
- ]
42
+ }]
43
+ },
44
+ {
45
+ test: /\.jsx?/,
46
+ include: path.resolve(__dirname, 'web'),
47
+ use: 'babel-loader'
48
+ }
49
+ ]
45
50
  }
46
51
  }
47
52
 
48
- if (env == 'production') {
53
+ if (argv.mode == 'production') {
49
54
  config.module.rules.push(
50
55
  {
51
56
  // opal-webpack-bundler will compile and include ruby files in the pack
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '1.0'
87
+ version: '1.1'
88
88
  type: :runtime
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '1.0'
94
+ version: '1.1'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: sinatra
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -248,10 +248,12 @@ files:
248
248
  - lib/gamefic-sdk/tasks/web.rb
249
249
  - lib/gamefic-sdk/version.rb
250
250
  - scaffolds/library/Gemfile
251
+ - scaffolds/library/README.md.erb
251
252
  - scaffolds/library/__name__.gemspec.gf.erb
252
253
  - scaffolds/library/lib/__name__.rb
253
254
  - scaffolds/project/.gitignore
254
255
  - scaffolds/project/Gemfile
256
+ - scaffolds/project/README.md.erb
255
257
  - scaffolds/project/Rakefile
256
258
  - scaffolds/project/main.rb.gf.erb
257
259
  - scaffolds/react/.babelrc
@@ -261,6 +263,11 @@ files:
261
263
  - scaffolds/react/web/src/driver/opal.rb
262
264
  - scaffolds/react/web/src/driver/production.js
263
265
  - scaffolds/react/web/src/index.js
266
+ - scaffolds/react/web/src/scenes/Activity.jsx
267
+ - scaffolds/react/web/src/scenes/Conclusion.jsx
268
+ - scaffolds/react/web/src/scenes/MultipleChoice.jsx
269
+ - scaffolds/react/web/src/scenes/Pause.jsx
270
+ - scaffolds/react/web/src/scenes/index.js
264
271
  - scaffolds/react/web/src/style.css
265
272
  - scaffolds/react/webpack.config.js
266
273
  homepage: http://gamefic.com
@@ -282,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
289
  - !ruby/object:Gem::Version
283
290
  version: '0'
284
291
  requirements: []
285
- rubygems_version: 3.0.3
292
+ rubygems_version: 3.1.2
286
293
  signing_key:
287
294
  specification_version: 4
288
295
  summary: Gamefic SDK