Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export type ScrambleType =
| "333"
| "444"
| "555"
| "666"
| "777"
| "222"
| "sq1"
| "pyraminx"
| "skewb"
| "mgmp"
| "kilominx"
| "redi"
| "fto"
| "clock"
| "1x3x3"
| "2x2x3"
| "333lse"
| "gearcube"
| "mgmlsll"
| "slide"
| string;

export interface ScrambleOptions {
type?: ScrambleType;
length?: number;
state?: unknown;
neutrality?: number;
}

export function getScrambleTypes(): ScrambleType[];

export function setSeed(seed: string | number | undefined | null): void;

export function getScramble(
type?: ScrambleType,
length?: number,
state?: unknown,
neutrality?: number,
): string;
3 changes: 0 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"module": "./dist/index.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"types": "./index.d.ts",
"scripts": {
Comment on lines 8 to 16
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json declares types: "./index.d.ts", but the files allowlist only includes dist, so index.d.ts will not be published to npm and consumers will still see missing types. Add index.d.ts (and any referenced .d.ts.map if you intend to ship it) to the files array, or remove the files allowlist so the types file is included in the published package.

Copilot uses AI. Check for mistakes.
"build": "tsup",
"test": "node --input-type=module -e \"import { getScramble, setSeed } from './dist/index.js'; setSeed('42'); console.log(getScramble('333'));\""
Expand Down
44 changes: 44 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
// File Layout
// "rootDir": "./src",
// "outDir": "./dist",

// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "nodenext",
"target": "esnext",
"types": [],
// For nodejs:
// "lib": ["esnext"],
// "types": ["node"],
// and npm install -D @types/node

// Other Outputs
"sourceMap": true,
"declaration": true,
"declarationMap": true,

// Stricter Typechecking Options
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,

// Style Options
// "noImplicitReturns": true,
// "noImplicitOverride": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
// "noPropertyAccessFromIndexSignature": true,

// Recommended Options
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true
}
}
3 changes: 3 additions & 0 deletions tsup.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
export default _default;
//# sourceMappingURL=tsup.config.d.ts.map
1 change: 1 addition & 0 deletions tsup.config.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tsup.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tsup.config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.js"],
format: ["esm", "cjs"],
splitting: false,
sourcemap: true,
clean: true,
outDir: "dist",
target: "es2020",
dts: false,
minify: false
entry: ["src/index.js"],
format: ["esm", "cjs"],
splitting: false,
sourcemap: true,
clean: true,
outDir: "dist",
target: "es2020",
dts: false,
minify: false,
});
Loading