create-absolutejs 0.1.0 → 0.1.2

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,35 @@
1
+ # `<project-name>`
2
+
3
+ > ⚡️ This project was scaffolded with the **AbsoluteJS CLI** — your one-stop tool for bootstrapping modern TypeScript & JavaScript applications.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This boilerplate gives you a head-start with:
10
+
11
+ - ✅ **TypeScript** or **JavaScript** support
12
+ - 🔍 **ESLint + Prettier** (or Biome, coming soon)
13
+ - 🎨 **Tailwind CSS** integration (optional)
14
+ - 📦 A sensible project layout (frontend & backend folders)
15
+ - 📄 Preconfigured `tsconfig.json`, `eslint.config.mjs`, and Prettier settings
16
+ - ⚙️ Git initialization ready to go
17
+
18
+ ---
19
+
20
+ ## Getting Started
21
+
22
+ ```bash
23
+ # 1. Enter your project folder
24
+ cd <project-name>
25
+
26
+ # 2. Install dependencies
27
+ # (using your package manager of choice: npm, yarn, pnpm, or bun)
28
+ bun install
29
+
30
+ # 3. Start the development server
31
+ bun run dev
32
+
33
+ # 4. Build for production
34
+ bun run build
35
+ ```
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ dist
3
+ build
4
+ *.min.js
@@ -0,0 +1,9 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "none",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 4,
7
+ "endOfLine": "auto",
8
+ "useTabs": true
9
+ }
@@ -0,0 +1,13 @@
1
+ import { env } from 'bun';
2
+ import { defineConfig } from 'drizzle-kit';
3
+
4
+ if (env.DATABASE_URL === undefined) {
5
+ throw new Error('DATABASE_URL must be set in the environment variables');
6
+ }
7
+
8
+ export default defineConfig({
9
+ dbCredentials: {
10
+ url: env.DATABASE_URL
11
+ },
12
+ dialect: 'postgresql'
13
+ });
@@ -0,0 +1,243 @@
1
+ // eslint.config.mjs
2
+ import { dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import pluginJs from '@eslint/js';
5
+ import stylisticTs from '@stylistic/eslint-plugin-ts';
6
+ import tsParser from '@typescript-eslint/parser';
7
+ import { defineConfig } from 'eslint/config';
8
+ import absolutePlugin from 'eslint-plugin-absolute';
9
+ import importPlugin from 'eslint-plugin-import';
10
+ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
11
+ import promisePlugin from 'eslint-plugin-promise';
12
+ import reactPlugin from 'eslint-plugin-react';
13
+ import reactCompilerPlugin from 'eslint-plugin-react-compiler';
14
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
15
+ import securityPlugin from 'eslint-plugin-security';
16
+ import globals from 'globals';
17
+ import tseslint from 'typescript-eslint';
18
+
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+
21
+ export default defineConfig([
22
+ pluginJs.configs.recommended,
23
+
24
+ ...tseslint.configs.recommended,
25
+
26
+ {
27
+ files: ['**/*.{ts,tsx}'],
28
+ languageOptions: {
29
+ globals: globals.browser,
30
+ parser: tsParser,
31
+ parserOptions: {
32
+ createDefaultProgram: true,
33
+ project: './tsconfig.json',
34
+ tsconfigRootDir: __dirname
35
+ }
36
+ }
37
+ },
38
+
39
+ {
40
+ files: ['**/*.{ts,tsx}'],
41
+ plugins: { '@stylistic/ts': stylisticTs },
42
+ rules: {
43
+ '@stylistic/ts/padding-line-between-statements': [
44
+ 'error',
45
+ { blankLine: 'always', next: 'return', prev: '*' }
46
+ ]
47
+ }
48
+ },
49
+
50
+ {
51
+ files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
52
+ ignores: ['example/build/**'],
53
+ plugins: {
54
+ absolute: absolutePlugin,
55
+ import: importPlugin,
56
+ promise: promisePlugin,
57
+ security: securityPlugin
58
+ },
59
+ rules: {
60
+ 'absolute/explicit-object-types': 'error',
61
+ 'absolute/localize-react-props': 'error',
62
+ 'absolute/max-depth-extended': ['error', 1],
63
+ 'absolute/max-jsxnesting': ['error', 5],
64
+ 'absolute/min-var-length': [
65
+ 'error',
66
+ { allowedVars: ['_', 'id', 'db', 'OK'], minLength: 3 }
67
+ ],
68
+ 'absolute/no-button-navigation': 'error',
69
+ 'absolute/no-explicit-return-type': 'error',
70
+ 'absolute/no-inline-prop-types': 'error',
71
+ 'absolute/no-multi-style-objects': 'error',
72
+ 'absolute/no-nested-jsx-return': 'error',
73
+ 'absolute/no-or-none-component': 'error',
74
+ 'absolute/no-transition-cssproperties': 'error',
75
+ 'absolute/no-type-cast': 'error',
76
+ 'absolute/no-unnecessary-div': 'error',
77
+ 'absolute/no-unnecessary-key': 'error',
78
+ 'absolute/no-useless-function': 'error',
79
+ 'absolute/seperate-style-files': 'error',
80
+ 'absolute/sort-exports': [
81
+ 'error',
82
+ {
83
+ caseSensitive: true,
84
+ natural: true,
85
+ order: 'asc',
86
+ variablesBeforeFunctions: true
87
+ }
88
+ ],
89
+ 'absolute/sort-keys-fixable': [
90
+ 'error',
91
+ {
92
+ caseSensitive: true,
93
+ natural: true,
94
+ order: 'asc',
95
+ variablesBeforeFunctions: true
96
+ }
97
+ ],
98
+ 'arrow-body-style': ['error', 'as-needed'],
99
+ 'consistent-return': 'error',
100
+ eqeqeq: 'error',
101
+ 'func-style': [
102
+ 'error',
103
+ 'expression',
104
+ { allowArrowFunctions: true }
105
+ ],
106
+ 'import/no-cycle': 'error',
107
+ 'import/no-default-export': 'error',
108
+ 'import/no-relative-packages': 'error',
109
+ 'import/no-unused-modules': ['error', { missingExports: true }],
110
+ 'import/order': ['error', { alphabetize: { order: 'asc' } }],
111
+ 'no-await-in-loop': 'error',
112
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
113
+ 'no-debugger': 'error',
114
+ 'no-duplicate-case': 'error',
115
+ 'no-duplicate-imports': 'error',
116
+ 'no-else-return': 'error',
117
+ 'no-empty-function': 'error',
118
+ 'no-empty-pattern': 'error',
119
+ 'no-empty-static-block': 'error',
120
+ 'no-fallthrough': 'error',
121
+ 'no-floating-decimal': 'error',
122
+ 'no-global-assign': 'error',
123
+ 'no-implicit-coercion': 'error',
124
+ 'no-implicit-globals': 'error',
125
+ 'no-loop-func': 'error',
126
+ 'no-magic-numbers': [
127
+ 'warn',
128
+ { detectObjects: false, enforceConst: true, ignore: [0, 1] }
129
+ ],
130
+ 'no-misleading-character-class': 'error',
131
+ 'no-nested-ternary': 'error',
132
+ 'no-new-native-nonconstructor': 'error',
133
+ 'no-new-wrappers': 'error',
134
+ 'no-param-reassign': 'error',
135
+ 'no-restricted-imports': [
136
+ 'error',
137
+ {
138
+ paths: [
139
+ {
140
+ importNames: ['default'],
141
+ message:
142
+ 'Import only named React exports for tree-shaking.',
143
+ name: 'react'
144
+ },
145
+ {
146
+ importNames: ['default'],
147
+ message: 'Import only the required Bun exports.',
148
+ name: 'bun'
149
+ }
150
+ ]
151
+ }
152
+ ],
153
+ 'no-return-await': 'error',
154
+ 'no-shadow': 'error',
155
+ 'no-undef': 'error',
156
+ 'no-unneeded-ternary': 'error',
157
+ 'no-unreachable': 'error',
158
+ 'no-useless-assignment': 'error',
159
+ 'no-useless-concat': 'error',
160
+ 'no-useless-return': 'error',
161
+ 'no-var': 'error',
162
+ 'prefer-arrow-callback': 'error',
163
+ 'prefer-const': 'error',
164
+ 'prefer-destructuring': [
165
+ 'error',
166
+ { array: true, object: true },
167
+ { enforceForRenamedProperties: false }
168
+ ],
169
+ 'prefer-template': 'error',
170
+ 'promise/always-return': 'warn',
171
+ 'promise/avoid-new': 'warn',
172
+ 'promise/catch-or-return': 'error',
173
+ 'promise/no-callback-in-promise': 'warn',
174
+ 'promise/no-nesting': 'warn',
175
+ 'promise/no-promise-in-callback': 'warn',
176
+ 'promise/no-return-wrap': 'error',
177
+ 'promise/param-names': 'error'
178
+ }
179
+ },
180
+ {
181
+ files: ['example/**/*.{js,jsx,ts,tsx}'],
182
+ plugins: {
183
+ 'jsx-a11y': jsxA11yPlugin,
184
+ react: reactPlugin,
185
+ 'react-compiler': reactCompilerPlugin,
186
+ 'react-hooks': reactHooksPlugin
187
+ },
188
+ rules: {
189
+ 'jsx-a11y/prefer-tag-over-role': 'error',
190
+ 'react-compiler/react-compiler': 'error',
191
+ 'react-hooks/exhaustive-deps': 'warn',
192
+ 'react-hooks/rules-of-hooks': 'error',
193
+ 'react/checked-requires-onchange-or-readonly': 'error',
194
+ 'react/destructuring-assignment': ['error', 'always'],
195
+ 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
196
+ 'react/jsx-no-leaked-render': 'error',
197
+ 'react/jsx-no-target-blank': 'error',
198
+ 'react/jsx-no-useless-fragment': 'error',
199
+ 'react/jsx-pascal-case': ['error', { allowAllCaps: true }],
200
+ 'react/no-multi-comp': 'error',
201
+ 'react/no-unknown-property': 'off',
202
+ 'react/react-in-jsx-scope': 'off',
203
+ 'react/self-closing-comp': 'error'
204
+ },
205
+ settings: {
206
+ react: { version: 'detect' }
207
+ }
208
+ },
209
+ {
210
+ files: [
211
+ 'example/server.ts',
212
+ 'example/indexes/*.tsx',
213
+ 'example/db/migrate.ts'
214
+ ],
215
+ rules: {
216
+ 'import/no-unused-modules': 'off'
217
+ }
218
+ },
219
+ {
220
+ files: ['example/db/migrate.ts', 'example/utils/absoluteAuthConfig.ts'],
221
+ rules: {
222
+ 'no-console': 'off'
223
+ }
224
+ },
225
+ {
226
+ files: ['eslint.config.mjs'],
227
+ rules: {
228
+ 'no-magic-numbers': 'off'
229
+ }
230
+ },
231
+ {
232
+ files: ['eslint.config.mjs'],
233
+ rules: {
234
+ 'import/no-default-export': 'off'
235
+ }
236
+ },
237
+ {
238
+ files: ['example/db/schema.ts'],
239
+ rules: {
240
+ 'absolute/explicit-object-types': 'off'
241
+ }
242
+ }
243
+ ]);
@@ -0,0 +1,102 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "ESNext" /* Specify what module code is generated. */,
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ "moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
36
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
37
+ // "resolveJsonModule": true, /* Enable importing .json files. */
38
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
39
+
40
+ /* JavaScript Support */
41
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
42
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
43
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
44
+
45
+ /* Emit */
46
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
47
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
48
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
49
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
50
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
51
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
52
+ // "removeComments": true, /* Disable emitting comments. */
53
+ // "noEmit": true, /* Disable emitting files from a compilation. */
54
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
55
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
56
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
57
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
58
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
59
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
60
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
61
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
62
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
63
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
64
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
65
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
66
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
67
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
68
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
69
+
70
+ /* Interop Constraints */
71
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
72
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
73
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
74
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
75
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
76
+
77
+ /* Type Checking */
78
+ "strict": true /* Enable all strict type-checking options. */,
79
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
80
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
81
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
82
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
83
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
84
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
85
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
86
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
87
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
88
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
89
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
90
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
91
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
92
+ "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
93
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
94
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
95
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
96
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
97
+
98
+ /* Completeness */
99
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
100
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
101
+ }
102
+ }
@@ -0,0 +1,2 @@
1
+ export const HOURS_IN_DAY = 24;
2
+ export const TWO_THIRDS = 2 / 3;
@@ -0,0 +1,20 @@
1
+ import { pgTable, timestamp, varchar } from 'drizzle-orm/pg-core';
2
+
3
+ export const users = pgTable('users', {
4
+ auth_sub: varchar('auth_sub', { length: 255 }).primaryKey(),
5
+ created_at: timestamp('created_at').notNull().defaultNow(),
6
+ email: varchar('email', { length: 255 }).notNull().unique(),
7
+ family_name: varchar('family_name', { length: 255 }),
8
+ given_name: varchar('given_name', { length: 255 }),
9
+ picture: varchar('picture', { length: 255 })
10
+ });
11
+
12
+ export const schema = {
13
+ users
14
+ };
15
+
16
+ // Type Definitions
17
+ export type SchemaType = typeof schema;
18
+
19
+ export type User = typeof users.$inferSelect;
20
+ export type NewUser = typeof users.$inferInsert;
@@ -0,0 +1,18 @@
1
+ datasource db {
2
+ provider = "postgresql"
3
+ url = env("DATABASE_URL")
4
+ }
5
+
6
+ generator client {
7
+ provider = "prisma-client-js"
8
+ output = "./src/generated/prisma-client"
9
+ }
10
+
11
+ model User {
12
+ authSub String @id
13
+ createdAt DateTime @default(now())
14
+ email String @unique
15
+ familyName String
16
+ givenName String
17
+ picture String
18
+ }
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Html Home</title>
5
+ <link rel="stylesheet" type="text/css" href="/assets/css/HtmlHome.css">
6
+ <link rel="icon" href="/assets/ico/favicon.ico" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ </head>
9
+ <body>
10
+ <header>
11
+ <img id="logo" src="/assets/svg/brand_logo.svg" alt="AbsoluteJS Logo">
12
+ <h1 id="greeting"></h1>
13
+ </header>
14
+ <main>
15
+ <p>Welcome to AbsoluteJS, the next generation JavaScript framework. We're glad you're here.</p>
16
+ <button id="counter-button">Click me!</button>
17
+ <p id="counter">0</p>
18
+ <div id="links">
19
+ <a href="/react" id="react-link">React</a>
20
+ <a href="/vue" id="vue-link">Vue</a>
21
+ <a href="/angular" id="angular-link">Angular</a>
22
+ <a href="/svelte" id="svelte-link">Svelte</a>
23
+ <a href="/ember" id="ember-link">Ember</a>
24
+ <a href="/htmx" id="htmx-link">HTMX</a>
25
+ </div>
26
+ </main>
27
+ <footer>
28
+ <p id="footer-text"></p>
29
+ </footer>
30
+ <script src="/html/scripts/typescriptSSRExample.js"></script>
31
+ </body>
32
+ </html>
@@ -0,0 +1,54 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ type Breakpoints = {
4
+ xs: number;
5
+ sm: number;
6
+ md: number;
7
+ lg: number;
8
+ xl: number;
9
+ '2xl': number;
10
+ };
11
+
12
+ const defaultBreakpoints: Breakpoints = {
13
+ '2xl': 1536,
14
+ lg: 1024,
15
+ md: 768,
16
+ sm: 640,
17
+ xl: 1280,
18
+ xs: 0
19
+ };
20
+
21
+ export type Breakpoint = keyof Breakpoints;
22
+
23
+ export const useMediaQuery = (customBreakpoints = defaultBreakpoints) => {
24
+ const [breakpoint, setBreakpoint] = useState<Breakpoint>('xs');
25
+
26
+ useEffect(() => {
27
+ const handleResize = () => {
28
+ const { innerWidth: width } = window;
29
+
30
+ if (width < customBreakpoints.sm) {
31
+ setBreakpoint('xs');
32
+ } else if (width < customBreakpoints.md) {
33
+ setBreakpoint('sm');
34
+ } else if (width < customBreakpoints.lg) {
35
+ setBreakpoint('md');
36
+ } else if (width < customBreakpoints.xl) {
37
+ setBreakpoint('lg');
38
+ } else if (width < customBreakpoints['2xl']) {
39
+ setBreakpoint('xl');
40
+ } else {
41
+ setBreakpoint('2xl');
42
+ }
43
+ };
44
+
45
+ handleResize();
46
+ window.addEventListener('resize', handleResize);
47
+
48
+ return () => {
49
+ window.removeEventListener('resize', handleResize);
50
+ };
51
+ }, [customBreakpoints]);
52
+
53
+ return breakpoint;
54
+ };
@@ -0,0 +1,28 @@
1
+ import { type CSSProperties } from 'react';
2
+
3
+ export const styleReset = `
4
+ * {
5
+ margin: 0;
6
+ padding: 0;
7
+ box-sizing: border-box;
8
+ font-weight: inherit;
9
+ }
10
+ `;
11
+
12
+ export const bodyDefault: CSSProperties = {
13
+ backgroundColor: '#f5f5f5',
14
+ color: '#333',
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ height: '100%',
18
+ margin: 0
19
+ };
20
+ export const htmlDefault: CSSProperties = {
21
+ fontFamily: 'Poppins, sans-serif',
22
+ height: '100%'
23
+ };
24
+ export const mainDefault: CSSProperties = {
25
+ display: 'flex',
26
+ flex: 1,
27
+ flexDirection: 'column'
28
+ };
@@ -0,0 +1,8 @@
1
+ import autoprefixer from 'autoprefixer';
2
+ import tailwindcss from 'tailwindcss';
3
+
4
+ const config = {
5
+ plugins: [tailwindcss, autoprefixer]
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,7 @@
1
+ import type { Config } from 'tailwindcss';
2
+
3
+ const config: Config = {
4
+ content: ['./src/frontend/**/*.{js,ts,jsx,tsx,mdx}']
5
+ };
6
+
7
+ export default config;
@@ -0,0 +1 @@
1
+ @import 'tailwindcss';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-absolutejs",
3
3
  "description": "A CLI tool to create a new AbsoluteJS project",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "license": "CC BY-NC 4.0",
6
6
  "author": "Alex Kahn",
7
7
  "type": "module",
@@ -10,10 +10,11 @@
10
10
  "create-absolutejs": "dist/index.js"
11
11
  },
12
12
  "files": [
13
- "dist"
13
+ "dist",
14
+ "dist/templates"
14
15
  ],
15
16
  "scripts": {
16
- "build": "rm -rf dist && bun build src/index.ts --target node --outdir dist && tsc --emitDeclarationOnly --project tsconfig.json",
17
+ "build": "rm -rf dist && bun build src/index.ts --target node --outdir dist && cp -R src/templates dist/templates && tsc --emitDeclarationOnly --project tsconfig.json",
17
18
  "test": "cd absolutejs-project && bun dev",
18
19
  "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json,mjs,md}\"",
19
20
  "dev": "rm -rf absolutejs-project && bun run src/index.ts",