create-aelith-app 0.1.0 → 0.1.1

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/bin/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { spawn } from 'node:child_process'
4
4
  import { existsSync } from 'node:fs'
5
- import { cp, mkdir, readFile, readdir, writeFile } from 'node:fs/promises'
5
+ import { cp, mkdir, readFile, readdir, rename, writeFile } from 'node:fs/promises'
6
6
  import { createInterface } from 'node:readline/promises'
7
7
  import path from 'node:path'
8
8
  import process from 'node:process'
@@ -100,6 +100,15 @@ async function replaceTokensInDirectory(targetDir, replacements) {
100
100
  }
101
101
  }
102
102
 
103
+ async function restoreGitignore(targetDir) {
104
+ const sourcePath = path.join(targetDir, 'gitignore')
105
+ const targetPath = path.join(targetDir, '.gitignore')
106
+
107
+ if (existsSync(sourcePath)) {
108
+ await rename(sourcePath, targetPath)
109
+ }
110
+ }
111
+
103
112
  async function installDependencies(targetDir) {
104
113
  await new Promise((resolve, reject) => {
105
114
  const command = process.platform === 'win32' ? 'npm.cmd' : 'npm'
@@ -137,6 +146,7 @@ async function main() {
137
146
  await ensureTargetDirectory(targetDir)
138
147
  await mkdir(targetDir, { recursive: true })
139
148
  await cp(TEMPLATE_DIR, targetDir, { recursive: true })
149
+ await restoreGitignore(targetDir)
140
150
  await replaceTokensInDirectory(targetDir, {
141
151
  __APP_NAME__: projectDirName,
142
152
  __APP_ID__: appId,
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "create-aelith-app",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI to scaffold a Next.js starter for Aelith authentication.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "create-aelith-app": "./bin/index.js"
8
+ "create-aelith-app": "bin/index.js"
9
9
  },
10
10
  "files": [
11
11
  "bin",
12
12
  "template",
13
13
  "template/.env.example",
14
- "template/.gitignore",
14
+ "template/gitignore",
15
15
  "template/next-env.d.ts",
16
16
  "README.md"
17
17
  ],
File without changes