@vendure/create 3.5.2-master-202512180239 → 3.5.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.
- package/assets/.env.hbs +1 -1
- package/assets/monorepo/root-gitignore.template +5 -0
- package/assets/monorepo/root-package.json.hbs +22 -0
- package/assets/monorepo/root-readme.hbs +69 -0
- package/assets/monorepo/storefront-env.hbs +5 -0
- package/assets/tsconfig.dashboard.hbs +21 -0
- package/assets/tsconfig.template.json +1 -0
- package/assets/{vite.config.template.mts → vite.config.hbs} +1 -1
- package/lib/constants.d.ts +13 -1
- package/lib/constants.js +39 -2
- package/lib/constants.js.map +1 -1
- package/lib/create-vendure-app.d.ts +2 -1
- package/lib/create-vendure-app.js +298 -122
- package/lib/create-vendure-app.js.map +1 -1
- package/lib/gather-user-responses.d.ts +3 -3
- package/lib/gather-user-responses.js +39 -8
- package/lib/gather-user-responses.js.map +1 -1
- package/lib/helpers.d.ts +11 -0
- package/lib/helpers.js +74 -4
- package/lib/helpers.js.map +1 -1
- package/lib/types.d.ts +3 -0
- package/package.json +4 -3
- package/assets/tsconfig.dashboard.template.json +0 -21
package/assets/.env.hbs
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{ name }}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"apps/*"
|
|
7
|
+
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "concurrently -n server,storefront -c blue,magenta \"npm run dev -w server\" \"npm run dev -w storefront\"",
|
|
10
|
+
"dev:server": "npm run dev -w server",
|
|
11
|
+
"dev:storefront": "npm run dev -w storefront",
|
|
12
|
+
"build": "npm run build -w server && npm run build -w storefront",
|
|
13
|
+
"build:server": "npm run build -w server",
|
|
14
|
+
"build:storefront": "npm run build -w storefront",
|
|
15
|
+
"start": "concurrently -n server,storefront -c blue,magenta \"npm run start -w server\" \"npm run start -w storefront\"",
|
|
16
|
+
"start:server": "npm run start -w server",
|
|
17
|
+
"start:storefront": "npm run start -w storefront"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"concurrently": "^9.0.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# {{ name }}
|
|
2
|
+
|
|
3
|
+
A full-stack e-commerce application built with [Vendure](https://www.vendure.io/) and [Next.js](https://nextjs.org/).
|
|
4
|
+
|
|
5
|
+
## Project Structure
|
|
6
|
+
|
|
7
|
+
This is a monorepo using npm workspaces:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{{ name }}/
|
|
11
|
+
├── apps/
|
|
12
|
+
│ ├── server/ # Vendure backend (GraphQL API, Admin Dashboard)
|
|
13
|
+
│ └── storefront/ # Next.js frontend
|
|
14
|
+
└── package.json # Root workspace configuration
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
### Development
|
|
20
|
+
|
|
21
|
+
Start both the server and storefront in development mode:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or run them individually:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Start only the server
|
|
31
|
+
npm run dev:server
|
|
32
|
+
|
|
33
|
+
# Start only the storefront
|
|
34
|
+
npm run dev:storefront
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Access Points
|
|
38
|
+
|
|
39
|
+
- **Vendure Dashboard**: http://localhost:{{ serverPort }}/dashboard
|
|
40
|
+
- **Shop GraphQL API**: http://localhost:{{ serverPort }}/shop-api
|
|
41
|
+
- **Admin GraphQL API**: http://localhost:{{ serverPort }}/admin-api
|
|
42
|
+
- **Storefront**: http://localhost:{{ storefrontPort }}
|
|
43
|
+
|
|
44
|
+
### Admin Credentials
|
|
45
|
+
|
|
46
|
+
Use these credentials to log in to the Vendure Dashboard:
|
|
47
|
+
|
|
48
|
+
- **Username**: {{ superadminIdentifier }}
|
|
49
|
+
- **Password**: {{ superadminPassword }}
|
|
50
|
+
|
|
51
|
+
## Production Build
|
|
52
|
+
|
|
53
|
+
Build all packages:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Start the production server:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm run start
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Learn More
|
|
66
|
+
|
|
67
|
+
- [Vendure Documentation](https://docs.vendure.io)
|
|
68
|
+
- [Next.js Documentation](https://nextjs.org/docs)
|
|
69
|
+
- [Vendure Discord Community](https://vendure.io/community)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/gql": [
|
|
9
|
+
"./src/gql/graphql.ts"
|
|
10
|
+
],
|
|
11
|
+
"@/vdb/*": [
|
|
12
|
+
"{{#if isMonorepo}}../../{{/if}}./node_modules/@vendure/dashboard/src/lib/*"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"include": [
|
|
17
|
+
"src/plugins/**/dashboard/*",
|
|
18
|
+
"src/gql/**/*.ts",
|
|
19
|
+
"vite.*.*ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -16,7 +16,7 @@ export default defineConfig({
|
|
|
16
16
|
// and custom fields that are configured.
|
|
17
17
|
vendureConfigPath: pathToFileURL('./src/vendure-config.ts'),
|
|
18
18
|
// Points to the location of your Vendure server.
|
|
19
|
-
api: { host: 'http://localhost', port:
|
|
19
|
+
api: { host: 'http://localhost', port: {{ port }} },
|
|
20
20
|
// When you start the Vite server, your Admin API schema will
|
|
21
21
|
// be introspected and the types will be generated in this location.
|
|
22
22
|
// These types can be used in your dashboard extensions to provide
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
export declare const REQUIRED_NODE_VERSION = ">=
|
|
1
|
+
export declare const REQUIRED_NODE_VERSION = ">=20.0.0";
|
|
2
2
|
export declare const SERVER_PORT = 3000;
|
|
3
|
+
export declare const STOREFRONT_PORT = 3001;
|
|
4
|
+
export declare const STOREFRONT_REPO = "vendure-ecommerce/nextjs-starter-vendure";
|
|
5
|
+
export declare const STOREFRONT_BRANCH = "main";
|
|
3
6
|
/**
|
|
4
7
|
* The TypeScript version needs to pinned because minor versions often
|
|
5
8
|
* introduce breaking changes.
|
|
6
9
|
*/
|
|
7
10
|
export declare const TYPESCRIPT_VERSION = "5.8.2";
|
|
11
|
+
export declare const PORT_SCAN_RANGE = 20;
|
|
12
|
+
export declare const SCAFFOLD_DELAY_MS = 500;
|
|
13
|
+
export declare const TIP_INTERVAL_MS = 10000;
|
|
14
|
+
export declare const CI_PAUSE_BEFORE_CLOSE_MS = 30000;
|
|
15
|
+
export declare const CI_PAUSE_AFTER_CLOSE_MS = 10000;
|
|
16
|
+
export declare const NORMAL_PAUSE_BEFORE_CLOSE_MS = 2000;
|
|
17
|
+
export declare const AUTO_RUN_DELAY_MS = 10000;
|
|
18
|
+
export declare const DEFAULT_PROJECT_VERSION = "0.1.0";
|
|
19
|
+
export declare const TIPS_WHILE_WAITING: string[];
|
package/lib/constants.js
CHANGED
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TYPESCRIPT_VERSION = exports.SERVER_PORT = exports.REQUIRED_NODE_VERSION = void 0;
|
|
4
|
-
exports.REQUIRED_NODE_VERSION = '>=
|
|
3
|
+
exports.TIPS_WHILE_WAITING = exports.DEFAULT_PROJECT_VERSION = exports.AUTO_RUN_DELAY_MS = exports.NORMAL_PAUSE_BEFORE_CLOSE_MS = exports.CI_PAUSE_AFTER_CLOSE_MS = exports.CI_PAUSE_BEFORE_CLOSE_MS = exports.TIP_INTERVAL_MS = exports.SCAFFOLD_DELAY_MS = exports.PORT_SCAN_RANGE = exports.TYPESCRIPT_VERSION = exports.STOREFRONT_BRANCH = exports.STOREFRONT_REPO = exports.STOREFRONT_PORT = exports.SERVER_PORT = exports.REQUIRED_NODE_VERSION = void 0;
|
|
4
|
+
exports.REQUIRED_NODE_VERSION = '>=20.0.0';
|
|
5
5
|
exports.SERVER_PORT = 3000;
|
|
6
|
+
exports.STOREFRONT_PORT = 3001;
|
|
7
|
+
exports.STOREFRONT_REPO = 'vendure-ecommerce/nextjs-starter-vendure';
|
|
8
|
+
exports.STOREFRONT_BRANCH = 'main';
|
|
6
9
|
/**
|
|
7
10
|
* The TypeScript version needs to pinned because minor versions often
|
|
8
11
|
* introduce breaking changes.
|
|
9
12
|
*/
|
|
10
13
|
exports.TYPESCRIPT_VERSION = '5.8.2';
|
|
14
|
+
// Port scanning
|
|
15
|
+
exports.PORT_SCAN_RANGE = 20;
|
|
16
|
+
// Timing constants (milliseconds)
|
|
17
|
+
exports.SCAFFOLD_DELAY_MS = 500;
|
|
18
|
+
exports.TIP_INTERVAL_MS = 10000;
|
|
19
|
+
exports.CI_PAUSE_BEFORE_CLOSE_MS = 30000;
|
|
20
|
+
exports.CI_PAUSE_AFTER_CLOSE_MS = 10000;
|
|
21
|
+
exports.NORMAL_PAUSE_BEFORE_CLOSE_MS = 2000;
|
|
22
|
+
exports.AUTO_RUN_DELAY_MS = 10000;
|
|
23
|
+
// Default project values
|
|
24
|
+
exports.DEFAULT_PROJECT_VERSION = '0.1.0';
|
|
25
|
+
exports.TIPS_WHILE_WAITING = [
|
|
26
|
+
'☕ This can take a minute or two, so grab a coffee',
|
|
27
|
+
`✨ We'd love it if you drop us a star on GitHub: https://github.com/vendure-ecommerce/vendure`,
|
|
28
|
+
`📖 Check out the Vendure documentation at https://docs.vendure.io`,
|
|
29
|
+
`💬 Join our Discord community to chat with other Vendure developers: https://vendure.io/community`,
|
|
30
|
+
'💡 In the mean time, here are some tips to get you started',
|
|
31
|
+
`Vendure provides dedicated GraphQL APIs for both the Admin and Shop`,
|
|
32
|
+
`Almost every aspect of Vendure is customizable via plugins`,
|
|
33
|
+
`You can run 'vendure add' from the command line to add new plugins & features`,
|
|
34
|
+
`Use the EventBus in your plugins to react to events in the system`,
|
|
35
|
+
`Vendure supports multiple languages & currencies out of the box`,
|
|
36
|
+
`☕ Did we mention this can take a while?`,
|
|
37
|
+
`Our custom fields feature allows you to add any kind of data to your entities`,
|
|
38
|
+
`Vendure is built with TypeScript, so you get full type safety`,
|
|
39
|
+
`Combined with GraphQL's static schema, your type safety is end-to-end`,
|
|
40
|
+
`☕ Almost there now... thanks for your patience!`,
|
|
41
|
+
`Collections allow you to group products together`,
|
|
42
|
+
`Our AssetServerPlugin allows you to dynamically resize & optimize images`,
|
|
43
|
+
`Order flows are fully customizable to suit your business requirements`,
|
|
44
|
+
`Role-based permissions allow you to control access to every part of the system`,
|
|
45
|
+
`Customers can be grouped for targeted promotions & custom pricing`,
|
|
46
|
+
`You can find integrations in the Vendure Hub: https://vendure.io/hub`,
|
|
47
|
+
];
|
|
11
48
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,UAAU,CAAC;AACnC,QAAA,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,UAAU,CAAC;AACnC,QAAA,WAAW,GAAG,IAAI,CAAC;AACnB,QAAA,eAAe,GAAG,IAAI,CAAC;AACvB,QAAA,eAAe,GAAG,0CAA0C,CAAC;AAC7D,QAAA,iBAAiB,GAAG,MAAM,CAAC;AACxC;;;GAGG;AACU,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAE1C,gBAAgB;AACH,QAAA,eAAe,GAAG,EAAE,CAAC;AAElC,kCAAkC;AACrB,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACxB,QAAA,eAAe,GAAG,KAAM,CAAC;AACzB,QAAA,wBAAwB,GAAG,KAAM,CAAC;AAClC,QAAA,uBAAuB,GAAG,KAAM,CAAC;AACjC,QAAA,4BAA4B,GAAG,IAAK,CAAC;AACrC,QAAA,iBAAiB,GAAG,KAAM,CAAC;AAExC,yBAAyB;AACZ,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAClC,QAAA,kBAAkB,GAAG;IAC9B,mDAAmD;IACnD,8FAA8F;IAC9F,mEAAmE;IACnE,mGAAmG;IACnG,4DAA4D;IAC5D,qEAAqE;IACrE,4DAA4D;IAC5D,+EAA+E;IAC/E,mEAAmE;IACnE,iEAAiE;IACjE,yCAAyC;IACzC,+EAA+E;IAC/E,+DAA+D;IAC/D,uEAAuE;IACvE,iDAAiD;IACjD,kDAAkD;IAClD,0EAA0E;IAC1E,uEAAuE;IACvE,gFAAgF;IAChF,mEAAmE;IACnE,sEAAsE;CACzE,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { CliLogLevel } from './types';
|
|
2
|
-
export declare function createVendureApp(name: string | undefined,
|
|
2
|
+
export declare function createVendureApp(name: string | undefined, _useNpm: boolean, // Deprecated: npm is now the default package manager
|
|
3
|
+
logLevel: CliLogLevel, isCi?: boolean, withStorefront?: boolean): Promise<void>;
|