cubing 0.61.0 → 0.61.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/dist/bin/chunks/chunk-ZQLNUW2N.js +14 -0
- package/dist/bin/chunks/chunk-ZQLNUW2N.js.map +7 -0
- package/dist/bin/order.js +46 -42
- package/dist/bin/order.js.map +2 -2
- package/dist/bin/puzzle-geometry-bin.js +379 -257
- package/dist/bin/puzzle-geometry-bin.js.map +3 -3
- package/dist/bin/scramble.js +124 -102
- package/dist/bin/scramble.js.map +3 -3
- package/dist/lib/cubing/{KPattern-CU9Suh1T.d.ts → PuzzleLoader-CkghxdIL.d.ts} +186 -179
- package/dist/lib/cubing/alg/index.d.ts +2 -2
- package/dist/lib/cubing/bluetooth/index.d.ts +3 -3
- package/dist/lib/cubing/bluetooth/index.js +4 -4
- package/dist/lib/cubing/{bluetooth-puzzle-gTRbIRyj.d.ts → bluetooth-puzzle-c-_IBAdu.d.ts} +1 -1
- package/dist/lib/cubing/chunks/{chunk-ABQAUY7H.js → chunk-557DMXD6.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-RKTO4CAU.js → chunk-7DT3G3FA.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-BUZPONAW.js → chunk-I5QO52OG.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-PVOSBZRD.js → chunk-KZGAQEPN.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-RUSWM2KK.js → chunk-ST4K23C3.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-RUSWM2KK.js.map → chunk-ST4K23C3.js.map} +1 -1
- package/dist/lib/cubing/chunks/{chunk-REBGU5ET.js → chunk-T3SF7NHB.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-OJI4YUWF.js → chunk-UMNYMJKD.js} +4 -4
- package/dist/lib/cubing/chunks/{chunk-WIZJQ7QS.js → chunk-UZ7SWKN6.js} +15 -15
- package/dist/lib/cubing/chunks/{chunk-PSQEELP4.js → chunk-WAYEJXCG.js} +1 -1
- package/dist/lib/cubing/chunks/chunk-WAYEJXCG.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-NX2Q6B7Y.js → chunk-ZKJKRQKY.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-NX2Q6B7Y.js.map → chunk-ZKJKRQKY.js.map} +2 -2
- package/dist/lib/cubing/chunks/{inside-PM6546BQ.js → inside-K3VX2AIZ.js} +12 -12
- package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-BOGUHF4Q.js → puzzles-dynamic-side-events-IMYJ533P.js} +1 -1
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-IMYJ533P.js.map +7 -0
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-SYC27DSG.js → search-dynamic-sgs-side-events-RIRYKEP5.js} +4 -4
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-QGGV4PCJ.js → search-dynamic-sgs-unofficial-N4CRUF4Q.js} +4 -4
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-IE5W637Q.js → search-dynamic-solve-4x4x4-4UB4NMF3.js} +7 -7
- package/dist/lib/cubing/chunks/search-worker-entry.js +3 -3
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-LPZQIDD2.js → twisty-dynamic-3d-OCL53BVF.js} +5 -5
- package/dist/lib/cubing/{index-CORXpckt.d.ts → index-B_8W-2zR.d.ts} +1 -1
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/kpuzzle/index.js +1 -1
- package/dist/lib/cubing/notation/index.d.ts +1 -1
- package/dist/lib/cubing/notation/index.js +3 -3
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.js +3 -3
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -2
- package/dist/lib/cubing/puzzle-geometry/index.js +138 -179
- package/dist/lib/cubing/puzzle-geometry/index.js.map +3 -3
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/puzzles/index.js +3 -3
- package/dist/lib/cubing/scramble/index.d.ts +2 -2
- package/dist/lib/cubing/scramble/index.js +6 -6
- package/dist/lib/cubing/search/index.d.ts +3 -3
- package/dist/lib/cubing/search/index.js +6 -6
- package/dist/lib/cubing/stream/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.js +5 -5
- package/dist/lib/cubing/twisty/index.js.map +1 -1
- package/experimental-json-schema/kpuzzle/KPatternData.schema.json +22 -30
- package/experimental-json-schema/kpuzzle/KPuzzleDefinition.schema.json +72 -89
- package/experimental-json-schema/kpuzzle/KTransformationData.schema.json +17 -26
- package/package.json +54 -100
- package/dist/bin/chunks/chunk-J53ID3VX.js +0 -26
- package/dist/bin/chunks/chunk-J53ID3VX.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-PSQEELP4.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-BOGUHF4Q.js.map +0 -7
- /package/dist/lib/cubing/chunks/{chunk-ABQAUY7H.js.map → chunk-557DMXD6.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-RKTO4CAU.js.map → chunk-7DT3G3FA.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-BUZPONAW.js.map → chunk-I5QO52OG.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-PVOSBZRD.js.map → chunk-KZGAQEPN.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-REBGU5ET.js.map → chunk-T3SF7NHB.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-OJI4YUWF.js.map → chunk-UMNYMJKD.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-WIZJQ7QS.js.map → chunk-UZ7SWKN6.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{inside-PM6546BQ.js.map → inside-K3VX2AIZ.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-SYC27DSG.js.map → search-dynamic-sgs-side-events-RIRYKEP5.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-QGGV4PCJ.js.map → search-dynamic-sgs-unofficial-N4CRUF4Q.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-IE5W637Q.js.map → search-dynamic-solve-4x4x4-4UB4NMF3.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{twisty-dynamic-3d-LPZQIDD2.js.map → twisty-dynamic-3d-OCL53BVF.js.map} +0 -0
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"additionalProperties": {
|
|
4
|
+
"$ref": "#/definitions/KPatternOrbitData"
|
|
5
|
+
},
|
|
3
6
|
"definitions": {
|
|
4
|
-
"numbers": {
|
|
5
|
-
"type": "array",
|
|
6
|
-
"items": {
|
|
7
|
-
"type": "number"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"AlgString": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
7
|
"KPatternOrbitData": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"required": ["pieces", "orientation"],
|
|
16
|
-
"additionalProperties": false,
|
|
17
8
|
"properties": {
|
|
18
|
-
"pieces": {
|
|
19
|
-
"$ref": "#/definitions/numbers"
|
|
20
|
-
},
|
|
21
9
|
"orientation": {
|
|
22
|
-
"
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "number"
|
|
12
|
+
},
|
|
13
|
+
"type": "array"
|
|
23
14
|
},
|
|
24
15
|
"orientationMod": {
|
|
25
|
-
"
|
|
16
|
+
"description": "Each piece may have an \"orientation mod\" that means \"the orientation of\nthis piece is known mod [value]\".\n\nSuppose `.numOrientations` for this orbit has a value of N. This is\nconsidered the default value for the orientation mod of each piece in the\norbit.\n\n- Each entry must be one of the following:\n - A proper divisor of N.\n - For example: if N is 12, then one of: 1, 2, 3, 6\n - The special value 0, indicating the default value (N).\n - This indicates that the orientation of a piece is fully known, i.e.\n that its \"orientation mod\" is the default value (N). However, such a\n value is recorded as 0 instead of N, in order to make it simpler to\n implement and debug pattern logic involving the default value.\n- If `.orientationMod[i]` is a proper divisor of N (i.e. not 0), then\n `.orientation[i]` must be less than `.orientationMod[i]`. That is, the\n orientation values must be individually \"normalized\" for each piece.\n- If the `orientationMod` field is not present, then every piece is\n considered to have the default value for its \"orientation mod\".\n\nFor a \"real-world\" example of this concept, consider a traditional analog\n12-hour clock dial, like one that might hang on the wall in a school room.\nAlthough there are 24 hours in a day, A.M. and P.M. times are not\ndistinguishable on such a clock. Since 3:00 (AM) and 15:00 are not\ndistinguishable, we would read either of those times as 3:00 with an\nimplicit \"orientation mod\" of 12.\n\nFor most puzzles, however, we care about \"visual\" indistinguishability\nrather than \"temporal\" indistinguishability. To adapt the previous example,\nimagine a 24-hour clock with 24 hour marks around the dial, but where the\nhour hand is symmetric and points equally at the current hour as well as\nits diametic opposite (like a compass needle but painted all in one color).\nThis has the same set of \"valid patterns\" as a normal 12-hour clock. Such a\nclock also has an \"orientation mod\" of 12, but where the multiples of the\nmodulus have been \"unfolded\" to show their full symmetry instead of being\nimplicit.\n\nFor a non-trivial puzzle example, consider Eitan's FisherTwist, a shape mod\nof the 3x3x3 cube:\nhttps://www.hknowstore.com/locale/en-US/item.aspx?corpname=nowstore&itemid=97eb4e89-367e-4d02-b7f0-34e5e7f3cd12\n\n- The 4 equatorial centers have C₂ symmetry — it is possible to rotate any\n of these centers 180° without a visible change to the state. This means\n that the possible orientations \"loop\" after incrementing the orientation\n by 2 (two turns clockwise), and therefore the \"orientation mod\" of a\n given piece is only 2.\n - If we apply a counter-clockwise rotation to one of these centers, the\n transformation applies an orientation of 3. But the net orientation is\n recorded as a normalized value of 1 instead, because 3 (mod 2) ≡ 1 (mod\n 2).\n- The 2 polar centers (U and D) have no distinguishable rotations. This\n means that their orientation is \"known mod 1\" — any transformation of one\n of these centers is indistinguishable from another transformation of the\n same center, and all of them are mapped to a value of 0 (the only\n possible value that exists mod 1).\n\nFor 3x3x3:\n\n- When solving a normal 3x3x3, center orientations are conventionally\n ignored. This is similar to the polar center case for Eitan's\n FisherTwist, and the \"orientation mod\" of each piece is 1. This is also\n the core motivating use case.\n- For a supercube\n (https://experiments.cubing.net/cubing.js/twisty/supercube.html) or the\n general case of a \"picture cube\", all four center orientations are\n distinguishable for every center. This means all centers have the default\n orientation mod of 4. As documented above, this can be recorded with a\n `.orientationMod` of `[0, 0, 0, 0, 0, 0]`, or equivalently by omitting\n the `.orientationMod` field.\n- When modeling a real 3x3x3 speedcube, it is common to have a logo on a\n single sticker. If you want to model the exact visually distinguishable\n states of such a puzzles, it is possible to use an `.orientationMod` such\n as `[0, 1, 1, 1, 1, 1]`. For example, this can make it easy to find an\n alg for a given case \"while keeping the logo the same\", without placing\n more restrictions on other centers (which could make the search slower or\n produce longer solutions).\n\nFor those with a mathematical background, you may notice a relationship to\nthe concept of a coset (https://en.wikipedia.org/wiki/Coset). For example,\nconsider the group of patterns of a `KPuzzle` (without indistinguishable\npieces) generated by a set of transformations. We can assign each set of\npiece orbits an orientation mod value (which must be identical for all\nconstituent pieces of the same orbit). Each such choice generates a set of\nvalid `KPattern`s that forms a subgroup, and each set of valid `.orientation`\nvalues defines one coset of this set. However, note that the set of valid\n`KPattern`s does *not* form a group when there are any pieces with different\n`.orientationMod` values that share an orbit.\n\n--------\n\nNote that the concept of \"orientation mod\" exclusively applies to `KPattern`,\nnot `KTransformation`. If we tried to apply the orientation mod\ncalculations to the *transformations* of Eitan's FisherTwist, then `SWAP =\n[U, M' E2 M]` would be indistinguishable from the identity. This would mean\nthat if we calculated `SWAP` and then used this calculation for `S SWAP\nS'`, then we would conclude that it has no net effect. However, `S SWAP S'`\ndoes *not* have the same effect as doing nothing — it visibly rotates the L\nand R centers! (In mathematical terms: the set of `KTransformation`s would\nnot form a valid set of semigroup actions, due to broken associativity.)\n\nAlthough there are times that we could theoretically save some time/space\nby ignoring some information when it's not needed for working with certain\n`KTransformation`s (e.g. ignoring all center orientations for 3x3x3), it is\nmore practical for each `KTransformation` to always track the full range\nfor each piece's `.orientation`. For example:\n\n- This is simpler, both conceptually and in code.\n- This allows changing the set of moves for a puzzle, without recalculating\n cached transformations or certain lookup tables (useful for alg\n searches).\n- This allows swapping out a normal 3x3x3 in a `<twisty-player>` for a\n picture cube, without re-calculating the center orientations of the\n current alg.\n\nThese use cases may not be strictly \"necessary\", but the opposite behaviour\nmight be surprising or frustrating if someone does not expect it. So we\nimplement it this way.\n\nInformally, the `KTransformation` has the full responsibility for tracking\n\"what really happens\" — even if the effect is invisible in some cases,\nwhile the `KPattern` tracks both what \"is\" and what \"isn't\" known.",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "number"
|
|
19
|
+
},
|
|
20
|
+
"type": "array"
|
|
21
|
+
},
|
|
22
|
+
"pieces": {
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "number"
|
|
25
|
+
},
|
|
26
|
+
"type": "array"
|
|
26
27
|
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"KPatternData": {
|
|
30
|
-
"type": "object",
|
|
31
|
-
"additionalProperties": {
|
|
32
|
-
"$ref": "#/definitions/KPatternOrbitData"
|
|
33
28
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"type": "string"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
29
|
+
"required": ["orientation", "pieces"],
|
|
30
|
+
"type": "object"
|
|
39
31
|
}
|
|
40
32
|
},
|
|
41
|
-
"
|
|
33
|
+
"type": "object"
|
|
42
34
|
}
|
|
@@ -1,114 +1,97 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"definitions": {
|
|
4
|
-
"numbers": {
|
|
5
|
-
"type": "array",
|
|
6
|
-
"items": {
|
|
7
|
-
"type": "number"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"AlgString": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
4
|
"KPatternOrbitData": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"required": ["pieces", "orientation"],
|
|
16
|
-
"additionalProperties": false,
|
|
17
5
|
"properties": {
|
|
18
|
-
"pieces": {
|
|
19
|
-
"$ref": "#/definitions/numbers"
|
|
20
|
-
},
|
|
21
6
|
"orientation": {
|
|
22
|
-
"
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "number"
|
|
9
|
+
},
|
|
10
|
+
"type": "array"
|
|
23
11
|
},
|
|
24
12
|
"orientationMod": {
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"type": "object",
|
|
31
|
-
"additionalProperties": {
|
|
32
|
-
"$ref": "#/definitions/KPatternOrbitData"
|
|
33
|
-
},
|
|
34
|
-
"properties": {
|
|
35
|
-
"$schema": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"KTransformationOrbitData": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"required": ["permutation", "orientationDelta"],
|
|
43
|
-
"additionalProperties": false,
|
|
44
|
-
"properties": {
|
|
45
|
-
"permutation": {
|
|
46
|
-
"$ref": "#/definitions/numbers"
|
|
13
|
+
"description": "Each piece may have an \"orientation mod\" that means \"the orientation of\nthis piece is known mod [value]\".\n\nSuppose `.numOrientations` for this orbit has a value of N. This is\nconsidered the default value for the orientation mod of each piece in the\norbit.\n\n- Each entry must be one of the following:\n - A proper divisor of N.\n - For example: if N is 12, then one of: 1, 2, 3, 6\n - The special value 0, indicating the default value (N).\n - This indicates that the orientation of a piece is fully known, i.e.\n that its \"orientation mod\" is the default value (N). However, such a\n value is recorded as 0 instead of N, in order to make it simpler to\n implement and debug pattern logic involving the default value.\n- If `.orientationMod[i]` is a proper divisor of N (i.e. not 0), then\n `.orientation[i]` must be less than `.orientationMod[i]`. That is, the\n orientation values must be individually \"normalized\" for each piece.\n- If the `orientationMod` field is not present, then every piece is\n considered to have the default value for its \"orientation mod\".\n\nFor a \"real-world\" example of this concept, consider a traditional analog\n12-hour clock dial, like one that might hang on the wall in a school room.\nAlthough there are 24 hours in a day, A.M. and P.M. times are not\ndistinguishable on such a clock. Since 3:00 (AM) and 15:00 are not\ndistinguishable, we would read either of those times as 3:00 with an\nimplicit \"orientation mod\" of 12.\n\nFor most puzzles, however, we care about \"visual\" indistinguishability\nrather than \"temporal\" indistinguishability. To adapt the previous example,\nimagine a 24-hour clock with 24 hour marks around the dial, but where the\nhour hand is symmetric and points equally at the current hour as well as\nits diametic opposite (like a compass needle but painted all in one color).\nThis has the same set of \"valid patterns\" as a normal 12-hour clock. Such a\nclock also has an \"orientation mod\" of 12, but where the multiples of the\nmodulus have been \"unfolded\" to show their full symmetry instead of being\nimplicit.\n\nFor a non-trivial puzzle example, consider Eitan's FisherTwist, a shape mod\nof the 3x3x3 cube:\nhttps://www.hknowstore.com/locale/en-US/item.aspx?corpname=nowstore&itemid=97eb4e89-367e-4d02-b7f0-34e5e7f3cd12\n\n- The 4 equatorial centers have C₂ symmetry — it is possible to rotate any\n of these centers 180° without a visible change to the state. This means\n that the possible orientations \"loop\" after incrementing the orientation\n by 2 (two turns clockwise), and therefore the \"orientation mod\" of a\n given piece is only 2.\n - If we apply a counter-clockwise rotation to one of these centers, the\n transformation applies an orientation of 3. But the net orientation is\n recorded as a normalized value of 1 instead, because 3 (mod 2) ≡ 1 (mod\n 2).\n- The 2 polar centers (U and D) have no distinguishable rotations. This\n means that their orientation is \"known mod 1\" — any transformation of one\n of these centers is indistinguishable from another transformation of the\n same center, and all of them are mapped to a value of 0 (the only\n possible value that exists mod 1).\n\nFor 3x3x3:\n\n- When solving a normal 3x3x3, center orientations are conventionally\n ignored. This is similar to the polar center case for Eitan's\n FisherTwist, and the \"orientation mod\" of each piece is 1. This is also\n the core motivating use case.\n- For a supercube\n (https://experiments.cubing.net/cubing.js/twisty/supercube.html) or the\n general case of a \"picture cube\", all four center orientations are\n distinguishable for every center. This means all centers have the default\n orientation mod of 4. As documented above, this can be recorded with a\n `.orientationMod` of `[0, 0, 0, 0, 0, 0]`, or equivalently by omitting\n the `.orientationMod` field.\n- When modeling a real 3x3x3 speedcube, it is common to have a logo on a\n single sticker. If you want to model the exact visually distinguishable\n states of such a puzzles, it is possible to use an `.orientationMod` such\n as `[0, 1, 1, 1, 1, 1]`. For example, this can make it easy to find an\n alg for a given case \"while keeping the logo the same\", without placing\n more restrictions on other centers (which could make the search slower or\n produce longer solutions).\n\nFor those with a mathematical background, you may notice a relationship to\nthe concept of a coset (https://en.wikipedia.org/wiki/Coset). For example,\nconsider the group of patterns of a `KPuzzle` (without indistinguishable\npieces) generated by a set of transformations. We can assign each set of\npiece orbits an orientation mod value (which must be identical for all\nconstituent pieces of the same orbit). Each such choice generates a set of\nvalid `KPattern`s that forms a subgroup, and each set of valid `.orientation`\nvalues defines one coset of this set. However, note that the set of valid\n`KPattern`s does *not* form a group when there are any pieces with different\n`.orientationMod` values that share an orbit.\n\n--------\n\nNote that the concept of \"orientation mod\" exclusively applies to `KPattern`,\nnot `KTransformation`. If we tried to apply the orientation mod\ncalculations to the *transformations* of Eitan's FisherTwist, then `SWAP =\n[U, M' E2 M]` would be indistinguishable from the identity. This would mean\nthat if we calculated `SWAP` and then used this calculation for `S SWAP\nS'`, then we would conclude that it has no net effect. However, `S SWAP S'`\ndoes *not* have the same effect as doing nothing — it visibly rotates the L\nand R centers! (In mathematical terms: the set of `KTransformation`s would\nnot form a valid set of semigroup actions, due to broken associativity.)\n\nAlthough there are times that we could theoretically save some time/space\nby ignoring some information when it's not needed for working with certain\n`KTransformation`s (e.g. ignoring all center orientations for 3x3x3), it is\nmore practical for each `KTransformation` to always track the full range\nfor each piece's `.orientation`. For example:\n\n- This is simpler, both conceptually and in code.\n- This allows changing the set of moves for a puzzle, without recalculating\n cached transformations or certain lookup tables (useful for alg\n searches).\n- This allows swapping out a normal 3x3x3 in a `<twisty-player>` for a\n picture cube, without re-calculating the center orientations of the\n current alg.\n\nThese use cases may not be strictly \"necessary\", but the opposite behaviour\nmight be surprising or frustrating if someone does not expect it. So we\nimplement it this way.\n\nInformally, the `KTransformation` has the full responsibility for tracking\n\"what really happens\" — even if the effect is invisible in some cases,\nwhile the `KPattern` tracks both what \"is\" and what \"isn't\" known.",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "number"
|
|
16
|
+
},
|
|
17
|
+
"type": "array"
|
|
47
18
|
},
|
|
48
|
-
"
|
|
49
|
-
"
|
|
19
|
+
"pieces": {
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "number"
|
|
22
|
+
},
|
|
23
|
+
"type": "array"
|
|
50
24
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"type": "object",
|
|
55
|
-
"additionalProperties": {
|
|
56
|
-
"$ref": "#/definitions/KTransformationOrbitData"
|
|
57
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"required": ["orientation", "pieces"],
|
|
27
|
+
"type": "object"
|
|
58
28
|
},
|
|
59
29
|
"KPuzzleOrbitDefinition": {
|
|
60
|
-
"type": "object",
|
|
61
|
-
"required": ["orbitName", "numPieces", "numOrientations"],
|
|
62
|
-
"additionalProperties": false,
|
|
63
30
|
"properties": {
|
|
64
|
-
"
|
|
65
|
-
"type": "
|
|
31
|
+
"numOrientations": {
|
|
32
|
+
"type": "number"
|
|
66
33
|
},
|
|
67
34
|
"numPieces": {
|
|
68
35
|
"type": "number"
|
|
69
36
|
},
|
|
70
|
-
"
|
|
71
|
-
"type": "
|
|
37
|
+
"orbitName": {
|
|
38
|
+
"type": "string"
|
|
72
39
|
}
|
|
73
|
-
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["numOrientations", "numPieces", "orbitName"],
|
|
42
|
+
"type": "object"
|
|
74
43
|
},
|
|
75
|
-
"
|
|
76
|
-
"type": "object",
|
|
77
|
-
"required": ["name", "orbits", "defaultPattern", "moves"],
|
|
78
|
-
"additionalProperties": false,
|
|
44
|
+
"KTransformationOrbitData": {
|
|
79
45
|
"properties": {
|
|
80
|
-
"
|
|
81
|
-
"type": "string"
|
|
82
|
-
},
|
|
83
|
-
"name": {
|
|
84
|
-
"type": "string"
|
|
85
|
-
},
|
|
86
|
-
"orbits": {
|
|
87
|
-
"type": "array",
|
|
46
|
+
"orientationDelta": {
|
|
88
47
|
"items": {
|
|
89
|
-
"
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
"defaultPattern": {
|
|
93
|
-
"$ref": "#/definitions/KPatternData"
|
|
94
|
-
},
|
|
95
|
-
"moves": {
|
|
96
|
-
"type": "object",
|
|
97
|
-
"additionalProperties": {
|
|
98
|
-
"$ref": "#/definitions/KTransformationData"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"derivedMoves": {
|
|
102
|
-
"type": "object",
|
|
103
|
-
"additionalProperties": {
|
|
104
|
-
"$ref": "#/definitions/AlgString"
|
|
105
|
-
}
|
|
48
|
+
"type": "number"
|
|
49
|
+
},
|
|
50
|
+
"type": "array"
|
|
106
51
|
},
|
|
107
|
-
"
|
|
108
|
-
"
|
|
52
|
+
"permutation": {
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "number"
|
|
55
|
+
},
|
|
56
|
+
"type": "array"
|
|
109
57
|
}
|
|
110
|
-
}
|
|
58
|
+
},
|
|
59
|
+
"required": ["orientationDelta", "permutation"],
|
|
60
|
+
"type": "object"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"properties": {
|
|
64
|
+
"defaultPattern": {
|
|
65
|
+
"additionalProperties": {
|
|
66
|
+
"$ref": "#/definitions/KPatternOrbitData"
|
|
67
|
+
},
|
|
68
|
+
"type": "object"
|
|
69
|
+
},
|
|
70
|
+
"derivedMoves": {
|
|
71
|
+
"additionalProperties": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"type": "object"
|
|
75
|
+
},
|
|
76
|
+
"moves": {
|
|
77
|
+
"additionalProperties": {
|
|
78
|
+
"additionalProperties": {
|
|
79
|
+
"$ref": "#/definitions/KTransformationOrbitData"
|
|
80
|
+
},
|
|
81
|
+
"type": "object"
|
|
82
|
+
},
|
|
83
|
+
"type": "object"
|
|
84
|
+
},
|
|
85
|
+
"name": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"orbits": {
|
|
89
|
+
"items": {
|
|
90
|
+
"$ref": "#/definitions/KPuzzleOrbitDefinition"
|
|
91
|
+
},
|
|
92
|
+
"type": "array"
|
|
111
93
|
}
|
|
112
94
|
},
|
|
113
|
-
"
|
|
95
|
+
"required": ["defaultPattern", "moves", "name", "orbits"],
|
|
96
|
+
"type": "object"
|
|
114
97
|
}
|
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"additionalProperties": {
|
|
4
|
+
"$ref": "#/definitions/KTransformationOrbitData"
|
|
5
|
+
},
|
|
3
6
|
"definitions": {
|
|
4
|
-
"numbers": {
|
|
5
|
-
"type": "array",
|
|
6
|
-
"items": {
|
|
7
|
-
"type": "number"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
7
|
"KTransformationOrbitData": {
|
|
11
|
-
"type": "object",
|
|
12
|
-
"required": ["permutation", "orientationDelta"],
|
|
13
|
-
"additionalProperties": false,
|
|
14
8
|
"properties": {
|
|
15
|
-
"permutation": {
|
|
16
|
-
"$ref": "#/definitions/numbers"
|
|
17
|
-
},
|
|
18
9
|
"orientationDelta": {
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "number"
|
|
12
|
+
},
|
|
13
|
+
"type": "array"
|
|
14
|
+
},
|
|
15
|
+
"permutation": {
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"type": "array"
|
|
28
20
|
}
|
|
29
21
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
}
|
|
22
|
+
"required": ["orientationDelta", "permutation"],
|
|
23
|
+
"type": "object"
|
|
33
24
|
}
|
|
34
25
|
},
|
|
35
|
-
"
|
|
26
|
+
"type": "object"
|
|
36
27
|
}
|
package/package.json
CHANGED
|
@@ -1,64 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cubing",
|
|
3
|
-
"version": "0.61.
|
|
3
|
+
"version": "0.61.1",
|
|
4
4
|
"description": "A collection of JavaScript cubing libraries.",
|
|
5
5
|
"author": "The js.cubing.net team",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"license": "MPL-2.0 OR GPL-3.0-or-later",
|
|
8
|
-
"repository":
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/cubing/cubing.js.git"
|
|
10
|
+
},
|
|
11
|
+
"engines-comment": "`node` 22.3.0 and `bun` 1.2.7 are needed for `globalThis.process.getBuiltinModule(…)`, which helps bundlers avoid thinking our `node` shims require packages from a package manager.",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=22.3.0",
|
|
14
|
+
"bun": ">=1.3.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
9
17
|
"exports": {
|
|
10
18
|
"./alg": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
19
|
+
"types": "./dist/lib/cubing/alg/index.d.ts",
|
|
20
|
+
"import": "./dist/lib/cubing/alg/index.js"
|
|
13
21
|
},
|
|
14
22
|
"./bluetooth": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
23
|
+
"types": "./dist/lib/cubing/bluetooth/index.d.ts",
|
|
24
|
+
"import": "./dist/lib/cubing/bluetooth/index.js"
|
|
17
25
|
},
|
|
18
26
|
"./kpuzzle": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
27
|
+
"types": "./dist/lib/cubing/kpuzzle/index.d.ts",
|
|
28
|
+
"import": "./dist/lib/cubing/kpuzzle/index.js"
|
|
21
29
|
},
|
|
22
30
|
"./notation": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
31
|
+
"types": "./dist/lib/cubing/notation/index.d.ts",
|
|
32
|
+
"import": "./dist/lib/cubing/notation/index.js"
|
|
25
33
|
},
|
|
26
34
|
"./protocol": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
35
|
+
"types": "./dist/lib/cubing/protocol/index.d.ts",
|
|
36
|
+
"import": "./dist/lib/cubing/protocol/index.js"
|
|
29
37
|
},
|
|
30
38
|
"./puzzle-geometry": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
39
|
+
"types": "./dist/lib/cubing/puzzle-geometry/index.d.ts",
|
|
40
|
+
"import": "./dist/lib/cubing/puzzle-geometry/index.js"
|
|
33
41
|
},
|
|
34
42
|
"./puzzles": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
43
|
+
"types": "./dist/lib/cubing/puzzles/index.d.ts",
|
|
44
|
+
"import": "./dist/lib/cubing/puzzles/index.js"
|
|
37
45
|
},
|
|
38
46
|
"./scramble": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
47
|
+
"types": "./dist/lib/cubing/scramble/index.d.ts",
|
|
48
|
+
"import": "./dist/lib/cubing/scramble/index.js"
|
|
41
49
|
},
|
|
42
50
|
"./search": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
51
|
+
"types": "./dist/lib/cubing/search/index.d.ts",
|
|
52
|
+
"import": "./dist/lib/cubing/search/index.js"
|
|
45
53
|
},
|
|
46
54
|
"./stream": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
55
|
+
"types": "./dist/lib/cubing/stream/index.d.ts",
|
|
56
|
+
"import": "./dist/lib/cubing/stream/index.js"
|
|
49
57
|
},
|
|
50
58
|
"./twisty": {
|
|
51
|
-
"
|
|
52
|
-
"
|
|
59
|
+
"types": "./dist/lib/cubing/twisty/index.d.ts",
|
|
60
|
+
"import": "./dist/lib/cubing/twisty/index.js"
|
|
53
61
|
}
|
|
54
62
|
},
|
|
55
63
|
"bin": {
|
|
56
|
-
"scramble": "
|
|
64
|
+
"scramble": "dist/bin/scramble.js"
|
|
57
65
|
},
|
|
58
66
|
"dependencies": {
|
|
67
|
+
"@optique/core": "v0.9.0-dev.187",
|
|
68
|
+
"@optique/run": "v0.9.0-dev.187",
|
|
59
69
|
"@types/three": "^0.169.0",
|
|
60
70
|
"@types/web-bluetooth": "^0.0.20",
|
|
61
|
-
"cmd-ts-too": "^0.15.3",
|
|
62
71
|
"comlink": "^4.4.1",
|
|
63
72
|
"random-uint-below": "v3.3.0",
|
|
64
73
|
"three": "^0.170.0",
|
|
@@ -66,104 +75,45 @@
|
|
|
66
75
|
},
|
|
67
76
|
"devDependencies": {
|
|
68
77
|
"@biomejs/biome": "^2.3.1",
|
|
69
|
-
"@cubing/deploy": ">=0.4.
|
|
70
|
-
"@cubing/dev-config": "
|
|
78
|
+
"@cubing/deploy": ">=0.4.10",
|
|
79
|
+
"@cubing/dev-config": ">=0.8.3",
|
|
71
80
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
72
81
|
"@schemastore/package": "^0.0.10",
|
|
73
82
|
"@types/bun": "^1.2.23",
|
|
74
83
|
"@types/chai": "^5.0.0",
|
|
75
84
|
"@types/dom-speech-recognition": "^0.0.4",
|
|
76
85
|
"@types/mocha": "^10.0.8",
|
|
77
|
-
"@types/node": "^
|
|
86
|
+
"@types/node": "^25.0.3",
|
|
78
87
|
"@web/dev-server-esbuild": "^1.0.2",
|
|
79
88
|
"@web/test-runner": "^0.19.0",
|
|
80
89
|
"@web/test-runner-playwright": "^0.11.0",
|
|
81
90
|
"barely-a-dev-server": "v0.8.0",
|
|
91
|
+
"bun-dx": ">=0.1.3",
|
|
82
92
|
"chai": "^5.1.1",
|
|
83
93
|
"esbuild": "^0.25.0",
|
|
84
94
|
"jszip": "^3.10.1",
|
|
85
95
|
"mocha": "^10.7.3",
|
|
86
|
-
"path-class": ">=0.
|
|
96
|
+
"path-class": ">=0.11.0",
|
|
87
97
|
"playwright": "^1.47.2",
|
|
88
|
-
"printable-shell-command": "^
|
|
98
|
+
"printable-shell-command": "^4.0.3",
|
|
89
99
|
"tsup": "^8.3.0",
|
|
90
100
|
"typedoc": "^0.28.10",
|
|
91
|
-
"typescript": "
|
|
101
|
+
"typescript": "5.9.3",
|
|
102
|
+
"typescript-json-schema": "^0.67.1"
|
|
92
103
|
},
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
"node": ">=22.3.0",
|
|
96
|
-
"bun": ">=1.3.0"
|
|
104
|
+
"overrides": {
|
|
105
|
+
"typescript": "5.9.3"
|
|
97
106
|
},
|
|
98
107
|
"files": [
|
|
99
108
|
"./dist/bin/",
|
|
100
109
|
"./dist/lib/",
|
|
101
110
|
"./experimental-json-schema",
|
|
102
|
-
"
|
|
111
|
+
"./*/index.d.ts"
|
|
103
112
|
],
|
|
104
113
|
"scripts": {
|
|
105
|
-
"default": "make default",
|
|
106
114
|
"build": "make build",
|
|
107
|
-
"build-lib": "make build-lib",
|
|
108
|
-
"build-lib-js": "make build-lib-js",
|
|
109
|
-
"build-lib-types": "make build-lib-types",
|
|
110
|
-
"build-bin": "make build-bin",
|
|
111
|
-
"build-sites": "make build-sites",
|
|
112
|
-
"build-site-twizzle": "make build-site-twizzle",
|
|
113
|
-
"build-site-experiments": "make build-site-experiments",
|
|
114
|
-
"build-site-docs": "make build-site-docs",
|
|
115
115
|
"dev": "make dev",
|
|
116
|
-
"
|
|
117
|
-
"clean": "make clean",
|
|
118
|
-
"clean-types": "make clean-types",
|
|
119
|
-
"reset": "make reset",
|
|
120
|
-
"test": "make test",
|
|
121
|
-
"test-info": "make test-info",
|
|
122
|
-
"test-fast": "make test-fast",
|
|
123
|
-
"test-all": "make test-all",
|
|
124
|
-
"test-src": "make test-src",
|
|
125
|
-
"test-spec": "make test-spec",
|
|
126
|
-
"test-spec-bun": "make test-spec-bun",
|
|
127
|
-
"test-spec-bun-fast": "make test-spec-bun-fast",
|
|
128
|
-
"test-spec-bun-with-coverage": "make test-spec-bun-with-coverage",
|
|
129
|
-
"test-spec-dom": "make test-spec-dom",
|
|
130
|
-
"install-playwright": "make install-playwright",
|
|
131
|
-
"test-spec-dom-with-coverage": "make test-spec-dom-with-coverage",
|
|
132
|
-
"playwright-install": "make playwright-install",
|
|
133
|
-
"test-src-import-restrictions": "make test-src-import-restrictions",
|
|
134
|
-
"test-src-tsc": "make test-src-tsc",
|
|
135
|
-
"test-src-scripts-consistency": "make test-src-scripts-consistency",
|
|
136
|
-
"fix-src-scripts-consistency": "make fix-src-scripts-consistency",
|
|
137
|
-
"test-build": "make test-build",
|
|
138
|
-
"test-dist": "make test-dist",
|
|
139
|
-
"test-dist-lib": "make test-dist-lib",
|
|
140
|
-
"test-dist-lib-node-import": "make test-dist-lib-node-import",
|
|
141
|
-
"test-dist-lib-node-scramble": "make test-dist-lib-node-scramble",
|
|
142
|
-
"test-dist-lib-bun-scramble-all-events": "make test-dist-lib-bun-scramble-all-events",
|
|
143
|
-
"test-dist-lib-perf": "make test-dist-lib-perf",
|
|
144
|
-
"test-dist-lib-plain-esbuild-compat": "make test-dist-lib-plain-esbuild-compat",
|
|
145
|
-
"test-dist-lib-build-size": "make test-dist-lib-build-size",
|
|
146
|
-
"test-dist-sites-twizzle": "make test-dist-sites-twizzle",
|
|
147
|
-
"test-dist-bin": "make test-dist-bin",
|
|
148
|
-
"test-dist-bin-shebang": "make test-dist-bin-shebang",
|
|
149
|
-
"test-dist-bin-npm-exec": "make test-dist-bin-npm-exec",
|
|
150
|
-
"format": "make format",
|
|
151
|
-
"setup": "make setup",
|
|
152
|
-
"bun-required": "make bun-required",
|
|
153
|
-
"update-dependencies": "make update-dependencies",
|
|
154
|
-
"check-engines": "make check-engines",
|
|
155
|
-
"lint": "make lint",
|
|
156
|
-
"lint-ci": "make lint-ci",
|
|
157
|
-
"prepack": "make prepack",
|
|
158
|
-
"prepublishOnly": "make prepublishOnly",
|
|
159
|
-
"postpublish": "make postpublish",
|
|
160
|
-
"postpublish-clear-bun-cache": "make postpublish-clear-bun-cache",
|
|
161
|
-
"deploy": "make deploy",
|
|
162
|
-
"deploy-twizzle": "make deploy-twizzle",
|
|
163
|
-
"deploy-experiments": "make deploy-experiments",
|
|
164
|
-
"roll-vendored-twips": "make roll-vendored-twips",
|
|
165
|
-
"update-cdn": "make update-cdn",
|
|
166
|
-
"update-create-cubing-app": "make update-create-cubing-app"
|
|
116
|
+
"prepublishOnly": "make prepublishOnly"
|
|
167
117
|
},
|
|
168
118
|
"keywords": [
|
|
169
119
|
"cubing",
|
|
@@ -171,10 +121,14 @@
|
|
|
171
121
|
"puzzle",
|
|
172
122
|
"visualization",
|
|
173
123
|
"kpuzzle",
|
|
174
|
-
"cuble",
|
|
175
124
|
"bluetooth",
|
|
176
125
|
"rubik",
|
|
177
|
-
"rubik's"
|
|
126
|
+
"rubik's",
|
|
127
|
+
"Twizzle",
|
|
128
|
+
"scramble",
|
|
129
|
+
"scrambles",
|
|
130
|
+
"alg",
|
|
131
|
+
"algs"
|
|
178
132
|
],
|
|
179
133
|
"@cubing/deploy": {
|
|
180
134
|
"https://experiments.cubing.net/cubing.js/": {
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/bin/guards/cmd-ts-too-guard.ts
|
|
4
|
-
import { exit } from "node:process";
|
|
5
|
-
try {
|
|
6
|
-
await import("cmd-ts-too");
|
|
7
|
-
} catch {
|
|
8
|
-
console.error(
|
|
9
|
-
`Could not import \`cmd-ts-too\`. This is not automatically installed as a regular dependency of \`cubing\`.
|
|
10
|
-
|
|
11
|
-
If you are installing globally, consider using \`bun\`: https://bun.sh/
|
|
12
|
-
|
|
13
|
-
bun install --global cubing
|
|
14
|
-
|
|
15
|
-
If you are installing using \`npx\` globally, run:
|
|
16
|
-
|
|
17
|
-
npm install --global cubing cmd-ts-too
|
|
18
|
-
|
|
19
|
-
If you are using \`npx\` within a repo, run:
|
|
20
|
-
|
|
21
|
-
npm install cubing cmd-ts-too
|
|
22
|
-
`
|
|
23
|
-
);
|
|
24
|
-
exit(1);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=chunk-J53ID3VX.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/bin/guards/cmd-ts-too-guard.ts"],
|
|
4
|
-
"sourcesContent": ["import { exit } from \"node:process\";\n\ntry {\n await import(\"cmd-ts-too\");\n} catch {\n // Note that this doesn't fail when installed using `bun install --global`, as `bun` automatically loads deps.\n console.error(\n `Could not import \\`cmd-ts-too\\`. This is not automatically installed as a regular dependency of \\`cubing\\`.\n\nIf you are installing globally, consider using \\`bun\\`: https://bun.sh/\n\n bun install --global cubing\n\nIf you are installing using \\`npx\\` globally, run:\n\n npm install --global cubing cmd-ts-too\n\nIf you are using \\`npx\\` within a repo, run:\n\n npm install cubing cmd-ts-too\n`,\n );\n exit(1);\n}\n"],
|
|
5
|
-
"mappings": ";;;AAAA,SAAS,YAAY;AAErB,IAAI;AACF,QAAM,OAAO,YAAY;AAC3B,QAAQ;AAEN,UAAQ;AAAA,IACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcF;AACA,OAAK,CAAC;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|