scorm-again 1.7.1 → 2.0.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.
Files changed (85) hide show
  1. package/.babelrc +18 -7
  2. package/.github/dependabot.yml +5 -0
  3. package/.github/workflows/main.yml +79 -0
  4. package/.jsdoc.json +4 -5
  5. package/.mocharc.json +8 -0
  6. package/.run/Mocha Unit Tests.run.xml +5 -2
  7. package/CONTRIBUTING.md +1 -1
  8. package/README.md +14 -1
  9. package/dist/aicc.js +3661 -7170
  10. package/dist/aicc.js.map +1 -1
  11. package/dist/aicc.min.js +2 -40
  12. package/dist/aicc.min.js.map +1 -0
  13. package/dist/scorm-again.js +5671 -10695
  14. package/dist/scorm-again.js.map +1 -1
  15. package/dist/scorm-again.min.js +2 -52
  16. package/dist/scorm-again.min.js.map +1 -0
  17. package/dist/scorm12.js +2871 -5433
  18. package/dist/scorm12.js.map +1 -1
  19. package/dist/scorm12.min.js +2 -34
  20. package/dist/scorm12.min.js.map +1 -0
  21. package/dist/scorm2004.js +3868 -6797
  22. package/dist/scorm2004.js.map +1 -1
  23. package/dist/scorm2004.min.js +2 -40
  24. package/dist/scorm2004.min.js.map +1 -0
  25. package/eslint.config.js +21 -0
  26. package/package.json +72 -34
  27. package/results.json +34254 -0
  28. package/src/{AICC.js → AICC.ts} +27 -21
  29. package/src/BaseAPI.ts +1449 -0
  30. package/src/Scorm12API.ts +360 -0
  31. package/src/{Scorm2004API.js → Scorm2004API.ts} +245 -163
  32. package/src/cmi/aicc_cmi.ts +1248 -0
  33. package/src/cmi/common.ts +411 -0
  34. package/src/cmi/scorm12_cmi.ts +1426 -0
  35. package/src/cmi/scorm2004_cmi.ts +1874 -0
  36. package/src/constants/api_constants.ts +318 -0
  37. package/src/constants/error_codes.ts +88 -0
  38. package/src/constants/language_constants.ts +394 -0
  39. package/src/constants/regex.ts +97 -0
  40. package/src/constants/{response_constants.js → response_constants.ts} +67 -62
  41. package/src/exceptions.ts +133 -0
  42. package/src/exports/aicc.js +1 -1
  43. package/src/exports/scorm-again.js +3 -3
  44. package/src/exports/scorm12.js +1 -1
  45. package/src/exports/scorm2004.js +1 -1
  46. package/src/{utilities.js → utilities.ts} +114 -74
  47. package/tea.yaml +6 -0
  48. package/test/{AICC.spec.js → AICC.spec.ts} +70 -72
  49. package/test/Scorm12API.spec.ts +580 -0
  50. package/test/Scorm2004API.spec.ts +812 -0
  51. package/test/api_helpers.ts +176 -0
  52. package/test/cmi/{aicc_cmi.spec.js → aicc_cmi.spec.ts} +193 -209
  53. package/test/cmi/{scorm12_cmi.spec.js → scorm12_cmi.spec.ts} +251 -269
  54. package/test/cmi/scorm2004_cmi.spec.ts +1031 -0
  55. package/test/cmi_helpers.ts +207 -0
  56. package/test/exceptions.spec.ts +79 -0
  57. package/test/field_values.ts +202 -0
  58. package/test/utilities.spec.ts +322 -0
  59. package/tsconfig.json +18 -0
  60. package/webpack.config.js +65 -0
  61. package/.circleci/config.yml +0 -99
  62. package/.codeclimate.yml +0 -7
  63. package/.eslintrc.js +0 -36
  64. package/src/.flowconfig +0 -11
  65. package/src/BaseAPI.js +0 -1275
  66. package/src/Scorm12API.js +0 -308
  67. package/src/cmi/aicc_cmi.js +0 -1141
  68. package/src/cmi/common.js +0 -328
  69. package/src/cmi/scorm12_cmi.js +0 -1312
  70. package/src/cmi/scorm2004_cmi.js +0 -1692
  71. package/src/constants/api_constants.js +0 -218
  72. package/src/constants/error_codes.js +0 -87
  73. package/src/constants/language_constants.js +0 -76
  74. package/src/constants/regex.js +0 -84
  75. package/src/exceptions.js +0 -104
  76. package/test/Scorm12API.spec.js +0 -528
  77. package/test/Scorm2004API.spec.js +0 -775
  78. package/test/abstract_classes.spec.js +0 -17
  79. package/test/api_helpers.js +0 -128
  80. package/test/cmi/scorm2004_cmi.spec.js +0 -1066
  81. package/test/cmi_helpers.js +0 -161
  82. package/test/exceptions.spec.js +0 -71
  83. package/test/field_values.js +0 -353
  84. package/test/utilities.spec.js +0 -339
  85. package/webpack.js +0 -78
@@ -0,0 +1,21 @@
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+ import tseslint from "typescript-eslint";
4
+
5
+ export default [
6
+ { files: ["**/*.{js,mjs,cjs,ts}"] },
7
+ { files: ["**/*.js"], languageOptions: { sourceType: "script" } },
8
+ { languageOptions: { globals: globals.browser } },
9
+ pluginJs.configs.recommended,
10
+ ...tseslint.configs.recommended,
11
+ {
12
+ rules: {
13
+ "no-undef": "off",
14
+ "no-unused-vars": "off",
15
+ "@typescript-eslint/no-explicit-any": "off",
16
+ "@typescript-eslint/no-unused-vars": "off",
17
+ "@typescript-eslint/no-unsafe-function-type": "off",
18
+ "@typescript-eslint/no-this-alias": "off",
19
+ },
20
+ },
21
+ ];
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "scorm-again",
3
- "version": "1.7.1",
3
+ "version": "2.0.0",
4
4
  "description": "A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004",
5
5
  "main": "dist/scorm-again.min.js",
6
+ "type": "module",
7
+ "browser": {
8
+ "electron": false
9
+ },
6
10
  "browserslist": [
7
11
  "> 1%",
8
12
  "edge >= 16",
@@ -16,44 +20,55 @@
16
20
  "test": "test"
17
21
  },
18
22
  "devDependencies": {
19
- "@babel/cli": "^7.17.10",
20
- "@babel/core": "^7.18.5",
21
- "@babel/node": "^7.18.5",
22
- "@babel/plugin-proposal-class-properties": "^7.17.12",
23
- "@babel/plugin-proposal-optional-chaining": "^7.17.12",
24
- "@babel/plugin-proposal-private-methods": "^7.17.12",
25
- "@babel/preset-env": "^7.18.2",
26
- "@babel/preset-flow": "^7.17.12",
27
- "@babel/register": "^7.17.7",
28
- "@types/chai": "^4.3.1",
29
- "@types/mocha": "^9.1.1",
23
+ "@babel/cli": "^7.25.7",
24
+ "@babel/core": "^7.25.7",
25
+ "@babel/eslint-parser": "^7.25.7",
26
+ "@babel/node": "^7.25.7",
27
+ "@babel/preset-env": "^7.25.7",
28
+ "@babel/preset-typescript": "^7.25.7",
29
+ "@eslint/eslintrc": "^3.1.0",
30
+ "@eslint/js": "^9.12.0",
31
+ "@istanbuljs/nyc-config-typescript": "^1.0.2",
32
+ "@types/eslint__js": "^8.42.3",
33
+ "@types/expect": "^24.3.0",
34
+ "@types/mocha": "^10.0.8",
35
+ "@types/sinon": "^17.0.3",
30
36
  "babel-eslint": "^11.0.0-beta.2",
31
- "babel-loader": "^8.2.5",
37
+ "babel-loader": "^9.2.1",
32
38
  "babelify": "^10.0.0",
33
- "browserify": "^17.0.0",
34
- "chai": "^4.3.6",
35
- "eslint": "^8.18.0",
36
- "eslint-config-google": "^0.14.0",
37
- "eslint-plugin-import": "^2.26.0",
38
- "eslint-webpack-plugin": "^3.1.1",
39
- "fetch-pretender": "^1.5.0",
40
- "jsdoc": "^3.6.10",
39
+ "browserify": "^17.0.1",
40
+ "c8": "^10.1.2",
41
+ "eslint": "^9.12.0",
42
+ "eslint-formatter-junit": "^8.40.0",
43
+ "eslint-plugin-import": "^2.31.0",
44
+ "eslint-plugin-jsdoc": "^50.3.1",
45
+ "eslint-webpack-plugin": "^4.2.0",
46
+ "expect": "^29.7.0",
47
+ "fetch-pretender": "https://github.com/jcputney/fetch-pretender#master",
48
+ "globals": "^15.10.0",
49
+ "jsdoc": "^4.0.3",
41
50
  "jsdoc-babel": "^0.5.0",
42
- "lodash.debounce": "^4.0.8",
43
- "minimist": "^1.2.5",
44
- "mocha": "^10.0.0",
45
- "mocha-junit-reporter": "^2.0.2",
51
+ "minimist": "^1.2.8",
52
+ "miragejs": "^0.2.0-alpha.3",
53
+ "mocha": "^10.7.3",
54
+ "mocha-junit-reporter": "^2.2.1",
46
55
  "mochawesome": "^7.1.3",
47
- "nyc": "^15.1.0",
48
- "sinon": "^14.0.0",
49
- "uglifyjs-webpack-plugin": "^2.2.0",
50
- "webpack": "^5.73.0",
51
- "webpack-cli": "^4.10.0"
56
+ "prettier": "^3.3.3",
57
+ "sinon": "^19.0.2",
58
+ "terser-webpack-plugin": "^5.3.10",
59
+ "ts-loader": "^9.5.1",
60
+ "tsx": "^4.19.1",
61
+ "typescript": "^5.6.2",
62
+ "typescript-eslint": "^8.8.0",
63
+ "webpack": "^5.91.0",
64
+ "webpack-cli": "^5.1.4"
52
65
  },
53
66
  "scripts": {
54
- "test": "./node_modules/.bin/mocha --require @babel/register --bdd --recursive --reporter list",
55
- "compile": "./node_modules/.bin/webpack --bail --config webpack.js",
56
- "fix": "./node_modules/.bin/eslint ./src --fix"
67
+ "test": "./node_modules/.bin/mocha --import=tsx --bdd --recursive --reporter list",
68
+ "test:coverage": "./node_modules/.bin/c8 ./node_modules/.bin/mocha --import=tsx --recursive --timeout=10000 --exit --reporter json --reporter-option output=test-results.json",
69
+ "compile": "./node_modules/.bin/webpack --bail --config webpack.config.js",
70
+ "fix": "./node_modules/.bin/eslint ./src --fix",
71
+ "prettier": "./node_modules/.bin/prettier --write src/**/*.ts test/**/*.ts src/*.ts test/*.ts"
57
72
  },
58
73
  "repository": {
59
74
  "type": "git",
@@ -69,5 +84,28 @@
69
84
  "bugs": {
70
85
  "url": "https://github.com/jcputney/scorm-again/issues"
71
86
  },
72
- "homepage": "https://github.com/jcputney/scorm-again"
87
+ "homepage": "https://github.com/jcputney/scorm-again",
88
+ "dependencies": {},
89
+ "c8": {
90
+ "extends": "@istanbuljs/nyc-config-typescript",
91
+ "check-coverage": true,
92
+ "all": true,
93
+ "include": [
94
+ "src/**/*.ts"
95
+ ],
96
+ "exclude": [
97
+ "test/**/*.*"
98
+ ],
99
+ "extension": [
100
+ ".ts"
101
+ ],
102
+ "reporter": [
103
+ "html",
104
+ "lcov",
105
+ "text",
106
+ "text-summary"
107
+ ],
108
+ "report-dir": "coverage"
109
+ },
110
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
73
111
  }