skeleton 0.1.2 β†’ 1.0.1-next.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["atRule","tailwindImport: AtRule | undefined","atRule","nodes: Node[]","THEME_MAPPINGS: Record<string, Theme>","parse","type: 'preset' | 'custom'","EXPORT_MAPPINGS: Record<\n\tstring,\n\t{\n\t\tnamedImport: Renamed | Removed;\n\t\tidentifier: Renamed | Removed;\n\t}\n>","skeletonImports: string[]","orderedObject: Record<string, string>","pkg","parse","FALLBACK_THEME: Theme","migrations: FileMigration[]","theme: Theme | undefined","skeleton3"],"sources":["../src/utility/install-dependencies.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-classes.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-stylesheet.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-app.css.ts","../src/commands/migrate/migrations/skeleton-3/utility/theme-mappings.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-app.html.ts","../src/utility/ts-morph/add-named-import.ts","../src/utility/ts-morph/parse-source-file.ts","../src/commands/migrate/migrations/skeleton-3/utility/export-mappings.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-module.ts","../src/utility/sort-properties-alphabetically.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-package.json.ts","../src/commands/migrate/migrations/skeleton-3/transformers/transform-svelte.ts","../src/commands/migrate/migrations/skeleton-3/utility/constants.ts","../src/commands/migrate/migrations/skeleton-3/index.ts","../src/commands/migrate/index.ts","../src/utility/get-our-package-json.ts","../src/index.ts"],"sourcesContent":["import child_process from 'node:child_process';\nimport { promisify } from 'node:util';\nimport { detect, resolveCommand } from 'package-manager-detector';\n\nconst exec = promisify(child_process.exec);\n\nasync function installDependencies(cwd = process.cwd()) {\n\tconst pm = await detect({\n\t\tcwd: cwd,\n\t});\n\tconst resolvedCommand = resolveCommand(pm?.agent ?? 'npm', 'install', []);\n\tif (!resolvedCommand) {\n\t\tthrow new Error('Could not resolve package manager command.');\n\t}\n\treturn exec(`${resolvedCommand.command} ${resolvedCommand.args.join(' ')}`, {\n\t\tcwd: cwd,\n\t});\n}\n\nexport { installDependencies };\n","const COLOR_PAIRING_REGEXES = [\n\t{\n\t\tfind: /(\\w+)-50-900-token\\b/g,\n\t\treplace: '$1-50-950',\n\t},\n\t{\n\t\tfind: /(\\w+)-100-800-token\\b/g,\n\t\treplace: '$1-100-900',\n\t},\n\t{\n\t\tfind: /(\\w+)-200-700-token\\b/g,\n\t\treplace: '$1-200-800',\n\t},\n\t{\n\t\tfind: /(\\w+)-300-600-token\\b/g,\n\t\treplace: '$1-300-700',\n\t},\n\t{\n\t\tfind: /(\\w+)-400-500-token\\b/g,\n\t\treplace: '$1-500',\n\t},\n\t{\n\t\tfind: /(\\w+)-900-50-token\\b/g,\n\t\treplace: '$1-950-50',\n\t},\n\t{\n\t\tfind: /(\\w+)-800-100-token\\b/g,\n\t\treplace: '$1-900-100',\n\t},\n\t{\n\t\tfind: /(\\w+)-700-200-token\\b/g,\n\t\treplace: '$1-800-200',\n\t},\n\t{\n\t\tfind: /(\\w+)-600-300-token\\b/g,\n\t\treplace: '$1-700-300',\n\t},\n\t{\n\t\tfind: /(\\w+)-500-400-token\\b/g,\n\t\treplace: '$1-600-400',\n\t},\n];\n\nconst BACKGROUND_REGEXES = [\n\t{\n\t\tfind: /bg-(\\w+)-backdrop-token\\b/g,\n\t\treplace: 'bg-$1-50/50 dark:bg-$1-950/50',\n\t},\n\t{\n\t\tfind: /bg-(\\w+)-hover-token\\b/g,\n\t\treplace: 'preset-tonal-$1',\n\t},\n\t{\n\t\tfind: /bg-(\\w+)-active-token\\b/g,\n\t\treplace: 'preset-filled-$1-500',\n\t},\n];\n\nconst BORDER_RADIUS_REGEXES = [\n\t{\n\t\tfind: /rounded-token\\b/g,\n\t\treplace: 'rounded-base',\n\t},\n\t{\n\t\tfind: /rounded-(tl|tr|bl|br)-token\\b/g,\n\t\treplace: 'rounded-$1-base',\n\t},\n\t{\n\t\tfind: /rounded-container-token\\b/g,\n\t\treplace: 'rounded-container',\n\t},\n\t{\n\t\tfind: /rounded-(tl|tr|bl|br)-container-token\\b/g,\n\t\treplace: 'rounded-$1-container',\n\t},\n];\n\nconst BORDER_RING_REGEXES = [\n\t{\n\t\tfind: /border-token\\b/g,\n\t\treplace: 'border',\n\t},\n\t{\n\t\tfind: /border-(\\w+)-(\\d+)-(\\d+)-token\\b/g,\n\t\treplace: 'border-$1-$2-$3',\n\t},\n\t{\n\t\tfind: /ring-token\\b/g,\n\t\treplace: 'ring',\n\t},\n\t{\n\t\tfind: /ring-(\\w+)-(\\d+)-(\\d+)-token\\b/g,\n\t\treplace: 'ring-$1-$2-$3',\n\t},\n];\n\nconst TEXT_REGEXES = [\n\t{\n\t\tfind: /font-headings-token\\b/g,\n\t\treplace: 'heading-font-family',\n\t},\n\t{\n\t\tfind: /font-token\\b/g,\n\t\treplace: 'base-font-family',\n\t},\n\t{\n\t\tfind: /text-token\\b/g,\n\t\treplace: 'base-font-color',\n\t},\n\t{\n\t\tfind: /text-on-(\\w+)-token\\b/g,\n\t\treplace: 'text-$1-contrast-500',\n\t},\n\t{\n\t\tfind: /text-(\\w+)-([^-]+)-([^-]+)-token\\b/g,\n\t\treplace: 'text-$1-$2-$3',\n\t},\n];\n\nconst DECORATION_ACCENT_REGEXES = [\n\t{\n\t\tfind: /decoration-(\\w+)-([^-]+)-([^-]+)-token\\b/g,\n\t\treplace: 'decoration-$1-$2-$3',\n\t},\n\t{\n\t\tfind: /accent-(\\w+)-token\\b/g,\n\t\treplace: 'accent-$1-500',\n\t},\n];\n\nconst PRESET_REGEXES = [\n\t{\n\t\tfind: /variant-filled-(\\w+)\\b/g,\n\t\treplace: 'preset-filled-$1-500',\n\t},\n\t{\n\t\tfind: /variant-filled\\b/g,\n\t\treplace: 'preset-filled',\n\t},\n\t{\n\t\tfind: /variant-ghost-(\\w+)\\b/g,\n\t\treplace: 'preset-tonal-$1 border border-$1-500',\n\t},\n\t{\n\t\tfind: /variant-ghost\\b/g,\n\t\treplace: 'preset-tonal border border-surface-500',\n\t},\n\t{\n\t\tfind: /variant-soft-(\\w+)\\b/g,\n\t\treplace: 'preset-tonal-$1',\n\t},\n\t{\n\t\tfind: /variant-soft\\b/g,\n\t\treplace: 'preset-tonal',\n\t},\n\t{\n\t\tfind: /variant-ringed-(\\w+)\\b/g,\n\t\treplace: 'preset-outlined-$1-500',\n\t},\n\t{\n\t\tfind: /variant-ringed\\b/g,\n\t\treplace: 'preset-outlined',\n\t},\n\t{\n\t\tfind: /variant-glass-(\\w+)\\b/g,\n\t\treplace: 'preset-tonal-$1',\n\t},\n\t{\n\t\tfind: /variant-glass\\b/g,\n\t\treplace: 'preset-tonal',\n\t},\n\t{\n\t\tfind: /variant-gradient-(\\w+)-(\\w+)\\b/g,\n\t\treplace: 'from-$1-500 to-$2-500',\n\t},\n];\n\nconst TAILWIND_COMPONENT_REGEXES = [\n\t/**\n\t * Disabled until further discussion\n\t * @see https://github.com/skeletonlabs/skeleton/pull/2972#discussion_r1857260763\n\t */\n\t// {\n\t// \tfind: /\\bcard\\b(?!.*bg-)/g,\n\t// \treplace: 'card bg-surface-100-900-token'\n\t// },\n\t{\n\t\tfind: /btn-xl\\b/g,\n\t\treplace: 'btn-lg',\n\t},\n\t{\n\t\tfind: /btn-icon-xl\\b/g,\n\t\treplace: 'btn-icon-lg',\n\t},\n\t{\n\t\tfind: /btn-group\\b/g,\n\t\treplace: '',\n\t},\n\t{\n\t\tfind: /table-hover\\b/g,\n\t\treplace: '',\n\t},\n];\n\nconst CLASS_REGEXES = [\n\t...COLOR_PAIRING_REGEXES,\n\t...BACKGROUND_REGEXES,\n\t...BORDER_RADIUS_REGEXES,\n\t...BORDER_RING_REGEXES,\n\t...TEXT_REGEXES,\n\t...DECORATION_ACCENT_REGEXES,\n\t...PRESET_REGEXES,\n\t...TAILWIND_COMPONENT_REGEXES,\n];\n\nfunction transformClasses(code: string) {\n\treturn {\n\t\tcode: CLASS_REGEXES.reduce((result, migration) => {\n\t\t\treturn result.replace(migration.find, migration.replace);\n\t\t}, code),\n\t};\n}\n\nexport { transformClasses };\n","import { transformClasses } from './transform-classes';\nimport { parse } from 'postcss';\n\nfunction transformStyleSheet(code: string) {\n\tconst parsed = parse(code);\n\tparsed.walkAtRules('apply', (atRule) => {\n\t\tatRule.params = transformClasses(atRule.params).code;\n\t});\n\n\treturn {\n\t\tcode: parsed.toString(),\n\t};\n}\n\nexport { transformStyleSheet };\n","import type { Theme } from '../utility/types';\nimport { transformStyleSheet } from './transform-stylesheet';\nimport { atRule, comment, parse } from 'postcss';\nimport type { AtRule, Node, Root } from 'postcss';\n\nfunction getTailwindImport(root: Root) {\n\tlet tailwindImport: AtRule | undefined;\n\troot.walkAtRules('import', (atRule) => {\n\t\tif (atRule.params.includes('tailwindcss')) {\n\t\t\ttailwindImport = atRule;\n\t\t}\n\t});\n\treturn tailwindImport;\n}\n\nfunction transformAppCss(code: string, theme: Theme) {\n\tcode = transformStyleSheet(code).code;\n\tconst root = parse(code);\n\tconst nodes: Node[] = [];\n\tnodes.push(\n\t\tatRule({\n\t\t\tname: 'import',\n\t\t\tparams: '\"@skeletonlabs/skeleton\"',\n\t\t}),\n\t);\n\tnodes.push(\n\t\tatRule({\n\t\t\tname: 'import',\n\t\t\tparams: '\"@skeletonlabs/skeleton/optional/presets\"',\n\t\t}),\n\t);\n\tswitch (theme.type) {\n\t\tcase 'preset': {\n\t\t\tnodes.push(\n\t\t\t\tatRule({\n\t\t\t\t\tname: 'import',\n\t\t\t\t\tparams: `\"@skeletonlabs/skeleton/themes/${theme.value}\"`,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase 'custom': {\n\t\t\tnodes.push(comment({ text: `Add your theme import for your theme: \"${theme.value}\" here` }));\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst tailwindImport = getTailwindImport(root);\n\tif (tailwindImport) {\n\t\troot.insertAfter(tailwindImport, nodes);\n\t} else {\n\t\troot.prepend(nodes);\n\t}\n\treturn {\n\t\tcode: root.toString(),\n\t};\n}\n\nexport { transformAppCss };\n","import type { Theme } from './types';\n\nconst THEME_MAPPINGS: Record<string, Theme> = {\n\tskeleton: { type: 'preset', value: 'legacy' },\n\t'gold-nouveau': { type: 'preset', value: 'nouveau' },\n\twintry: { type: 'preset', value: 'wintry' },\n\tmodern: { type: 'preset', value: 'modern' },\n\trocket: { type: 'preset', value: 'rocket' },\n\tseafoam: { type: 'preset', value: 'seafoam' },\n\tvintage: { type: 'preset', value: 'vintage' },\n\tsahara: { type: 'preset', value: 'sahara' },\n\thamlindigo: { type: 'preset', value: 'hamlindigo' },\n\tcrimson: { type: 'preset', value: 'crimson' },\n};\n\nexport { THEME_MAPPINGS };\n","import { THEME_MAPPINGS } from '../utility/theme-mappings';\nimport { parse } from 'node-html-parser';\n\nfunction transformAppHtml(code: string) {\n\tconst parsed = parse(code);\n\tconst html = parsed.querySelector('html');\n\tconst body = parsed.querySelector('body');\n\tif (!(html && body)) {\n\t\treturn {\n\t\t\tcode: code,\n\t\t\tmeta: {\n\t\t\t\ttheme: undefined,\n\t\t\t},\n\t\t};\n\t}\n\tconst theme = body.getAttribute('data-theme');\n\tif (!theme) {\n\t\treturn {\n\t\t\tcode: code,\n\t\t\tmeta: {\n\t\t\t\ttheme: undefined,\n\t\t\t},\n\t\t};\n\t}\n\tlet type: 'preset' | 'custom';\n\tbody.removeAttribute('data-theme');\n\tif (Object.hasOwn(THEME_MAPPINGS, theme)) {\n\t\thtml.setAttribute('data-theme', THEME_MAPPINGS[theme]!.value);\n\t\ttype = 'preset';\n\t} else {\n\t\thtml.setAttribute('data-theme', theme);\n\t\ttype = 'custom';\n\t}\n\treturn {\n\t\tcode: parsed.toString(),\n\t\tmeta: {\n\t\t\ttheme: {\n\t\t\t\tvalue: theme,\n\t\t\t\ttype: type,\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport { transformAppHtml };\n","import type { SourceFile } from 'ts-morph';\n\nfunction addNamedImport(file: SourceFile, specifier: string, name: string) {\n\tconst existingImportDeclaration = file.getImportDeclaration((importDeclaration) => {\n\t\tconst moduleSpecifier = importDeclaration.getModuleSpecifier().getLiteralText();\n\t\treturn moduleSpecifier === specifier;\n\t});\n\tif (existingImportDeclaration) {\n\t\tif (!existingImportDeclaration.getNamedImports().some((namedImport) => namedImport.getName() === name)) {\n\t\t\texistingImportDeclaration.addNamedImport(name);\n\t\t}\n\t} else {\n\t\tfile.addImportDeclaration({\n\t\t\tmoduleSpecifier: specifier,\n\t\t\tnamedImports: [name],\n\t\t});\n\t}\n}\n\nexport { addNamedImport };\n","import { nanoid } from 'nanoid';\nimport { Project } from 'ts-morph';\n\nconst project = new Project({\n\tuseInMemoryFileSystem: true,\n\tskipAddingFilesFromTsConfig: true,\n\tskipFileDependencyResolution: true,\n\tskipLoadingLibFiles: true,\n});\n\nfunction parseSourceFile(code: string) {\n\treturn project.createSourceFile(`${nanoid()}.ts`, code);\n}\n\nexport { parseSourceFile };\n","interface Renamed {\n\ttype: 'renamed';\n\tvalue: string;\n}\n\ninterface Removed {\n\ttype: 'removed';\n}\n\nconst EXPORT_MAPPINGS: Record<\n\tstring,\n\t{\n\t\tnamedImport: Renamed | Removed;\n\t\tidentifier: Renamed | Removed;\n\t}\n> = {\n\tAccordionItem: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Accordion',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Accordion.Item',\n\t\t},\n\t},\n\tAppShell: {\n\t\tnamedImport: {\n\t\t\ttype: 'removed',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'removed',\n\t\t},\n\t},\n\tApollo: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tAppRailAnchor: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tAutocomplete: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tBlueNight: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tCodeBlock: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tConicGradient: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tDrawer: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tEmerald: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tGreenFall: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tLightSwitch: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tListBox: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tListBoxItem: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tModal: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tNoir: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tNoirLight: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tRecursiveTreeView: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tRecursiveTreeViewItem: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tRustic: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tStep: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tStepper: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tSummer84: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tTable: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tTableOfContents: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tTreeView: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tTreeViewItem: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tXPro: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tautoModeWatcher: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tclipboard: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tfilter: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tfocusTrap: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetDrawerStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetModalStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetModeAutoPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetModeOsPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetModeUserPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tgetToastStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tinitializeStores: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tlocalStorageStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tmodeCurrent: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tmodeOsPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tmodeUserPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tpopup: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tprefersReducedMotionStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tsetInitialClassState: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tsetModeCurrent: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tsetModeUserPrefers: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tstoreHighlightJs: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tstorePopup: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\ttableMapperValues: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\ttableSourceMapper: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\ttableSourceValues: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\ttocCrawler: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\ttocStore: {\n\t\tnamedImport: { type: 'removed' },\n\t\tidentifier: { type: 'removed' },\n\t},\n\tAppRail: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Navigation',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Navigation',\n\t\t},\n\t},\n\tAppRailTile: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Navigation',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Navigation.Tile',\n\t\t},\n\t},\n\tFileButton: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'FileUpload',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'FileUpload',\n\t\t},\n\t},\n\tFileDropzone: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'FileUpload',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'FileUpload',\n\t\t},\n\t},\n\tInputChip: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'TagsInput',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'TagsInput',\n\t\t},\n\t},\n\tPaginator: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Pagination',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Pagination',\n\t\t},\n\t},\n\tProgressBar: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Progress',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Progress',\n\t\t},\n\t},\n\tProgressRadial: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'ProgressRing',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'ProgressRing',\n\t\t},\n\t},\n\tRadioGroup: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Segment',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Segment',\n\t\t},\n\t},\n\tRadioItem: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Segment',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Segment.Item',\n\t\t},\n\t},\n\tRangeSlider: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Slider',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Slider',\n\t\t},\n\t},\n\tRatings: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Rating',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Rating',\n\t\t},\n\t},\n\tSlideToggle: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Switch',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Switch',\n\t\t},\n\t},\n\tTabAnchor: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Tabs',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Tabs.Control',\n\t\t},\n\t},\n\tTabGroup: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Tabs',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'Tabs',\n\t\t},\n\t},\n\tToast: {\n\t\tnamedImport: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'ToastProvider',\n\t\t},\n\t\tidentifier: {\n\t\t\ttype: 'renamed',\n\t\t\tvalue: 'ToastProvider',\n\t\t},\n\t},\n};\n\nexport { EXPORT_MAPPINGS };\n","import { addNamedImport } from '../../../../../utility/ts-morph/add-named-import';\nimport { parseSourceFile } from '../../../../../utility/ts-morph/parse-source-file';\nimport { EXPORT_MAPPINGS } from '../utility/export-mappings';\nimport { transformClasses } from './transform-classes';\nimport { Node } from 'ts-morph';\n\nfunction transformModule(code: string) {\n\tconst file = parseSourceFile(code);\n\tconst skeletonImports: string[] = [];\n\tfile.forEachDescendant((node) => {\n\t\tif (Node.isImportDeclaration(node)) {\n\t\t\tconst moduleSpecifier = node.getModuleSpecifier();\n\t\t\tif (moduleSpecifier.getLiteralText() === '@skeletonlabs/skeleton') {\n\t\t\t\tnode.setModuleSpecifier('@skeletonlabs/skeleton-svelte');\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tNode.isImportSpecifier(node) &&\n\t\t\tnode.getImportDeclaration().getModuleSpecifier().getLiteralText() === '@skeletonlabs/skeleton-svelte'\n\t\t) {\n\t\t\tconst name = node.getName();\n\t\t\tif (Object.hasOwn(EXPORT_MAPPINGS, name)) {\n\t\t\t\tconst exportMapping = EXPORT_MAPPINGS[name];\n\t\t\t\tswitch (exportMapping?.namedImport.type) {\n\t\t\t\t\tcase 'renamed': {\n\t\t\t\t\t\tif (exportMapping.namedImport.value.match(/^[A-Za-z]+\\.[A-Za-z]+$/)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.remove();\n\t\t\t\t\t\taddNamedImport(file, '@skeletonlabs/skeleton-svelte', exportMapping.namedImport.value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'removed': {\n\t\t\t\t\t\tconst parent = node.getImportDeclaration();\n\t\t\t\t\t\tif (parent.getNamedImports().length === 1 && !parent.getDefaultImport() && !parent.getNamespaceImport()) {\n\t\t\t\t\t\t\tparent.remove();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tskeletonImports.push(name);\n\t\t\t}\n\t\t}\n\t});\n\tfile.forEachDescendant((node) => {\n\t\tif (!node.wasForgotten() && Node.isIdentifier(node) && !Node.isImportSpecifier(node.getParent())) {\n\t\t\tconst name = node.getText();\n\t\t\tif (Object.hasOwn(EXPORT_MAPPINGS, name) && skeletonImports.includes(name)) {\n\t\t\t\tconst exportMapping = EXPORT_MAPPINGS[name];\n\t\t\t\tif (exportMapping?.identifier.type === 'renamed') {\n\t\t\t\t\tconst updated = exportMapping.identifier.value;\n\t\t\t\t\tif (updated !== node.getText()) {\n\t\t\t\t\t\tnode.replaceWithText(updated);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!node.wasForgotten() && Node.isStringLiteral(node) && !Node.isImportDeclaration(node.getParent())) {\n\t\t\tconst transformed = transformClasses(node.getText()).code;\n\t\t\tif (transformed !== node.getText()) {\n\t\t\t\tnode.replaceWithText(transformed);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn {\n\t\tcode: file.getFullText(),\n\t\tmeta: {\n\t\t\tskeletonImports: skeletonImports,\n\t\t},\n\t};\n}\n\nexport { transformModule };\n","function sortPropertiesAlphabetically(object: Record<string, string>) {\n\tconst orderedObject: Record<string, string> = {};\n\tconst sortedEntries = Object.entries(object).sort(([a], [b]) => a.localeCompare(b));\n\tfor (const [key, value] of sortedEntries) {\n\t\torderedObject[key] = value;\n\t}\n\treturn orderedObject;\n}\n\nexport { sortPropertiesAlphabetically };\n","import { sortPropertiesAlphabetically } from '../../../../../utility/sort-properties-alphabetically.js';\nimport detectIndent from 'detect-indent';\nimport { coerce, lt } from 'semver';\nimport type { PackageJson } from 'type-fest';\n\nfunction transformPackageJson(code: string, skeletonVersion: string, skeletonSvelteVersion: string) {\n\tlet isUsingComponents = false;\n\tconst pkg = JSON.parse(code) as PackageJson;\n\tfor (const field of ['dependencies', 'devDependencies'] as const) {\n\t\tif (!pkg[field]) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst coerced = coerce(pkg[field]['@skeletonlabs/skeleton']);\n\t\tif (coerced && lt(coerced.version, '3.0.0')) {\n\t\t\tisUsingComponents = true;\n\t\t\tdelete pkg[field]['@skeletonlabs/skeleton'];\n\t\t\tpkg[field]['@skeletonlabs/skeleton-svelte'] = `^${skeletonSvelteVersion}`;\n\t\t}\n\t\tif (pkg[field]['@skeletonlabs/tw-plugin']) {\n\t\t\tdelete pkg[field]['@skeletonlabs/tw-plugin'];\n\t\t\tpkg[field]['@skeletonlabs/skeleton'] = `^${skeletonVersion}`;\n\t\t}\n\t\tpkg[field] = sortPropertiesAlphabetically(pkg[field] as Record<string, string>);\n\t}\n\treturn {\n\t\tcode: JSON.stringify(pkg, undefined, detectIndent(code).indent || '\\t'),\n\t\tmeta: {\n\t\t\tisUsingComponents: isUsingComponents,\n\t\t},\n\t};\n}\n\nexport { transformPackageJson };\n","import { EXPORT_MAPPINGS } from '../utility/export-mappings';\nimport { transformClasses } from './transform-classes';\nimport { transformModule } from './transform-module';\nimport { transformStyleSheet } from './transform-stylesheet';\nimport type { Node } from 'estree';\nimport MagicString from 'magic-string';\nimport { parse } from 'svelte/compiler';\nimport type { AST } from 'svelte/compiler';\nimport { walk } from 'zimmerframe';\n\nfunction renameComponent(s: MagicString, node: AST.Component, name: string) {\n\tconst adjustedStart = node.start + 1;\n\ts.update(adjustedStart, adjustedStart + node.name.length, name);\n\tconst componentString = s.original.slice(node.start, node.end);\n\tconst indexOfNonSelfClosingTag = componentString.lastIndexOf('</');\n\tif (indexOfNonSelfClosingTag === -1 || node.start + indexOfNonSelfClosingTag > node.end) {\n\t\treturn;\n\t}\n\ts.update(node.start + indexOfNonSelfClosingTag + 2, node.start + indexOfNonSelfClosingTag + 2 + node.name.length, name);\n}\n\nfunction transformScript(s: MagicString, script: AST.Script | null) {\n\tif (\n\t\t!script ||\n\t\t!(\n\t\t\t'start' in script.content &&\n\t\t\ttypeof script.content.start === 'number' &&\n\t\t\t'end' in script.content &&\n\t\t\ttypeof script.content.end === 'number'\n\t\t)\n\t) {\n\t\treturn {\n\t\t\tmeta: {\n\t\t\t\tskeletonImports: [],\n\t\t\t},\n\t\t};\n\t}\n\tconst content = s.original.slice(script.content.start, script.content.end);\n\tconst transformed = transformModule(content);\n\ts.overwrite(script.content.start, script.content.end, transformed.code);\n\treturn {\n\t\tmeta: transformed.meta,\n\t};\n}\n\nfunction transformCss(s: MagicString, css: AST.CSS.StyleSheet | null) {\n\tif (!css) {\n\t\treturn;\n\t}\n\tconst transformed = transformStyleSheet(s.original.slice(css.content.start, css.content.end));\n\ts.overwrite(css.content.start, css.content.end, transformed.code);\n}\n\nfunction hasRange(node: Node | AST.SvelteNode): node is (Node | AST.SvelteNode) & { start: number; end: number } {\n\treturn 'start' in node && 'end' in node && typeof node.start === 'number' && typeof node.end === 'number';\n}\n\nfunction transformFragment(s: MagicString, fragment: AST.Fragment, skeletonImports: string[]) {\n\twalk(\n\t\tfragment as AST.SvelteNode,\n\t\t{},\n\t\t{\n\t\t\tLiteral(node, ctx) {\n\t\t\t\tconst parent = ctx.path.at(-1);\n\t\t\t\tif (typeof node.raw === 'string' && node.raw !== '' && !(parent && parent.type === 'ImportDeclaration') && hasRange(node)) {\n\t\t\t\t\ts.update(node.start, node.end, transformClasses(node.raw).code);\n\t\t\t\t}\n\t\t\t\tctx.next();\n\t\t\t},\n\t\t\tText(node, ctx) {\n\t\t\t\tif (node.data !== '' && hasRange(node)) {\n\t\t\t\t\ts.update(node.start, node.end, transformClasses(node.data).code);\n\t\t\t\t}\n\t\t\t\tctx.next();\n\t\t\t},\n\t\t\tClassDirective(node, ctx) {\n\t\t\t\tif (\n\t\t\t\t\t!(node.expression.type === 'Identifier' && !('loc' in node.expression) && node.name === node.expression.name) &&\n\t\t\t\t\thasRange(node)\n\t\t\t\t) {\n\t\t\t\t\tconst adjustedStart = node.start + 'class:'.length;\n\t\t\t\t\ts.update(adjustedStart, adjustedStart + node.name.length, transformClasses(node.name).code);\n\t\t\t\t}\n\t\t\t\tctx.next();\n\t\t\t},\n\t\t\tComponent(node, ctx) {\n\t\t\t\tif (Object.hasOwn(EXPORT_MAPPINGS, node.name) && skeletonImports.includes(node.name)) {\n\t\t\t\t\tconst exportMapping = EXPORT_MAPPINGS[node.name];\n\t\t\t\t\tif (exportMapping?.identifier.type === 'renamed' && hasRange(node)) {\n\t\t\t\t\t\trenameComponent(s, node, exportMapping.identifier.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tctx.next();\n\t\t\t},\n\t\t},\n\t);\n\treturn {\n\t\tcode: s.toString(),\n\t};\n}\n\nfunction transformSvelte(code: string) {\n\tconst s = new MagicString(code);\n\tconst root = parse(code, {\n\t\tmodern: true,\n\t});\n\tconst skeletonImports = [\n\t\t...transformScript(s, root.module).meta.skeletonImports,\n\t\t...transformScript(s, root.instance).meta.skeletonImports,\n\t];\n\ttransformFragment(s, root.fragment, skeletonImports);\n\ttransformCss(s, root.css);\n\treturn {\n\t\tcode: s.toString(),\n\t};\n}\n\nexport { transformSvelte };\n","import type { Theme } from './types';\n\nconst FALLBACK_THEME: Theme = {\n\ttype: 'preset',\n\tvalue: 'cerberus',\n};\n\nexport { FALLBACK_THEME };\n","import type { MigrateOptions } from '../..';\nimport { cli } from '../../../..';\nimport { installDependencies } from '../../../../utility/install-dependencies';\nimport { transformAppCss } from './transformers/transform-app.css';\nimport { transformAppHtml } from './transformers/transform-app.html';\nimport { transformModule } from './transformers/transform-module';\nimport { transformPackageJson } from './transformers/transform-package.json';\nimport { transformStyleSheet } from './transformers/transform-stylesheet';\nimport { transformSvelte } from './transformers/transform-svelte';\nimport { FALLBACK_THEME } from './utility/constants';\nimport { THEME_MAPPINGS } from './utility/theme-mappings';\nimport type { Theme } from './utility/types';\nimport { isCancel, log, multiselect, spinner } from '@clack/prompts';\nimport getLatestVersion from 'latest-version';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport { glob } from 'tinyglobby';\n\ninterface FileMigration {\n\tpath: string;\n\tcontent: string;\n}\n\nexport default async function (options: MigrateOptions) {\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst migrations: FileMigration[] = [];\n\n\t// Find all required files\n\tconst packageJson = {\n\t\tname: 'package.json',\n\t\tpaths: await glob('package.json', { cwd }),\n\t};\n\tconst appHtml = {\n\t\tname: 'src/app.html',\n\t\tpaths: await glob('src/app.html', { cwd }),\n\t};\n\tconst appCss = {\n\t\tname: 'src/app.css',\n\t\tpaths: await glob('src/app.css', { cwd }),\n\t};\n\n\t// Validate file existence\n\tfor (const file of [packageJson, appHtml, appCss]) {\n\t\tif (file.paths.length === 0) {\n\t\t\tcli.error(`\"${file.name}\" not found in directory \"${cwd}\".`);\n\t\t}\n\t\tif (file.paths.length > 1) {\n\t\t\tcli.error(`Multiple \"${file.name}\" entries found in directory: \"${cwd}\", please ensure there is only one`);\n\t\t}\n\t}\n\n\t// Get source folders\n\tconst availableSourceFolders = await glob('*', {\n\t\tcwd: cwd,\n\t\tonlyDirectories: true,\n\t\tignore: ['node_modules'],\n\t});\n\tconst sourceFolders = await multiselect({\n\t\tmessage: 'What folders make use of Skeleton? (classes, imports, etc.)',\n\t\toptions: availableSourceFolders.map((folder) => ({ label: folder, value: folder })),\n\t\tinitialValues: availableSourceFolders,\n\t});\n\n\tif (isCancel(sourceFolders)) {\n\t\tcli.error('Migration canceled, nothing written to disk');\n\t\treturn;\n\t}\n\n\t// Migrate package.json\n\tconst packageSpinner = spinner();\n\tpackageSpinner.start(`Migrating ${packageJson.name}...`);\n\ttry {\n\t\tconst packageJsonCode = await readFile(packageJson.paths.at(0)!, 'utf8');\n\t\tconst skeletonVersion = await getLatestVersion('@skeletonlabs/skeleton', { version: '>=3.0.0-0 <4.0.0' });\n\t\tconst skeletonSvelteVersion = await getLatestVersion('@skeletonlabs/skeleton-svelte', { version: '>=1.0.0-0 <2.0.0' });\n\t\tconst transformedPackageJson = transformPackageJson(packageJsonCode, skeletonVersion, skeletonSvelteVersion);\n\t\tmigrations.push({ path: packageJson.paths.at(0)!, content: transformedPackageJson.code });\n\t\tpackageSpinner.stop(`Successfully migrated ${packageJson.name}!`);\n\t} catch (error) {\n\t\tpackageSpinner.stop(`Failed to migrate ${packageJson.name}: ${error instanceof Error ? error.message : 'Unknown error'}`, 1);\n\t\tcli.error('Migration canceled, nothing written to disk');\n\t}\n\n\t// Migrate app.html\n\tlet theme: Theme | undefined;\n\tconst appHtmlSpinner = spinner();\n\tappHtmlSpinner.start(`Migrating ${appHtml.name}...`);\n\ttry {\n\t\tconst appHtmlCode = await readFile(appHtml.paths.at(0)!, 'utf8');\n\t\tconst transformedAppHtml = transformAppHtml(appHtmlCode);\n\t\tif (transformedAppHtml.meta.theme && Object.hasOwn(THEME_MAPPINGS, transformedAppHtml.meta.theme.value)) {\n\t\t\ttheme = THEME_MAPPINGS[transformedAppHtml.meta.theme.value];\n\t\t} else if (transformedAppHtml.meta.theme) {\n\t\t\ttheme = transformedAppHtml.meta.theme;\n\t\t} else {\n\t\t\ttheme = FALLBACK_THEME;\n\t\t}\n\t\tmigrations.push({ path: appHtml.paths.at(0)!, content: transformedAppHtml.code });\n\t\tappHtmlSpinner.stop(`Successfully migrated ${appHtml.name}!`);\n\t} catch (error) {\n\t\tappHtmlSpinner.stop(`Failed to migrate ${appHtml.name}: ${error instanceof Error ? error.message : 'Unknown error'}`, 1);\n\t\tcli.error('Migration canceled, nothing written to disk');\n\t}\n\n\t// Migrate app.css\n\tconst appCssSpinner = spinner();\n\tappCssSpinner.start(`Migrating ${appCss.name}...`);\n\ttry {\n\t\tconst appCssCode = await readFile(appCss.paths.at(0)!, 'utf8');\n\t\tconst transformedAppCss = transformAppCss(appCssCode, theme ?? FALLBACK_THEME);\n\t\tmigrations.push({ path: appCss.paths.at(0)!, content: transformedAppCss.code });\n\t\tappCssSpinner.stop(`Successfully migrated ${appCss.name}!`);\n\t} catch (error) {\n\t\tappCssSpinner.stop(`Failed to migrate ${appCss.name}: ${error instanceof Error ? error.message : 'Unknown error'}`, 1);\n\t\tcli.error('Migration canceled, nothing written to disk');\n\t}\n\n\t// Migrate source files\n\tif (sourceFolders.length > 0) {\n\t\tconst sourceFiles = await glob(\n\t\t\tsourceFolders.map((folder) => `${folder}**/*.{svelte,js,mjs,ts,mts,css,pcss,postcss}`),\n\t\t\t{\n\t\t\t\tcwd: cwd,\n\t\t\t\tignore: ['node_modules', 'src/app.css'],\n\t\t\t},\n\t\t);\n\t\tconst sourceFilesSpinner = spinner();\n\t\tsourceFilesSpinner.start(`Migrating source files...`);\n\t\tfor (const sourceFile of sourceFiles) {\n\t\t\tsourceFilesSpinner.message(`Migrating ${sourceFile}...`);\n\t\t\tconst extension = extname(sourceFile);\n\t\t\ttry {\n\t\t\t\tconst code = await readFile(sourceFile, 'utf8');\n\t\t\t\tswitch (extension) {\n\t\t\t\t\tcase '.svelte': {\n\t\t\t\t\t\tconst transformedSvelte = transformSvelte(code);\n\t\t\t\t\t\tmigrations.push({ path: sourceFile, content: transformedSvelte.code });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase '.js':\n\t\t\t\t\tcase '.mjs':\n\t\t\t\t\tcase '.ts':\n\t\t\t\t\tcase '.mts': {\n\t\t\t\t\t\tconst transformedModule = transformModule(code);\n\t\t\t\t\t\tmigrations.push({ path: sourceFile, content: transformedModule.code });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase '.css':\n\t\t\t\t\tcase '.pcss':\n\t\t\t\t\tcase '.postcss': {\n\t\t\t\t\t\tconst transformedStyleSheet = transformStyleSheet(code);\n\t\t\t\t\t\tmigrations.push({ path: sourceFile, content: transformedStyleSheet.code });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsourceFilesSpinner.message(`Successfully migrated ${sourceFile}!`);\n\t\t\t} catch (error) {\n\t\t\t\tsourceFilesSpinner.stop(`Failed to migrate ${sourceFile}: ${error instanceof Error ? error.message : 'Unknown error'}`, 1);\n\t\t\t\tcli.error('Migration canceled, nothing written to disk');\n\t\t\t}\n\t\t}\n\t\tsourceFilesSpinner.stop('Successfully migrated all source files!');\n\t}\n\n\t// Write all migrations to disk\n\tconst writeSpinner = spinner();\n\twriteSpinner.start('Applying all migrations...');\n\ttry {\n\t\tawait Promise.all(migrations.map(({ path, content }) => writeFile(path, content)));\n\t\twriteSpinner.stop('Successfully applied all migrations!');\n\t} catch (error) {\n\t\twriteSpinner.stop(`Failed to apply migrations: ${error instanceof Error ? error.message.replace('\\n', ' ') : 'Unknown error'}`, 1);\n\t\tcli.error('Migration canceled');\n\t}\n\n\t// Install dependencies\n\tconst installDependenciesSpinner = spinner();\n\tinstallDependenciesSpinner.start('Updating dependencies...');\n\ttry {\n\t\tawait installDependencies(cwd);\n\t\tinstallDependenciesSpinner.stop('Successfully updated dependencies!');\n\t} catch (error) {\n\t\tinstallDependenciesSpinner.stop(`Failed to update dependencies: ${error instanceof Error ? error.message : 'Unknown error'}`, 1);\n\t\tcli.error('Migration canceled');\n\t\treturn;\n\t}\n\tlog.info('Migration complete! Visit https://skeleton.dev for more information.');\n}\n","import skeleton3 from './migrations/skeleton-3';\nimport { Argument, Command, Option } from 'commander';\n\ninterface MigrateOptions {\n\tcwd?: string;\n}\nconst MIGRATIONS = {\n\t'skeleton-3': skeleton3,\n} as const;\n\nconst migrate = new Command('migrate')\n\t.description('Run a migration')\n\t.addArgument(new Argument('<migration>', 'The migration to run').choices(Object.keys(MIGRATIONS)))\n\t.addOption(new Option('--cwd <cwd>', 'The directory to run the migration in'))\n\t.action((migration: keyof typeof MIGRATIONS, options: MigrateOptions) => MIGRATIONS[migration](options));\n\nexport type { MigrateOptions };\nexport { migrate };\n","import { readFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { PackageJson } from 'type-fest';\n\nasync function getOurPackageJson(): Promise<Required<PackageJson>> {\n\tconst packageJsonPath = join(dirname(fileURLToPath(import.meta.url)), '../package.json');\n\tconst content = await readFile(packageJsonPath, 'utf8');\n\treturn JSON.parse(content);\n}\n\nexport { getOurPackageJson };\n","#!/usr/bin/env node\nimport { migrate } from './commands/migrate';\nimport { getOurPackageJson } from './utility/get-our-package-json';\nimport { intro, log, outro } from '@clack/prompts';\nimport { bgBlueBright, bgGreenBright, black, dim, red } from 'colorette';\nimport { Command } from 'commander';\n\nconst pkg = await getOurPackageJson();\n\nconst cli = new Command()\n\t.name(pkg.name)\n\t.description(pkg.description)\n\t.version(pkg.version)\n\t.addCommand(migrate)\n\t.copyInheritedSettings(migrate)\n\t.configureOutput({\n\t\twriteOut: log.info,\n\t\twriteErr(str) {\n\t\t\toutro(red(str.replace('\\n', ' ')));\n\t\t\tprocess.exit(1);\n\t\t},\n\t})\n\t.hook('preAction', (_, ctx) => {\n\t\tconst args = ctx.args.join(' ');\n\t\tlog.message(dim(`Running \"${`${ctx.name()}${args ? ` ${args}` : ''}`}\"...`));\n\t});\n\nasync function main() {\n\tintro(bgBlueBright(black(' Welcome to the Skeleton CLI πŸ’€ ')));\n\tif (process.argv.length === 2) {\n\t\tcli.error('error: no command provided');\n\t}\n\tawait cli.parseAsync(process.argv);\n\toutro(bgGreenBright(black(' All Done! ')));\n}\n\nawait main();\n\nexport { cli };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,OAAO,UAAU,cAAc,KAAK;AAE1C,eAAe,oBAAoB,MAAM,QAAQ,KAAK,EAAE;CACvD,MAAM,KAAK,MAAM,OAAO,EAClB,KACL,CAAC;CACF,MAAM,kBAAkB,eAAe,IAAI,SAAS,OAAO,WAAW,EAAE,CAAC;AACzE,KAAI,CAAC,gBACJ,OAAM,IAAI,MAAM,6CAA6C;AAE9D,QAAO,KAAK,GAAG,gBAAgB,QAAQ,GAAG,gBAAgB,KAAK,KAAK,IAAI,IAAI,EACtE,KACL,CAAC;;;;;AChBH,MAAM,wBAAwB;CAC7B;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;AAED,MAAM,qBAAqB;CAC1B;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;AAED,MAAM,wBAAwB;CAC7B;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;AAED,MAAM,sBAAsB;CAC3B;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;AAED,MAAM,eAAe;CACpB;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;AAED,MAAM,4BAA4B,CACjC;CACC,MAAM;CACN,SAAS;CACT,EACD;CACC,MAAM;CACN,SAAS;CACT,CACD;AAED,MAAM,iBAAiB;CACtB;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;CACD;EACC,MAAM;EACN,SAAS;EACT;C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;GACN,OAAO;GACP;EACD;CACD,aAAa;EACZ,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,YAAY;EACX,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,cAAc;EACb,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,WAAW;EACV,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,WAAW;EACV,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,aAAa;EACZ,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,gBAAgB;EACf,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,YAAY;EACX,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,WAAW;EACV,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,aAAa;EACZ,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,SAAS;EACR,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,aAAa;EACZ,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,WAAW;EACV,aAAa;GACZ,MAAM;GACN,OAAO;GACP;EACD,YAAY;GACX,MAAM;GACN,OAAO;GACP;EACD;CACD,UAAU;EACT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,CACd,YAAY,IAAI,YAAY,CAC5B,QAAQ,IAAI,QAAQ,CACpB,WAAW,QAAQ,CACnB,sBAAsB,QAAQ,CAC9B,gBAAgB;CAChB,UAAU,IAAI;CACd,SAAS,KAAK;AACb,QAAM,IAAI,IAAI,QAAQ,MAAM,IAAI,CAAC,CAAC;AAClC,UAAQ,KAAK,EAAE;;CAEhB,CAAC,CACD,KAAK,cAAc,GAAG,QAAQ;CAC9B,MAAM,OAAO,IAAI,KAAK,KAAK,IAAI;AAC/B,KAAI,QAAQ,IAAI,YAAY,GAAG,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,KAAK,MAAM,CAAC;EAC3E;AAEH,eAAe,OAAO;AACrB,OAAM,aAAa,MAAM,mCAAmC,CAAC,CAAC;AAC9D,KAAI,QAAQ,KAAK,WAAW,EAC3B,KAAI,MAAM,6BAA6B;AAExC,OAAM,IAAI,WAAW,QAAQ,KAAK;AAClC,OAAM,cAAc,MAAM,cAAc,CAAC,CAAC;;AAG3C,MAAM,MAAM"}
package/package.json CHANGED
@@ -1,26 +1,58 @@
1
1
  {
2
2
  "name": "skeleton",
3
- "description": "Express 3.0 framework-less app structure generator",
4
- "version": "0.1.2",
5
- "author": "Etienne Lemay",
3
+ "description": "The CLI for Skeleton related tooling.",
4
+ "version": "1.0.1-next.0",
6
5
  "repository": {
7
6
  "type": "git",
8
- "url": "git://github.com/EtienneLem/skeleton.git"
7
+ "url": "https://github.com/skeletonlabs/skeleton",
8
+ "directory": "packages/cli"
9
9
  },
10
- "engines": {"node": "*"},
11
- "dependencies": {
12
- "coffee-script": "1.3.x",
13
- "mkdirp": "0.3.x",
14
- "colors": "0.6.x"
10
+ "sideEffects": false,
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
15
17
  },
18
+ "bin": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "files": [
21
+ "dist"
22
+ ],
16
23
  "devDependencies": {
17
- "should": "0.6.x",
18
- "mocha": "1.3.x",
19
- "rimraf": "2.0.x"
24
+ "@types/estree": "1.0.8",
25
+ "@types/node": "24.4.0",
26
+ "@types/semver": "7.7.0",
27
+ "tsdown": "0.14.2",
28
+ "type-fest": "4.41.0",
29
+ "typescript": "5.9.2",
30
+ "vite": "7.1.3",
31
+ "vitest": "3.2.4"
32
+ },
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "@clack/prompts": "0.11.0",
36
+ "colorette": "2.0.20",
37
+ "commander": "14.0.0",
38
+ "detect-indent": "7.0.1",
39
+ "latest-version": "9.0.0",
40
+ "magic-string": "0.30.18",
41
+ "nanoid": "5.1.5",
42
+ "node-html-parser": "7.0.1",
43
+ "package-manager-detector": "1.3.0",
44
+ "postcss": "8.5.6",
45
+ "semver": "7.7.2",
46
+ "svelte": "5.38.6",
47
+ "tinyglobby": "0.2.14",
48
+ "ts-morph": "26.0.0",
49
+ "zimmerframe": "1.1.2"
20
50
  },
21
- "keywords": ["skeleton", "express", "structure", "generator"],
22
- "bin": { "skeleton": "./bin/skeleton" },
23
51
  "scripts": {
24
- "test": "cake test"
52
+ "dev": "tsdown --watch",
53
+ "build": "tsdown",
54
+ "test": "vitest run",
55
+ "check": "tsc",
56
+ "sync": "pnpm build"
25
57
  }
26
- }
58
+ }
package/.npmignore DELETED
@@ -1,5 +0,0 @@
1
- .git*
2
- example/
3
- test/
4
- Cakefile
5
- .DS_Store
package/TODO.md DELETED
@@ -1 +0,0 @@
1
- # TODO
package/bin/skeleton DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- var path = require('path')
4
- var fs = require('fs')
5
- var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib')
6
-
7
- require('coffee-script')
8
-
9
- Skeleton = require(lib + '/skeleton')
10
- new Skeleton
@@ -1,22 +0,0 @@
1
- ###
2
- * Return last item of an array
3
-
4
- * ['a', 'b', 'c'].last() => 'c'
5
- ###
6
- Array::last = ->
7
- this[this.length - 1]
8
-
9
- ###
10
- * Return a new copy of an array
11
-
12
- * a = [1,2,3]
13
- * b = a
14
- * c = a.clone()
15
-
16
- * a == b => true
17
- * a == c => false
18
- * c => [1,2,3]
19
- ###
20
- Array::clone = ->
21
- for elem in this
22
- elem
@@ -1,180 +0,0 @@
1
- # Node.js dependencies
2
- fs = require 'fs'
3
- path = require 'path'
4
- util = require 'util'
5
- mkdirp = require 'mkdirp'
6
- colors = require 'colors'
7
-
8
- # Helpers
9
- require './helpers'
10
-
11
- # Local dependencies
12
- Template = require './template'
13
- OptionParser = require './option_parser'
14
-
15
- # Main class
16
- class Skeleton
17
-
18
- @VERSION = '0.1.2'
19
-
20
- @OPTIONS = [
21
- # Short Long Description Choices
22
- ['-h', '--help', 'display this help message' ]
23
- ['-v', '--version', 'display the version number' ]
24
- ['-f', '--force', 'force on non-empty directory' ]
25
- ['-n', '--nolog', 'do not print any message to process.stdout' ]
26
- ['-d', '--directory', 'the output directory (default: ./)', [''] ]
27
- ['-r', '--renderer', 'template engine', ['ejs', 'jade'] ]
28
- ['-c', '--css', 'stylesheet engine', ['stylus', 'less', 'css'] ]
29
- ['-j', '--js', 'javascript engine', ['coffee', 'js'] ]
30
- ]
31
-
32
- constructor: (args=null, callback=null) ->
33
- @folderCache = {}
34
-
35
- args ||= process.argv.splice(2)
36
- @options = new OptionParser(args.clone(), Skeleton.OPTIONS)
37
-
38
- # Display help message and exit process
39
- if @options.help || args.length == 0
40
- this.displayHelp()
41
- return
42
-
43
- # Display current version and exit process
44
- if @options.version
45
- this.displayVersion()
46
- return
47
-
48
- if @options.appName
49
- files = fs.readdir "#{@options.directory || '.'}/#{@options.appName}", (err, files) =>
50
- throw err if err && 'ENOENT' != err.code
51
- empty = !files?.length > 0
52
-
53
- if empty || !empty && @options.force
54
- this.createProject @options.appName
55
- callback() if callback
56
- else
57
- this.displayLine 'Folder not empty. Use the --force flag to overrite'.grey
58
- this.displayLine "#{'$'.cyan} skeleton -f #{@options.directory || '.'}/#{@options.appName}"
59
- callback() if callback
60
-
61
- ###
62
- * Create a project in appName folder
63
-
64
- * @param {String} appName
65
- ###
66
-
67
- createProject: (appName) =>
68
- template = new Template(appName, @options)
69
- this.displayLine ''
70
-
71
- for filename, content of template.files
72
- this.write filename, "#{content}\n"
73
-
74
- this.displayLine ''
75
- this.displayLine ' ============================================='.cyan
76
- this.displayLine " #{'template engine:'.cyan} #{@options.renderer}"
77
- this.displayLine " #{'stylesheet engine:'.cyan} #{@options.css}"
78
- this.displayLine " #{'javascript engine:'.cyan} #{@options.js}"
79
- this.displayLine ''
80
- this.displayLine " #{'$'.cyan} cd #{@options.appName} && npm install"
81
- this.displayLine " #{'$'.cyan} node server.js"
82
- this.displayLine ' ============================================='.cyan
83
-
84
- ###*
85
- * Echo content > path
86
- * Will recursively create its parent directories
87
-
88
- * @param {String} path
89
- * @param {String} content
90
- ###
91
-
92
- write: (path, content) ->
93
- # Remove useless leading ./ from path
94
- path = path.replace /^\.\//, ''
95
-
96
- this.mkdir path, (spaces) =>
97
- return if path.split('/').pop() == 'empty'
98
-
99
- fs.writeFileSync path, content
100
- this.displayLine " #{spaces}create: #{path}"
101
-
102
-
103
- ###
104
- * Mkdir recusrive (-p)
105
- * Doesn’t create already created directory
106
-
107
- * @param {String} filename
108
- * @param {Function} callback
109
- ###
110
-
111
- mkdir: (filename, callback=null) ->
112
- dirname = path.dirname(filename)
113
- depth = dirname.split('/').length
114
- spaces = new Array(depth).join('')
115
-
116
- if @folderCache[dirname]
117
- callback(spaces) if callback
118
- return
119
-
120
- mkdirp.sync dirname, '0755'
121
- @folderCache[dirname] = true
122
-
123
- this.displayLine " #{spaces}create: #{dirname}".magenta
124
- callback(spaces) if callback
125
-
126
- ###
127
- * Display help message
128
- ###
129
-
130
- displayHelp: ->
131
- rules = []
132
- longest = 0
133
-
134
- for option in Skeleton.OPTIONS
135
- short = option[0]
136
- long = option[1]
137
- desc = option[2]
138
- choices = option[3]
139
-
140
- length = short.length + long.length
141
- longest = length if length > longest
142
-
143
- rules.push
144
- short: short
145
- long: long
146
- desc: desc
147
- choices: choices
148
- length: length
149
-
150
- this.displayLine '\n Usage: skeleton [options] myapp\n'
151
-
152
- for rule in rules
153
- spaces = new Array(longest - rule.length + 3).join(' ')
154
- this.displayLine " #{rule.short}, #{rule.long}#{spaces}#{rule.desc} #{this.printChoices rule.choices}"
155
-
156
- printChoices: (choices) ->
157
- return '' if !choices || choices[0] == ''
158
-
159
- "[#{choices.join(', ')}] (default: #{choices[0]})"
160
-
161
- ###
162
- * Display current Skeleton version
163
- ###
164
-
165
- displayVersion: ->
166
- this.displayLine "Skeleton version #{Skeleton.VERSION}"
167
-
168
- ###
169
- * Print a line to process.stdout
170
- * Will always add a newline after
171
-
172
- * @param {String} line
173
- ###
174
-
175
- displayLine: (line) ->
176
- process.stdout.write "#{line}\n" if !@options.nolog
177
-
178
-
179
- # Export the class
180
- module.exports = Skeleton
@@ -1,61 +0,0 @@
1
- class OptionParser
2
-
3
- ###
4
- * Parse command-line options
5
-
6
- * @param {Array} @args
7
- * @param {Object} opts
8
- ###
9
-
10
- constructor: (@args, opts) ->
11
- options = {}
12
-
13
- for opt in opts
14
- short = opt[0]
15
- long = opt[1]
16
- choices = if opt[3]? then opt[3] else null
17
- optName = long.replace('--', '')
18
- options[optName] = this.getOption [short, long], choices
19
-
20
- options.appName = @args.last()
21
- return options
22
-
23
- ###
24
- * Return given flags value if the option has choices
25
- * else return a boolean whether the flag if found or not
26
-
27
- * @param {Array} flags
28
- * @param {Array} choices
29
- ###
30
-
31
- getOption: (flags, choices) ->
32
- for flag in flags
33
- index = @args.indexOf(flag)
34
- if index > -1
35
- if choices?
36
- value = @args[index + 1]
37
- if choices.indexOf(value) == -1 && choices[0] != ''
38
- throw new Error "Invalid value β€œ#{value}” for #{flag} option"
39
- else
40
- value = true
41
-
42
- this.spliceArgs index, choices?
43
- return value
44
-
45
- if choices? then choices[0] else false
46
-
47
- ###
48
- * When a flag if parsed, it is removed from the @args array
49
- * Last option remaining is the appName
50
-
51
- * @param {Int} index
52
- * @param {Boolean} hasValue (default: false)
53
- ###
54
-
55
- spliceArgs: (index, hasValue=false) ->
56
- nbr = if hasValue then 2 else 1
57
- @args.splice(index, nbr)
58
-
59
-
60
- # Export the class
61
- module.exports = OptionParser