create-absolutejs 0.10.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/constants.d.ts +2 -2
  2. package/dist/constants.js +2 -2
  3. package/dist/data.d.ts +10 -10
  4. package/dist/data.js +104 -95
  5. package/dist/generators/angular/generateAngularPage.d.ts +7 -0
  6. package/dist/generators/angular/generateAngularPage.js +175 -0
  7. package/dist/generators/angular/scaffoldAngular.d.ts +2 -0
  8. package/dist/generators/angular/scaffoldAngular.js +34 -0
  9. package/dist/generators/configurations/generateEslintConfig.d.ts +2 -0
  10. package/dist/generators/configurations/generateEslintConfig.js +253 -0
  11. package/dist/generators/configurations/generatePackageJson.js +26 -3
  12. package/dist/generators/configurations/scaffoldConfigurationFiles.js +28 -3
  13. package/dist/generators/db/dockerInitTemplates.d.ts +9 -9
  14. package/dist/generators/db/dockerInitTemplates.js +9 -9
  15. package/dist/generators/db/generateDatabaseTypes.js +5 -0
  16. package/dist/generators/db/generateDockerContainer.js +4 -2
  17. package/dist/generators/db/generateDrizzleSchema.js +16 -6
  18. package/dist/generators/db/handlerTemplates.d.ts +5 -0
  19. package/dist/generators/db/handlerTemplates.js +6 -0
  20. package/dist/generators/db/scaffoldDocker.js +42 -30
  21. package/dist/generators/html/generateHTMLPage.d.ts +1 -1
  22. package/dist/generators/html/generateHTMLPage.js +2 -2
  23. package/dist/generators/html/scaffoldHTML.d.ts +1 -1
  24. package/dist/generators/html/scaffoldHTML.js +2 -2
  25. package/dist/generators/htmx/generateHTMXPage.d.ts +1 -1
  26. package/dist/generators/htmx/generateHTMXPage.js +2 -2
  27. package/dist/generators/htmx/scaffoldHTMX.d.ts +1 -1
  28. package/dist/generators/htmx/scaffoldHTMX.js +2 -2
  29. package/dist/generators/project/computeFlags.d.ts +1 -0
  30. package/dist/generators/project/computeFlags.js +1 -0
  31. package/dist/generators/project/generateBuildBlock.d.ts +2 -1
  32. package/dist/generators/project/generateBuildBlock.js +11 -7
  33. package/dist/generators/project/generateDBBlock.js +6 -0
  34. package/dist/generators/project/generateImportsBlock.js +39 -27
  35. package/dist/generators/project/generateMarkupCSS.js +4 -0
  36. package/dist/generators/project/generateRoutesBlock.d.ts +1 -2
  37. package/dist/generators/project/generateRoutesBlock.js +28 -17
  38. package/dist/generators/project/generateServer.js +5 -10
  39. package/dist/generators/project/scaffoldFrontends.js +20 -1
  40. package/dist/generators/react/generateReactComponents.d.ts +2 -2
  41. package/dist/generators/react/generateReactComponents.js +33 -33
  42. package/dist/generators/react/scaffoldReact.d.ts +1 -1
  43. package/dist/generators/react/scaffoldReact.js +2 -2
  44. package/dist/generators/svelte/generateSveltePage.d.ts +1 -1
  45. package/dist/generators/svelte/generateSveltePage.js +20 -2
  46. package/dist/generators/svelte/scaffoldSvelte.d.ts +1 -1
  47. package/dist/generators/svelte/scaffoldSvelte.js +2 -2
  48. package/dist/generators/vue/generateVuePage.d.ts +1 -1
  49. package/dist/generators/vue/generateVuePage.js +20 -2
  50. package/dist/generators/vue/scaffoldVue.d.ts +1 -1
  51. package/dist/generators/vue/scaffoldVue.js +2 -2
  52. package/dist/questions/databaseEngine.d.ts +1 -1
  53. package/dist/questions/frontendDirectoryConfigurations.d.ts +1 -1
  54. package/dist/questions/frontends.d.ts +1 -1
  55. package/dist/questions/frontends.js +3 -3
  56. package/dist/scaffold.js +14 -2
  57. package/dist/templates/assets/svg/angular.svg +18 -0
  58. package/dist/templates/configurations/{eslint.config.mjs → eslint.config.example.mjs} +10 -10
  59. package/dist/templates/configurations/tsconfig.example.json +12 -12
  60. package/dist/templates/react/components/App.tsx +2 -2
  61. package/dist/templates/react/components/Head.tsx +7 -7
  62. package/dist/templates/react/components/OAuthLink.tsx +2 -2
  63. package/dist/templates/styles/colors.ts +6 -8
  64. package/dist/templates/styles/reset.css +15 -0
  65. package/dist/templates/svelte/components/Counter.svelte +4 -0
  66. package/dist/templates/vue/components/CountButton.vue +1 -1
  67. package/dist/typeGuards.d.ts +6 -6
  68. package/dist/typeGuards.js +6 -6
  69. package/dist/types.d.ts +1 -0
  70. package/dist/utils/checkDockerInstalled.d.ts +4 -4
  71. package/dist/utils/checkDockerInstalled.js +78 -71
  72. package/dist/utils/parseCommandLineOptions.js +13 -16
  73. package/dist/versions.d.ts +45 -33
  74. package/dist/versions.js +55 -42
  75. package/package.json +10 -9
@@ -1,12 +1,12 @@
1
1
  import { copyFileSync, cpSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { generateSveltePage } from './generateSveltePage';
4
- export const scaffoldSvelte = ({ isSingleFrontend, targetDirectory, frontends, templatesDirectory, projectAssetsDirectory }) => {
4
+ export const scaffoldSvelte = ({ editBasePath, isSingleFrontend, targetDirectory, frontends, templatesDirectory, projectAssetsDirectory }) => {
5
5
  copyFileSync(join(templatesDirectory, 'assets', 'svg', 'svelte-logo.svg'), join(projectAssetsDirectory, 'svg', 'svelte-logo.svg'));
6
6
  cpSync(join(templatesDirectory, 'svelte'), targetDirectory, {
7
7
  recursive: true
8
8
  });
9
- const sveltePage = generateSveltePage(frontends);
9
+ const sveltePage = generateSveltePage(frontends, editBasePath);
10
10
  const pagesDirectory = join(targetDirectory, 'pages');
11
11
  mkdirSync(pagesDirectory, { recursive: true });
12
12
  const svelteFilePath = join(pagesDirectory, 'SvelteExample.svelte');
@@ -1,2 +1,2 @@
1
1
  import { Frontend } from '../../types';
2
- export declare const generateVuePage: (frontends: Frontend[]) => string;
2
+ export declare const generateVuePage: (frontends: Frontend[], editBasePath: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { formatNavLink } from '../../utils/formatNavLink';
2
- export const generateVuePage = (frontends) => {
2
+ export const generateVuePage = (frontends, editBasePath) => {
3
3
  const navLinks = frontends.map(formatNavLink).join('\n\t\t\t');
4
4
  return `<script setup lang="ts">
5
5
  import CountButton from '../components/CountButton.vue';
@@ -60,7 +60,7 @@ const closeDropdown = (event: PointerEvent) => {
60
60
  <h1>AbsoluteJS + Vue</h1>
61
61
  <CountButton :initialCount="count" />
62
62
  <p>
63
- Edit <code>example/vue/pages/VueExample.vue</code> and save
63
+ Edit <code>${editBasePath}/pages/VueExample.vue</code> and save
64
64
  to test HMR.
65
65
  </p>
66
66
  ${frontends.length > 1
@@ -191,6 +191,10 @@ h1 {
191
191
  filter: drop-shadow(0 0 2rem #42b883);
192
192
  }
193
193
 
194
+ button:hover {
195
+ border-color: #42b883;
196
+ }
197
+
194
198
  nav {
195
199
  display: flex;
196
200
  gap: 4rem;
@@ -295,6 +299,15 @@ header details nav a {
295
299
  }
296
300
  }
297
301
 
302
+ code {
303
+ background-color: rgba(255, 255, 255, 0.08);
304
+ border: 1px solid rgba(255, 255, 255, 0.1);
305
+ border-radius: 0.375rem;
306
+ font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
307
+ font-size: 0.875em;
308
+ padding: 0.2rem 0.5rem;
309
+ }
310
+
298
311
  @media (prefers-color-scheme: light) {
299
312
  :global(body) {
300
313
  background-color: #f5f5f5;
@@ -308,6 +321,11 @@ header details nav a {
308
321
  button {
309
322
  background-color: #ffffff;
310
323
  }
324
+
325
+ code {
326
+ background-color: rgba(0, 0, 0, 0.06);
327
+ border-color: rgba(0, 0, 0, 0.1);
328
+ }
311
329
  }
312
330
  </style>
313
331
  `;
@@ -1,4 +1,4 @@
1
1
  import { ScaffoldFrontendProps } from '../../types';
2
2
  type ScaffoldVueProps = Omit<ScaffoldFrontendProps, 'isSingleFrontend'>;
3
- export declare const scaffoldVue: ({ targetDirectory, templatesDirectory, frontends, projectAssetsDirectory }: ScaffoldVueProps) => void;
3
+ export declare const scaffoldVue: ({ editBasePath, targetDirectory, templatesDirectory, frontends, projectAssetsDirectory }: ScaffoldVueProps) => void;
4
4
  export {};
@@ -1,12 +1,12 @@
1
1
  import { cpSync, copyFileSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { generateVuePage } from './generateVuePage';
4
- export const scaffoldVue = ({ targetDirectory, templatesDirectory, frontends, projectAssetsDirectory }) => {
4
+ export const scaffoldVue = ({ editBasePath, targetDirectory, templatesDirectory, frontends, projectAssetsDirectory }) => {
5
5
  copyFileSync(join(templatesDirectory, 'assets', 'svg', 'vue-logo.svg'), join(projectAssetsDirectory, 'svg', 'vue-logo.svg'));
6
6
  cpSync(join(templatesDirectory, 'vue'), targetDirectory, {
7
7
  recursive: true
8
8
  });
9
- const vuePage = generateVuePage(frontends);
9
+ const vuePage = generateVuePage(frontends, editBasePath);
10
10
  const pagesDirectory = join(targetDirectory, 'pages');
11
11
  mkdirSync(pagesDirectory, { recursive: true });
12
12
  const vueFilePath = join(pagesDirectory, 'VueExample.vue');
@@ -1 +1 @@
1
- export declare const getDatabaseEngine: () => Promise<"gel" | "mysql" | "postgresql" | "sqlite" | "singlestore" | "mariadb" | "mongodb" | "cockroachdb" | "mssql" | undefined>;
1
+ export declare const getDatabaseEngine: () => Promise<"gel" | "mariadb" | "mssql" | "mysql" | "postgresql" | "singlestore" | "sqlite" | "mongodb" | "cockroachdb" | undefined>;
@@ -1,2 +1,2 @@
1
1
  import type { DirectoryConfiguration, Frontend } from '../types';
2
- export declare const getFrontendDirectoryConfigurations: (directoryConfiguration: DirectoryConfiguration, frontends: Frontend[], passedFrontendDirectories: Partial<Record<Frontend, string>> | undefined) => Promise<Partial<Record<"react" | "html" | "svelte" | "vue" | "htmx", string>>>;
2
+ export declare const getFrontendDirectoryConfigurations: (directoryConfiguration: DirectoryConfiguration, frontends: Frontend[], passedFrontendDirectories: Partial<Record<Frontend, string>> | undefined) => Promise<Partial<Record<"react" | "html" | "svelte" | "vue" | "htmx" | "angular", string>>>;
@@ -1 +1 @@
1
- export declare const getFrontends: () => Promise<("react" | "html" | "svelte" | "vue" | "htmx")[]>;
1
+ export declare const getFrontends: () => Promise<("react" | "html" | "svelte" | "vue" | "htmx" | "angular")[]>;
@@ -1,12 +1,12 @@
1
1
  import { multiselect, isCancel } from '@clack/prompts';
2
- import { frontendLabels } from '../data';
2
+ import { availableFrontends, frontendLabels } from '../data';
3
3
  import { isFrontend } from '../typeGuards';
4
4
  import { abort } from '../utils/abort';
5
5
  export const getFrontends = async () => {
6
6
  const frontends = await multiselect({
7
7
  message: 'Frontend(s) (space to select, enter to finish):',
8
- options: Object.entries(frontendLabels).map(([value, label]) => ({
9
- label,
8
+ options: availableFrontends.map((value) => ({
9
+ label: frontendLabels[value],
10
10
  value
11
11
  }))
12
12
  });
package/dist/scaffold.js CHANGED
@@ -1,4 +1,4 @@
1
- import { copyFileSync } from 'fs';
1
+ import { copyFileSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join, dirname } from 'path';
3
3
  import { fileURLToPath } from 'url';
4
4
  import { formatProject } from './commands/formatProject';
@@ -66,7 +66,7 @@ export const scaffold = async ({ response: { projectName, codeQualityTool, initi
66
66
  projectName,
67
67
  typesDirectory
68
68
  });
69
- dockerFreshInstall = result.dockerFreshInstall;
69
+ ({ dockerFreshInstall } = result);
70
70
  }
71
71
  scaffoldFrontends({
72
72
  absProviders,
@@ -81,6 +81,18 @@ export const scaffold = async ({ response: { projectName, codeQualityTool, initi
81
81
  useHTMLScripts,
82
82
  useTailwind
83
83
  });
84
+ const utilsDirectory = join(frontendDirectory, 'utils');
85
+ mkdirSync(utilsDirectory, { recursive: true });
86
+ writeFileSync(join(utilsDirectory, 'edenTreaty.ts'), `import { treaty } from '@elysiajs/eden'
87
+ import type { Server } from '../../backend/server'
88
+
89
+ const serverUrl =
90
+ typeof window !== 'undefined'
91
+ ? window.location.origin
92
+ : 'http://localhost:3000'
93
+
94
+ export const server = treaty<Server>(serverUrl)
95
+ `);
84
96
  if (installDependenciesNow) {
85
97
  await installDependencies(packageManager, projectName);
86
98
  }
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
2
+ <defs>
3
+ <linearGradient id="a" x1="64" y1="128" x2="64" y2="0" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#e40035"/>
5
+ <stop offset=".24" stop-color="#f60a48"/>
6
+ <stop offset=".352" stop-color="#f20755"/>
7
+ <stop offset=".494" stop-color="#dc087d"/>
8
+ <stop offset=".745" stop-color="#9717e7"/>
9
+ <stop offset="1" stop-color="#6c00f5"/>
10
+ </linearGradient>
11
+ <linearGradient id="b" x1="64" y1="128" x2="64" y2="0" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0" stop-color="#ff31d9" stop-opacity=".8"/>
13
+ <stop offset="1" stop-color="#ff5be1" stop-opacity="0"/>
14
+ </linearGradient>
15
+ </defs>
16
+ <path fill="url(#a)" d="M7.9 89.9 3.5 21.3 49.7 0ZM124.5 21.3 120.1 89.9 78.3 0ZM64 34.1 80.5 74.3 47.5 74.3ZM95.5 110 64 128 32.5 110 38.9 94.5 89.2 94.5Z"/>
17
+ <path fill="url(#b)" d="M7.9 89.9 3.5 21.3 49.7 0ZM124.5 21.3 120.1 89.9 78.3 0ZM64 34.1 80.5 74.3 47.5 74.3ZM95.5 110 64 128 32.5 110 38.9 94.5 89.2 94.5Z"/>
18
+ </svg>
@@ -1,8 +1,9 @@
1
1
  // eslint.config.mjs
2
2
  import { dirname } from 'path';
3
3
  import { fileURLToPath } from 'url';
4
+ import { fixupPluginRules } from '@eslint/compat';
4
5
  import pluginJs from '@eslint/js';
5
- import stylisticTs from '@stylistic/eslint-plugin-ts';
6
+ import stylistic from '@stylistic/eslint-plugin';
6
7
  import tsParser from '@typescript-eslint/parser';
7
8
  import { defineConfig } from 'eslint/config';
8
9
  import absolutePlugin from 'eslint-plugin-absolute';
@@ -38,9 +39,9 @@ export default defineConfig([
38
39
 
39
40
  {
40
41
  files: ['**/*.{ts,tsx}'],
41
- plugins: { '@stylistic/ts': stylisticTs },
42
+ plugins: { '@stylistic': stylistic },
42
43
  rules: {
43
- '@stylistic/ts/padding-line-between-statements': [
44
+ '@stylistic/padding-line-between-statements': [
44
45
  'error',
45
46
  { blankLine: 'always', next: 'return', prev: '*' }
46
47
  ]
@@ -51,10 +52,10 @@ export default defineConfig([
51
52
  files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
52
53
  ignores: ['example/build/**'],
53
54
  plugins: {
54
- absolute: absolutePlugin,
55
- import: importPlugin,
56
- promise: promisePlugin,
57
- security: securityPlugin
55
+ absolute: fixupPluginRules(absolutePlugin),
56
+ import: fixupPluginRules(importPlugin),
57
+ promise: fixupPluginRules(promisePlugin),
58
+ security: fixupPluginRules(securityPlugin)
58
59
  },
59
60
  rules: {
60
61
  'absolute/explicit-object-types': 'error',
@@ -72,7 +73,6 @@ export default defineConfig([
72
73
  'absolute/no-nested-jsx-return': 'error',
73
74
  'absolute/no-or-none-component': 'error',
74
75
  'absolute/no-transition-cssproperties': 'error',
75
- 'absolute/no-type-cast': 'error',
76
76
  'absolute/no-unnecessary-div': 'error',
77
77
  'absolute/no-unnecessary-key': 'error',
78
78
  'absolute/no-useless-function': 'error',
@@ -180,8 +180,8 @@ export default defineConfig([
180
180
  {
181
181
  files: ['example/**/*.{js,jsx,ts,tsx}'],
182
182
  plugins: {
183
- 'jsx-a11y': jsxA11yPlugin,
184
- react: reactPlugin,
183
+ 'jsx-a11y': fixupPluginRules(jsxA11yPlugin),
184
+ react: fixupPluginRules(reactPlugin),
185
185
  'react-compiler': reactCompilerPlugin,
186
186
  'react-hooks': reactHooksPlugin
187
187
  },
@@ -1,10 +1,5 @@
1
1
  {
2
2
  "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- "incremental": true,
7
- "tsBuildInfoFile": ".absolutejs/tsconfig.tsbuildinfo",
8
3
  // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
9
4
  // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
5
  // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
@@ -50,9 +45,13 @@
50
45
  /* Interop Constraints */
51
46
  // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
52
47
  // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
53
- "esModuleInterop": true, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
54
- /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
55
- /* Ensure that casing is correct in imports. */ "jsx": "react-jsx", // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
48
+ "esModuleInterop": true, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */,
49
+ /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
50
+ /* Visit https://aka.ms/tsconfig to read more about this file */
51
+
52
+ /* Projects */
53
+ "incremental": true,
54
+ /* Ensure that casing is correct in imports. */ "jsx": "react-jsx", // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */,
56
55
  /* Specify what JSX code is generated. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
57
56
  // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
58
57
  // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
@@ -62,8 +61,8 @@
62
61
  // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
63
62
  // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
64
63
  /* Modules */
65
- "module": "ESNext", // "rootDir": "./", /* Specify the root folder within your source files. */
66
- /* Specify what module code is generated. */ "moduleResolution": "bundler", // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
64
+ "module": "ESNext", // "rootDir": "./", /* Specify the root folder within your source files. */,
65
+ /* Specify what module code is generated. */ "moduleResolution": "bundler", // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
67
66
  /* Specify how TypeScript looks up a file from a given module specifier. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
68
67
  // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
69
68
  // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
@@ -76,7 +75,7 @@
76
75
  // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
77
76
  // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
78
77
  // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
79
- "noUncheckedIndexedAccess": true, // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
78
+ "noUncheckedIndexedAccess": true, // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */,
80
79
  /* Add 'undefined' to a type when accessed using an index. */ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
81
80
  // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
82
81
  // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
@@ -86,7 +85,8 @@
86
85
  /* Skip type checking all .d.ts files. */ "strict": true /* Visit https://aka.ms/tsconfig to read more about this file */,
87
86
  /* Enable all strict type-checking options. */ /* Projects */
88
87
  /* Language and Environment */
89
- "target": "ESNext"
88
+ "target": "ESNext",
89
+ "tsBuildInfoFile": ".absolutejs/tsconfig.tsbuildinfo"
90
90
  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ /* Skip type checking all .d.ts files. */
91
91
  }
92
92
  }
@@ -10,16 +10,16 @@ export const App = ({ initialCount }: AppProps) => {
10
10
  <nav>
11
11
  <a href="https://absolutejs.com" target="_blank">
12
12
  <img
13
+ alt="AbsoluteJS Logo"
13
14
  className="logo"
14
15
  src="/assets/png/absolutejs-temp.png"
15
- alt="AbsoluteJS Logo"
16
16
  />
17
17
  </a>
18
18
  <a href="https://react.dev/">
19
19
  <img
20
+ alt="React Logo"
20
21
  className="logo react"
21
22
  src="/assets/svg/react.svg"
22
- alt="React Logo"
23
23
  />
24
24
  </a>
25
25
  </nav>
@@ -16,19 +16,19 @@ export const Head = ({
16
16
  <head>
17
17
  <meta charSet="utf-8" />
18
18
  <title>{title}</title>
19
- <meta name="description" content={description} />
20
- <meta name="viewport" content="width=device-width, initial-scale=1" />
21
- <link rel="icon" href={icon} />
22
- <link rel="preconnect" href="https://fonts.googleapis.com" />
19
+ <meta content={description} name="description" />
20
+ <meta content="width=device-width, initial-scale=1" name="viewport" />
21
+ <link href={icon} rel="icon" />
22
+ <link href="https://fonts.googleapis.com" rel="preconnect" />
23
23
  <link
24
- rel="preconnect"
25
- href="https://fonts.gstatic.com"
26
24
  crossOrigin="anonymous"
25
+ href="https://fonts.gstatic.com"
26
+ rel="preconnect"
27
27
  />
28
28
  <link
29
29
  href={`https://fonts.googleapis.com/css2?family=${font}:wght@100..900&display=swap`}
30
30
  rel="stylesheet"
31
31
  />
32
- {cssPath && <link rel="stylesheet" href={cssPath} type="text/css" />}
32
+ {cssPath && <link href={cssPath} rel="stylesheet" type="text/css" />}
33
33
  </head>
34
34
  );
@@ -17,18 +17,18 @@ export const OAuthLink = ({
17
17
 
18
18
  return (
19
19
  <a
20
+ href={provider ? `/oauth2/${provider}/authorization` : undefined}
20
21
  style={{
21
22
  alignItems: 'center',
22
23
  display: 'flex',
23
24
  gap: '0.5rem'
24
25
  }}
25
- href={provider ? `/oauth2/${provider}/authorization` : undefined}
26
26
  >
27
27
  {provider ? (
28
28
  <img
29
- style={{ height: '2rem', width: '2rem' }}
30
29
  alt={`${name} logo`}
31
30
  src={logoUrl}
31
+ style={{ height: '2rem', width: '2rem' }}
32
32
  />
33
33
  ) : (
34
34
  <p>Provider not configured</p>
@@ -1,11 +1,9 @@
1
- export const primaryColor = '#5FBEEB';
2
- export const secondaryColor = '#35d5a2';
3
- export const tertiaryColor = '#ff4b91';
4
-
5
- export const lightPrimaryColor = '#ffffff';
6
- export const lightSecondaryColor = '#f5f5f5';
7
- export const lightTertiaryColor = '#e0e0e0';
8
-
9
1
  export const darkPrimaryColor = '#1a1a1a';
10
2
  export const darkSecondaryColor = '#2c2c2c';
11
3
  export const darkTertiaryColor = '#3c3c3c';
4
+ export const lightPrimaryColor = '#ffffff';
5
+ export const lightSecondaryColor = '#f5f5f5';
6
+ export const lightTertiaryColor = '#e0e0e0';
7
+ export const primaryColor = '#5FBEEB';
8
+ export const secondaryColor = '#35d5a2';
9
+ export const tertiaryColor = '#ff4b91';
@@ -76,6 +76,16 @@ button:focus-visible {
76
76
  outline: 4px auto -webkit-focus-ring-color;
77
77
  }
78
78
 
79
+ code {
80
+ background-color: rgba(255, 255, 255, 0.08);
81
+ border: 1px solid rgba(255, 255, 255, 0.1);
82
+ border-radius: 0.375rem;
83
+ font-family:
84
+ 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
85
+ font-size: 0.875em;
86
+ padding: 0.2rem 0.5rem;
87
+ }
88
+
79
89
  @media (max-width: 480px) {
80
90
  main {
81
91
  padding: 1rem;
@@ -95,4 +105,9 @@ button:focus-visible {
95
105
  background-color: #f5f5f5;
96
106
  color: #1a1a1a;
97
107
  }
108
+
109
+ code {
110
+ background-color: rgba(0, 0, 0, 0.06);
111
+ border-color: rgba(0, 0, 0, 0.1);
112
+ }
98
113
  }
@@ -11,6 +11,10 @@
11
11
  <button onclick={increment}>count is {getCount()}</button>
12
12
 
13
13
  <style>
14
+ button:hover {
15
+ border-color: #ff3e00;
16
+ }
17
+
14
18
  @media (prefers-color-scheme: light) {
15
19
  button {
16
20
  background-color: #ffffff;
@@ -24,7 +24,7 @@ button {
24
24
  transition: border-color 0.25s;
25
25
  }
26
26
  button:hover {
27
- border-color: #5fbeeb;
27
+ border-color: #42b883;
28
28
  }
29
29
  button:focus,
30
30
  button:focus-visible {
@@ -1,10 +1,10 @@
1
1
  import type { AuthOption, AvailableDrizzleDialect, CodeQualityTool, DatabaseEngine, DatabaseHost, Frontend, ORM } from './types';
2
- export declare const isValidAuthOption: (value: string | undefined) => value is AuthOption;
3
- export declare const isDirectoryConfig: (value: string) => value is "default" | "custom";
4
- export declare const isDrizzleDialect: (value: string | undefined) => value is AvailableDrizzleDialect;
5
- export declare const isPrismaDialect: (value: string | undefined) => value is string;
2
+ export declare const isCodeQualityTool: (value: string | undefined) => value is CodeQualityTool;
6
3
  export declare const isDatabaseEngine: (value: string | undefined) => value is DatabaseEngine;
7
4
  export declare const isDatabaseHost: (value: string | undefined) => value is DatabaseHost;
8
- export declare const isORM: (value: string | undefined) => value is ORM;
9
- export declare const isCodeQualityTool: (value: string | undefined) => value is CodeQualityTool;
5
+ export declare const isDirectoryConfig: (value: string) => value is "default" | "custom";
6
+ export declare const isDrizzleDialect: (value: string | undefined) => value is AvailableDrizzleDialect;
10
7
  export declare const isFrontend: (value: string | undefined) => value is Frontend;
8
+ export declare const isORM: (value: string | undefined) => value is ORM;
9
+ export declare const isPrismaDialect: (value: string | undefined) => value is string;
10
+ export declare const isValidAuthOption: (value: string | undefined) => value is AuthOption;
@@ -1,10 +1,10 @@
1
1
  import { availableDatabaseEngines, availableDatabaseHosts, availableDrizzleDialects, availablePrismaDialects, frontendLabels } from './data';
2
- export const isValidAuthOption = (value) => value === 'abs' || value === 'none' || value === undefined;
3
- export const isDirectoryConfig = (value) => value === 'default' || value === 'custom';
4
- export const isDrizzleDialect = (value) => availableDrizzleDialects.some((dialect) => dialect === value);
5
- export const isPrismaDialect = (value) => availablePrismaDialects.some((dialect) => dialect === value);
2
+ export const isCodeQualityTool = (value) => value === 'eslint+prettier' || value === 'biome' || value === undefined;
6
3
  export const isDatabaseEngine = (value) => availableDatabaseEngines.some((engine) => engine === value);
7
4
  export const isDatabaseHost = (value) => availableDatabaseHosts.some((host) => host === value);
8
- export const isORM = (value) => value === 'drizzle' || value === 'prisma' || value === undefined;
9
- export const isCodeQualityTool = (value) => value === 'eslint+prettier' || value === 'biome' || value === undefined;
5
+ export const isDirectoryConfig = (value) => value === 'default' || value === 'custom';
6
+ export const isDrizzleDialect = (value) => availableDrizzleDialects.some((dialect) => dialect === value);
10
7
  export const isFrontend = (value) => value !== undefined && Object.keys(frontendLabels).includes(value);
8
+ export const isORM = (value) => value === 'drizzle' || value === 'prisma' || value === undefined;
9
+ export const isPrismaDialect = (value) => availablePrismaDialects.some((dialect) => dialect === value);
10
+ export const isValidAuthOption = (value) => value === 'abs' || value === 'none' || value === undefined;
package/dist/types.d.ts CHANGED
@@ -4,6 +4,7 @@ export type ScaffoldFrontendProps = {
4
4
  absProviders: ProviderOption[] | undefined;
5
5
  assetsDirectory: string;
6
6
  authOption: AuthOption;
7
+ editBasePath: string;
7
8
  targetDirectory: string;
8
9
  templatesDirectory: string;
9
10
  projectAssetsDirectory: string;
@@ -1,10 +1,10 @@
1
- export declare const resolveDockerExe: () => string;
2
1
  export declare const hasDocker: () => Promise<boolean>;
3
2
  export declare const isDockerDaemonRunning: () => Promise<boolean>;
3
+ export declare const resolveDockerExe: () => "C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe" | "docker";
4
+ export declare const checkDockerInstalled: (databaseEngine?: string) => Promise<{
5
+ freshInstall: boolean;
6
+ }>;
4
7
  export declare const ensureDockerDaemonRunning: () => Promise<{
5
8
  daemonWasStarted: boolean;
6
9
  }>;
7
10
  export declare const shutdownDockerDaemon: () => Promise<void>;
8
- export declare const checkDockerInstalled: (databaseEngine?: string) => Promise<{
9
- freshInstall: boolean;
10
- }>;