@gasket/template-nextjs-express 0.0.0-canary-20250922153852

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,92 @@
1
+ {
2
+ "name": "{{{appName}}}",
3
+ "version": "0.0.0",
4
+ "description": "Gasket App",
5
+ "scripts": {
6
+ "docs": "tsx gasket.ts docs",
7
+ "build": "npm run build:tsc && next build",
8
+ "start": "node dist/server.js",
9
+ "local": "concurrently \"npm run build:tsc:watch\" \"GASKET_DEV=1 tsx watch server.ts\"",
10
+ "preview": "npm run build && npm run start",
11
+ "prebuild": "tsx gasket.ts build",
12
+ "build:tsc": "tsc -p ./tsconfig.server.json",
13
+ "build:tsc:watch": "tsc -p ./tsconfig.server.json --watch",
14
+ "test": "vitest run",
15
+ "test:watch": "vitest",
16
+ "test:coverage": "vitest run --coverage",
17
+ "lint": "eslint --ext .js,.jsx,.cjs,.ts,.tsx .",
18
+ "lint:fix": "npm run lint -- --fix",
19
+ "posttest": "npm run lint"
20
+ },
21
+ "dependencies": {
22
+ "@gasket/assets": "^7.4.3",
23
+ "@gasket/core": "^7.5.2",
24
+ "@gasket/intl": "^7.5.2",
25
+ "@gasket/nextjs": "^7.6.3",
26
+ "@gasket/plugin-command": "^7.5.2",
27
+ "@gasket/plugin-dynamic-plugins": "^7.4.1",
28
+ "@gasket/plugin-express": "^7.4.3",
29
+ "@gasket/plugin-https": "^7.3.11",
30
+ "@gasket/plugin-intl": "^7.5.8",
31
+ "@gasket/plugin-logger": "^7.3.7",
32
+ "@gasket/plugin-nextjs": "^7.6.3",
33
+ "@gasket/plugin-webpack": "^7.3.8",
34
+ "@gasket/plugin-winston": "^7.3.7",
35
+ "@gasket/react-intl": "^7.6.3",
36
+ "@gasket/request": "^7.4.3",
37
+ "@gasket/utils": "^7.4.2",
38
+ "@types/react": "^19.0.12",
39
+ "express": "^4.21.2",
40
+ "next": "^15.2.5",
41
+ "react": "^19.0.0",
42
+ "react-dom": "^19.0.0",
43
+ "react-intl": "^7.1.6",
44
+ "tsx": "^4.19.3",
45
+ "typescript": "^5.8.2",
46
+ "winston": "^3.17.0"
47
+ },
48
+ "devDependencies": {
49
+ "@babel/core": ">=7",
50
+ "@docusaurus/core": "^3.8.1",
51
+ "@docusaurus/preset-classic": "^3.8.1",
52
+ "@gasket/plugin-docs": "^7.4.7",
53
+ "@gasket/plugin-docusaurus": "^7.4.5",
54
+ "@gasket/plugin-metadata": "^7.5.3",
55
+ "@godaddy/eslint-plugin-react-intl": "^1.3.0",
56
+ "@testing-library/dom": "^10.4.0",
57
+ "@testing-library/react": "^16.3.0",
58
+ "@typescript-eslint/parser": "^8.38.0",
59
+ "@vitejs/plugin-react": "^4.4.1",
60
+ "@vitest/coverage-v8": "^3.2.0",
61
+ "ajv": "^8.17.1",
62
+ "concurrently": "^9.1.2",
63
+ "eslint": "^8.57.1",
64
+ "eslint-config-godaddy-react": "^9.1.0",
65
+ "eslint-config-next": "^13.2.1",
66
+ "eslint-plugin-react-hooks": "^4.6.0",
67
+ "jsdom": "^20.0.3",
68
+ "search-insights": "^2.17.3",
69
+ "typescript": "^5.8.2",
70
+ "vitest": "^3.2.0",
71
+ "webpack": "^5.98.0"
72
+ },
73
+ "type": "module",
74
+ "eslintIgnore": [
75
+ "dist",
76
+ "coverage/",
77
+ "build/"
78
+ ],
79
+ "eslintConfig": {
80
+ "extends": [
81
+ "godaddy-react",
82
+ "plugin:@godaddy/react-intl/recommended",
83
+ "next"
84
+ ],
85
+ "settings": {
86
+ "localeFiles": [
87
+ "locales/en-US.json"
88
+ ]
89
+ },
90
+ "parser": "@typescript-eslint/parser"
91
+ }
92
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { useRouter } from 'next/router';
3
+ import { IntlProvider } from 'react-intl';
4
+ import { withMessagesProvider } from '@gasket/react-intl';
5
+ import intlManager from '../intl';
6
+
7
+ const IntlMessagesProvider = withMessagesProvider(intlManager)(IntlProvider);
8
+
9
+ // Simple functional App component which can be wrapped
10
+ // https://nextjs.org/docs/pages/building-your-application/routing/custom-app
11
+ function App({ Component, pageProps }) {
12
+ const router = useRouter();
13
+
14
+ return (
15
+ <IntlMessagesProvider locale={ router.locale }>
16
+ <Component { ...pageProps } />
17
+ </IntlMessagesProvider>
18
+ );
19
+ }
20
+
21
+ // Wrap the app with higher-order components
22
+ export default App;
@@ -0,0 +1,4 @@
1
+ import Document from 'next/document';
2
+ import { withGasketData } from '@gasket/nextjs/document';
3
+ import gasket from '@/gasket'; // tsconfig path alias
4
+ export default withGasketData(gasket)(Document);
@@ -0,0 +1,21 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import Head from '../components/head.tsx';
4
+ import GasketEmblem from '@gasket/assets/react/gasket-emblem.js';
5
+
6
+ const pageStyle: CSSProperties = { textAlign: 'center' };
7
+ const logoStyle: CSSProperties = { width: '250px', height: '250px' };
8
+
9
+ function IndexPage() {
10
+ return (
11
+ <div style={ pageStyle }>
12
+ <Head title='{{{appName}}}' description='Gasket App'/>
13
+ <GasketEmblem style={ logoStyle }/>
14
+ <h1><FormattedMessage id='gasket_welcome' /></h1>
15
+ <p><FormattedMessage id='gasket_learn' /></p>
16
+ <p><a href='https://gasket.dev'><FormattedMessage id='gasket_edit_page' /></a></p>
17
+ </div>
18
+ );
19
+ }
20
+
21
+ export default IndexPage;
@@ -0,0 +1,4 @@
1
+ // Imports use the .js to support a type module application
2
+ // See README for more information
3
+ import gasket from './gasket.js';
4
+ gasket.actions.startServer();
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import IndexPage from '../pages/index.tsx';
4
+ import { expect, describe, it } from 'vitest';
5
+ import { IntlProvider } from 'react-intl';
6
+ import { createRequire } from 'module';
7
+ const messages = createRequire(import.meta.url)('../locales/en-US.json');
8
+
9
+ describe('IndexPage', () => {
10
+ it('renders page', () => {
11
+ render(
12
+ <IntlProvider locale={ 'en-US' } messages={ messages }>
13
+ <IndexPage />
14
+ </IntlProvider>
15
+ );
16
+
17
+ expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!');
18
+ });
19
+ });
@@ -0,0 +1,47 @@
1
+ {
2
+ "compilerOptions": {
3
+ "skipLibCheck": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "target": "ESNext",
7
+ "isolatedModules": true,
8
+ "esModuleInterop": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "allowImportingTsExtensions": true,
11
+ "outDir": "dist",
12
+ "lib": [
13
+ "esnext",
14
+ "dom"
15
+ ],
16
+ "types": [
17
+ "node"
18
+ ],
19
+ "baseUrl": ".",
20
+ "paths": {
21
+ "@/gasket": [
22
+ "./dist/gasket.js"
23
+ ]
24
+ },
25
+ "allowJs": true,
26
+ "strict": false,
27
+ "noEmit": true,
28
+ "incremental": true,
29
+ "resolveJsonModule": true,
30
+ "jsx": "preserve",
31
+ "plugins": [
32
+ {
33
+ "name": "next"
34
+ }
35
+ ]
36
+ },
37
+ "exclude": [
38
+ "node_modules"
39
+ ],
40
+ "include": [
41
+ "./routes",
42
+ "./plugins",
43
+ "**/*.ts",
44
+ "**/*.tsx",
45
+ ".next/types/**/*.ts"
46
+ ]
47
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ "skipLibCheck": true,
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "target": "ESNext",
7
+ "isolatedModules": true,
8
+ "esModuleInterop": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "outDir": "dist",
11
+ "lib": [
12
+ "esnext",
13
+ "dom"
14
+ ],
15
+ "types": [
16
+ "node"
17
+ ],
18
+ "baseUrl": "./",
19
+ "allowJs": true,
20
+ "strict": false,
21
+ "incremental": true,
22
+ "resolveJsonModule": true
23
+ },
24
+ "exclude": [
25
+ "node_modules"
26
+ ],
27
+ "include": [
28
+ "./plugins",
29
+ "server.ts",
30
+ "gasket.ts",
31
+ "gasket-data.ts"
32
+ ]
33
+ }
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import react from '@vitejs/plugin-react';
3
+
4
+ export default defineConfig({
5
+ plugins: [
6
+ react()
7
+ ],
8
+ test: {
9
+ environment: 'jsdom',
10
+ globals: true
11
+ }
12
+ });
13
+