miijs 2.4.2 → 2.5.1

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.
package/package.json CHANGED
@@ -1,11 +1,40 @@
1
1
  {
2
2
  "name": "miijs",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "The most complete and easy to use Mii library on the market.",
5
5
  "main": "index.js",
6
+ "browser": "dist/miijs.browser.js",
7
+ "module": "dist/miijs.browser.esm.js",
8
+ "exports": {
9
+ ".": {
10
+ "browser": "./dist/miijs.browser.js",
11
+ "import": "./dist/miijs.browser.esm.js",
12
+ "require": "./index.js",
13
+ "default": "./index.js"
14
+ },
15
+ "./browser": {
16
+ "import": "./dist/miijs.browser.esm.js",
17
+ "default": "./dist/miijs.browser.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "index.js",
22
+ "dist/",
23
+ "shims/",
24
+ "Enums.js",
25
+ "asmCrypto.js",
26
+ "amiiboHandler.js",
27
+ "fflWrapper.js",
28
+ "data.json",
29
+ "types.d.ts",
30
+ "patch-ffl.js"
31
+ ],
6
32
  "scripts": {
7
33
  "test": "jest",
8
- "postinstall": "node ./patch-ffl.js"
34
+ "postinstall": "node ./patch-ffl.js",
35
+ "build": "node build-browser.js",
36
+ "serve": "node build-browser.js --serve",
37
+ "prepublishOnly": "npm run build"
9
38
  },
10
39
  "repository": {
11
40
  "type": "git",
@@ -26,6 +55,7 @@
26
55
  },
27
56
  "homepage": "https://github.com/Stewared/MiiJS#readme",
28
57
  "dependencies": {
58
+ "buffer": "^6.0.3",
29
59
  "canvas": "^3.1.0",
30
60
  "ffl.js": "github:ariankordi/FFL.js#06ede8f",
31
61
  "gl": "^8.1.6",
@@ -40,6 +70,10 @@
40
70
  "three": "^0.162.0"
41
71
  },
42
72
  "devDependencies": {
73
+ "@babel/core": "^7.28.6",
74
+ "@babel/preset-env": "^7.28.6",
75
+ "babel-jest": "^30.2.0",
76
+ "esbuild": "^0.27.2",
43
77
  "jest": "^30.0.1"
44
78
  }
45
79
  }
@@ -0,0 +1,11 @@
1
+ // Stub for amiiboHandler in browser builds
2
+ // Amiibo functions require Node.js crypto module
3
+
4
+ module.exports = {
5
+ insertMiiIntoAmiibo: function() {
6
+ throw new Error('insertMiiIntoAmiibo is only available in Node.js');
7
+ },
8
+ extractMiiFromAmiibo: function() {
9
+ throw new Error('extractMiiFromAmiibo is only available in Node.js');
10
+ }
11
+ };
@@ -0,0 +1,4 @@
1
+ // Browser crypto shim
2
+ // The amiiboHandler detects browser environment and uses crypto.subtle directly
3
+ // This shim exports nothing since amiiboHandler checks isNode before using nodeCrypto
4
+ module.exports = null;
package/shims/empty.js ADDED
@@ -0,0 +1,2 @@
1
+ // Empty shim for Node.js-only modules in browser builds
2
+ module.exports = {};
@@ -0,0 +1,13 @@
1
+ // Stub for fflWrapper in browser builds
2
+ // These functions are not available in the browser
3
+
4
+ module.exports = {
5
+ createCharModel: null,
6
+ initCharModelTextures: null,
7
+ initializeFFL: null,
8
+ exitFFL: null,
9
+ parseHexOrB64ToUint8Array: null,
10
+ setIsWebGL1State: null,
11
+ getCameraForViewType: null,
12
+ ViewType: null,
13
+ };
@@ -0,0 +1,26 @@
1
+ // Browser path shim with minimal functionality
2
+ module.exports = {
3
+ join: function(...parts) {
4
+ return parts.filter(Boolean).join('/').replace(/\/+/g, '/');
5
+ },
6
+ dirname: function(p) {
7
+ const parts = p.split('/');
8
+ parts.pop();
9
+ return parts.join('/') || '.';
10
+ },
11
+ basename: function(p, ext) {
12
+ let base = p.split('/').pop() || '';
13
+ if (ext && base.endsWith(ext)) {
14
+ base = base.slice(0, -ext.length);
15
+ }
16
+ return base;
17
+ },
18
+ extname: function(p) {
19
+ const base = p.split('/').pop() || '';
20
+ const idx = base.lastIndexOf('.');
21
+ return idx > 0 ? base.slice(idx) : '';
22
+ },
23
+ resolve: function(...parts) {
24
+ return parts.filter(Boolean).join('/').replace(/\/+/g, '/');
25
+ }
26
+ };
@@ -1,36 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: 20
18
- - run: npm ci
19
- - run: npm test
20
-
21
- publish-gpr:
22
- needs: build
23
- runs-on: ubuntu-latest
24
- permissions:
25
- contents: read
26
- packages: write
27
- steps:
28
- - uses: actions/checkout@v4
29
- - uses: actions/setup-node@v4
30
- with:
31
- node-version: 20
32
- registry-url: https://npm.pkg.github.com/
33
- - run: npm ci
34
- - run: npm publish
35
- env:
36
- NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/crown.jpg DELETED
Binary file
package/ideal.jsonc DELETED
@@ -1,91 +0,0 @@
1
- {
2
- "general":{
3
- "type":0,//[Normal,Favorite,Foreign,Special]
4
- "gender":0,//["Male","Female"],
5
- "favoriteColor":0,//["Red","Orange","Yellow","Lime","Green","Blue","Cyan","Pink","Purple","Brown","White","Black"]
6
- "birthday":"4",
7
- "birthMonth":"17",
8
- "height":100,//Conversion from feet?
9
- "weight":55//Conversion from pounds, indexed to height?
10
- },
11
- "meta":{
12
- "creatorName":"",
13
- "name":"",
14
- "console":"",
15
- "miiId":"148",
16
- "systemId":"148"
17
- },
18
- "perms":{
19
- "mingle":true,
20
- "sharing":true,
21
- "copying":true,
22
- "fromCheckMiiOut":false
23
- },
24
- "face":{
25
- "type":0,
26
- "color":0,//["White","Tanned White","Darker White","Tanned Darker","Mostly Black","Black"],
27
- "feature":0,//["None","Blush","Makeup and Blush","Freckles","Bags","Wrinkles on Cheeks","Wrinkles near Eyes","Chin Wrinkle","Makeup","Stubble","Wrinkles near Mouth","Wrinkles"], ["None","Near Eye Creases","Cheek Creases","Far Eye Creases","Near Nose Creases","Giant Bags","Cleft Chin","Chin Crease","Sunken Eyes","Far Cheek Creases","Lines Near Eyes","Wrinkles"]
28
- "makeup":0//["None","Blush","Orange Blush","Blue Eyes","Blush 2","Orange Blush 2","Blue Eyes and Blush","Orange Eyes and Blush","Purple Eyes and Blush 2","Freckles","Beard Stubble","Beard and Mustache Stubble"]
29
- },
30
- "nose": {
31
- "page": 0,
32
- "type": 0,
33
- "size": 4,
34
- "yPosition": 8
35
- },
36
- "mouth":{
37
- "page":0,
38
- "type":0,
39
- "size":0,
40
- "yPosition":0,
41
- "squash":0,
42
- "color":0//["Peach","Red","Pink"], ["Orange","Red","Pink","Peach","Black"]
43
- },
44
- "mole": {
45
- "on": false,
46
- "size": 4,
47
- "xPosition": 2,
48
- "yPosition": 20
49
- },
50
- "hair":{
51
- "page":0,
52
- "type":0,
53
- "color":0,//["Black","Brown","Red","Reddish Brown","Grey","Light Brown","Dark Blonde","Blonde"]
54
- "flipped":false
55
- },
56
- "eyebrows":{
57
- "page":0,
58
- "type":0,
59
- "rotation":0,
60
- "size":0,
61
- "yPosition":0,
62
- "distanceApart":0,
63
- "squash":0,
64
- "color":0//["Black","Brown","Red","Reddish Brown","Grey","Light Brown","Dark Blonde","Blonde"]
65
- },
66
- "eyes":{
67
- "page":0,
68
- "type":0,
69
- "rotation":0,
70
- "yPosition":0,
71
- "size":0,
72
- "distanceApart":0,
73
- "squash":0,
74
- "color":0//["Black","Grey","Brown","Lime","Blue","Green"]
75
- },
76
- "glasses":{
77
- "type":0,
78
- "size":0,
79
- "yPosition":0,
80
- "color":0//["Grey","Brown","Red","Blue","Yellow","White"], ["Black","Brown","Red","Blue","Yellow","Grey"]
81
- },
82
- "beard":{
83
- "mustache":{
84
- "type":0,
85
- "size":0,
86
- "yPosition":0
87
- },
88
- "type":0,
89
- "color":0//["Black","Brown","Red","Reddish Brown","Grey","Light Brown","Dark Blonde","Blonde"]
90
- }
91
- }