gamefic-sdk 2.0.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e0d49f6613cf8a2af519a9d95a7140fc82636b2a98331f3d838163a859cd047
4
- data.tar.gz: 86cc54aaa54f961b6284fb14e663e47b42cc920b2aa117216bd477d63be816f7
3
+ metadata.gz: f10176e643c4b2c2d6cfaab7cc0e9ef02b5e1d2611663c3722b22fd26f8a19ff
4
+ data.tar.gz: 8337ecbafa9ddfc546f1002bf176f507447640429ea110c96b544c046e52c205
5
5
  SHA512:
6
- metadata.gz: a02515a9a657855de8e65304876ae242a6393384dc33892b4e09db879e49313e919ba716f5e0835c0056d82acf113b1bbc0f6287b2ea099dab2c354e78077271
7
- data.tar.gz: 981c9bdb667f8600c5d414048907dd2ab89d70f2f62b78a31c6c10f3a38a055dfedf36108d1ce534851bab322c6e33b3eef434814d6ad8051b99d340f8f59a7d
6
+ metadata.gz: 7e89c8edd366ac6e4a36b9edfa5bf7240ff344297e6ccfcef105ee92c3ee4f7ce7ac771498f32cf2bbdc69562a292bd1b4de9eeecc9ea3e06e54d0a646130ccb
7
+ data.tar.gz: 241fbc39235327f6e03aefb68955650a73f17508212f5482ebb9bdaebb82e449fefd0aeb4f04198054aad49ea07505c2f080f4e3a526e3b6e22645803c22e6b8
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
@@ -0,0 +1,12 @@
1
+ ## 2.3.0 - December 14, 2020
2
+ - Update package dependencies for web builds
3
+
4
+ ## 2.2.0 - August 29, 2020
5
+ - Update to react-gamefic 0.4.0
6
+
7
+ ## 2.1.0 - August 27, 2020
8
+ - Update web app with customizable scene components
9
+
10
+ ## 2.0.4 - April 25, 2020
11
+ - Server does not symbolize snapshot keys
12
+ - Update dependencies
data/README.md CHANGED
@@ -123,7 +123,7 @@ Note: building the web app requires [Node.js](https://nodejs.org).
123
123
  ### Example Projects
124
124
 
125
125
  The gamefic-sdk repo includes several example projects that provide more
126
- more complete demonstrations of Gamefic's features. To run an example, copy
126
+ complete demonstrations of Gamefic's features. To run an example, copy
127
127
  its `main.rb` file to your own project.
128
128
 
129
129
  ### Learning More
@@ -4,13 +4,3 @@ require 'gamefic-sdk'
4
4
  require 'gamefic-sdk/shell'
5
5
 
6
6
  Gamefic::Sdk::Shell.start(ARGV)
7
-
8
- #!/usr/bin/env ruby
9
-
10
- #require 'gamefic'
11
- #require 'gamefic-tty'
12
-
13
- # Make play the default command if the first argument is an existing file
14
- #args = %w(play help).include?(ARGV[0]) || ARGV.count.zero? || !File.exist?(ARGV[0]) ? ARGV : ARGV.dup.unshift('play')
15
-
16
- #Gamefic::Tty::Shell.start(args)
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.required_ruby_version = '>= 2.3.0'
26
26
 
27
- s.add_runtime_dependency 'gamefic', '~> 2.0', '>= 2.0.1'
27
+ s.add_runtime_dependency 'gamefic', '~> 2.0', '>= 2.0.2'
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'
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
35
35
  s.add_development_dependency 'bundler', '~> 2.0'
36
36
  s.add_development_dependency 'capybara', '~> 3.3'
37
37
  s.add_development_dependency 'puma', '~> 3'
38
- s.add_development_dependency 'rake', '~> 10.0'
38
+ s.add_development_dependency 'rake', '~> 13.0'
39
39
  s.add_development_dependency 'rspec', '~> 3.0'
40
40
  s.add_development_dependency 'selenium-webdriver', '~> 3.13'
41
41
  s.add_development_dependency 'simplecov', '~> 0.14'
@@ -32,7 +32,6 @@ module Gamefic
32
32
  content_type :json
33
33
  @@plot.update
34
34
  @@plot.ready
35
- # @@character.state.merge(input: params['command'], continued: @@character.queue.any?).to_json
36
35
  @@character.output.to_json
37
36
  end
38
37
 
@@ -45,7 +44,7 @@ module Gamefic
45
44
  content_type :json
46
45
  # The snapshot needs to be received as a JSON string because of issues
47
46
  # with IndifferentHash malforming arrays.
48
- snapshot = JSON.parse(params['snapshot'], symbolize_names: true)
47
+ snapshot = JSON.parse(params['snapshot'])
49
48
  @@plot.restore snapshot
50
49
  @@character.cue @@plot.default_scene
51
50
  @@plot.update
@@ -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.2'
3
+ VERSION = '2.3.0'
4
4
  end
5
5
  end
@@ -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.1"
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,24 +1,26 @@
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
26
  rules: [
@@ -45,7 +47,7 @@ module.exports = (env) => {
45
47
  }
46
48
  }
47
49
 
48
- if (env == 'production') {
50
+ if (argv.mode == 'production') {
49
51
  config.module.rules.push(
50
52
  {
51
53
  // 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.2
4
+ version: 2.3.0
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-03-26 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '2.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 2.0.1
22
+ version: 2.0.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '2.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.1
32
+ version: 2.0.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: gamefic-standard
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -168,14 +168,14 @@ dependencies:
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '10.0'
171
+ version: '13.0'
172
172
  type: :development
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - "~>"
177
177
  - !ruby/object:Gem::Version
178
- version: '10.0'
178
+ version: '13.0'
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: rspec
181
181
  requirement: !ruby/object:Gem::Requirement
@@ -228,6 +228,7 @@ files:
228
228
  - ".gitignore"
229
229
  - ".rspec"
230
230
  - ".travis.yml"
231
+ - CHANGELOG.md
231
232
  - Gemfile
232
233
  - LICENSE.txt
233
234
  - README.md
@@ -260,6 +261,11 @@ files:
260
261
  - scaffolds/react/web/src/driver/opal.rb
261
262
  - scaffolds/react/web/src/driver/production.js
262
263
  - scaffolds/react/web/src/index.js
264
+ - scaffolds/react/web/src/scenes/Activity.jsx
265
+ - scaffolds/react/web/src/scenes/Conclusion.jsx
266
+ - scaffolds/react/web/src/scenes/MultipleChoice.jsx
267
+ - scaffolds/react/web/src/scenes/Pause.jsx
268
+ - scaffolds/react/web/src/scenes/index.js
263
269
  - scaffolds/react/web/src/style.css
264
270
  - scaffolds/react/webpack.config.js
265
271
  homepage: http://gamefic.com
@@ -281,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
287
  - !ruby/object:Gem::Version
282
288
  version: '0'
283
289
  requirements: []
284
- rubygems_version: 3.0.3
290
+ rubygems_version: 3.1.2
285
291
  signing_key:
286
292
  specification_version: 4
287
293
  summary: Gamefic SDK