File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,32 @@ jobs:
142142 rsync -av --delete ${{ env.RSYNC_SITECORE_UPLOAD_API_SRC_EXCLUDES }} ../upload-api/src/ ./upload-api/src/
143143 rsync -av --delete ../upload-api/migration-sitecore/ ./upload-api/migration-sitecore/
144144
145+ # Ensure tsconfig.json exists, create a default one if missing
146+ if [ ! -f "tsconfig.json" ]; then
147+ echo "Creating default tsconfig.json..."
148+ cat <<EOL > tsconfig.json
149+ {
150+ "compilerOptions": {
151+ "target": "ES6",
152+ "module": "CommonJS",
153+ "strict": true,
154+ "esModuleInterop": true,
155+ "skipLibCheck": true,
156+ "forceConsistentCasingInFileNames": true
157+ },
158+ "include": ["src/**/*"],
159+ "exclude": ["node_modules", "dist"]
160+ }
161+ EOL
162+ fi
163+
164+ # Remove unused imports
145165 npx ts-remove-unused-imports
146- npx ts-prune | awk '{print $1}' | xargs sed -i '' -e '/import/d'
166+
167+ # Remove missing imports
168+ npx ts-prune | awk '{print $1}' | xargs -I {} sed -i '/import/d' {}
169+
170+ # Format code
147171 npx prettier --write .
148172
149173 git add .
You can’t perform that action at this time.
0 commit comments