@farm.js/create-app 0.1.0-beta.77 → 0.1.0-beta.79
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/README.md +3 -3
- package/bin/create-farm-app.js +1 -1
- package/dist/index.js +3 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/templates/_renderers/preact/package.json +2 -2
- package/templates/_renderers/solid/package.json +2 -2
- package/templates/_renderers/svelte/package.json +2 -2
- package/templates/_renderers/vue/package.json +2 -2
- package/templates/auth/README.md +1 -1
- package/templates/auth/package.json +3 -3
- package/templates/basic/package.json +2 -2
- package/templates/better-auth/README.md +1 -1
- package/templates/better-auth/package.json +3 -3
- package/templates/react-compiler/README.md +1 -1
- package/templates/react-compiler/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Create a new FARMJS application
|
|
|
5
5
|
FARMJS is currently in beta.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta my-app --template basic
|
|
8
|
+
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta my-app --template basic
|
|
9
9
|
cd my-app
|
|
10
10
|
pnpm dev
|
|
11
11
|
```
|
|
@@ -19,7 +19,7 @@ within the last 24 hours. Pass `--skip-install` when you only want to generate t
|
|
|
19
19
|
Choose React, Preact, Solid, Vue, or Svelte for the Basic and Better Auth starters:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta my-app --template better-auth --renderer solid
|
|
22
|
+
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta my-app --template better-auth --renderer solid
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
React remains the default when `--renderer` is omitted. The interactive Basic and Better Auth
|
|
@@ -43,7 +43,7 @@ home page, and setup documentation. Better Auth has renderer-native UI for all f
|
|
|
43
43
|
other integration templates currently use React. For example:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta stripe-app --template stripe
|
|
46
|
+
pnpm --config.minimumReleaseAge=0 create @farm.js/app@beta stripe-app --template stripe
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
See the [FARMJS repository](https://github.com/farming-labs/farm.js) for documentation, examples, and support.
|
package/bin/create-farm-app.js
CHANGED
|
@@ -15,7 +15,7 @@ program
|
|
|
15
15
|
"Rendering library to use (react, preact, solid, vue, or svelte)",
|
|
16
16
|
)
|
|
17
17
|
.option("--list-templates", "List all available starter templates")
|
|
18
|
-
.option("--typescript", "
|
|
18
|
+
.option("--typescript", "TypeScript is included by default (deprecated)")
|
|
19
19
|
.option("--skip-install", "Skip installing dependencies")
|
|
20
20
|
.action(async (projectName, options) => {
|
|
21
21
|
try {
|
package/dist/index.js
CHANGED
|
@@ -3150,20 +3150,6 @@ async function createApp(projectName, options = {}) {
|
|
|
3150
3150
|
require_utils.logger.error(`The "${template}" starter currently targets React. Use --template basic or --template better-auth with --renderer ${renderer}.`);
|
|
3151
3151
|
process.exit(1);
|
|
3152
3152
|
}
|
|
3153
|
-
let useTypeScript = options.typescript;
|
|
3154
|
-
if (useTypeScript === void 0) {
|
|
3155
|
-
const response = await (0, prompts.default)({
|
|
3156
|
-
type: "confirm",
|
|
3157
|
-
name: "typescript",
|
|
3158
|
-
message: "Would you like to use TypeScript?",
|
|
3159
|
-
initial: true
|
|
3160
|
-
});
|
|
3161
|
-
if (response.typescript === void 0) {
|
|
3162
|
-
require_utils.logger.error("Operation cancelled.");
|
|
3163
|
-
process.exit(1);
|
|
3164
|
-
}
|
|
3165
|
-
useTypeScript = response.typescript;
|
|
3166
|
-
}
|
|
3167
3153
|
const projectPath = path.default.resolve(process.cwd(), projectName);
|
|
3168
3154
|
const packageManager = detectPackageManager();
|
|
3169
3155
|
if (await directoryHasFiles(projectPath)) {
|
|
@@ -3179,7 +3165,7 @@ async function createApp(projectName, options = {}) {
|
|
|
3179
3165
|
}
|
|
3180
3166
|
require_utils.logger.info(`Creating FARMJS app in ${projectPath}`);
|
|
3181
3167
|
await fs_promises.default.mkdir(projectPath, { recursive: true });
|
|
3182
|
-
const integrationResult = await copyTemplate(template, projectPath,
|
|
3168
|
+
const integrationResult = await copyTemplate(template, projectPath, renderer);
|
|
3183
3169
|
await updatePackageJson(projectPath, projectName, packageManager);
|
|
3184
3170
|
require_utils.logger.success(`🚜 Created ${projectName}`);
|
|
3185
3171
|
if (!options.skipInstall) {
|
|
@@ -3205,18 +3191,14 @@ async function createApp(projectName, options = {}) {
|
|
|
3205
3191
|
template,
|
|
3206
3192
|
renderer,
|
|
3207
3193
|
packageManager: packageManager.name,
|
|
3208
|
-
typescript:
|
|
3194
|
+
typescript: true,
|
|
3209
3195
|
installedDependencies: !options.skipInstall
|
|
3210
3196
|
});
|
|
3211
3197
|
}
|
|
3212
|
-
async function copyTemplate(template, projectPath,
|
|
3198
|
+
async function copyTemplate(template, projectPath, renderer) {
|
|
3213
3199
|
const details = templateDetails[template];
|
|
3214
3200
|
await copyDir(path.default.join(__dirname, "..", "templates", details?.integration ? "basic" : template), projectPath);
|
|
3215
3201
|
const basePackageJson = await readPackageJson(projectPath);
|
|
3216
|
-
if (useTypeScript) {
|
|
3217
|
-
const tsTemplatePath = path.default.join(__dirname, "..", "templates", "_typescript");
|
|
3218
|
-
if (await dirExists(tsTemplatePath)) await copyDir(tsTemplatePath, projectPath);
|
|
3219
|
-
}
|
|
3220
3202
|
if (renderer !== "react") {
|
|
3221
3203
|
await applyRendererTemplate(projectPath, renderer, basePackageJson);
|
|
3222
3204
|
const integrationRendererPath = getRendererIntegrationTemplatePath(template, renderer);
|