Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
flipvh committed Oct 16, 2024
2 parents a97513b + 2ae4c2d commit 49b39e5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cli/create-cella/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cellajs/create-cella",
"version": "0.0.4",
"version": "0.0.5",
"private": false,
"license": "MIT",
"description": "Create your own app in seconds with Cella: a TypeScript template for local-first web apps.",
Expand Down
5 changes: 3 additions & 2 deletions cli/create-cella/src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ export async function create({
const relativePath = relative(originalCwd, targetFolder);

console.info('now go to your project using:')
console.info(colors.cyan(` cd ./${relativePath}`)); // Adding './' to make it clear it's a relative path
console.info(colors.cyan(` cd ${relativePath}`)); // Adding './' to make it clear it's a relative path
console.info()
}
console.info(`${needsCd ? 'then ' : ''}quick start with:`)
console.info(colors.cyan(` ${packageManager} quick`))
console.info()

console.info('Read the readme in project root for more info on how to get started!')
console.info('Check out the readme to get started: /README.md')
console.info(`Enjoy building ${projectName} using cella! 🎉`)
console.info()
}
16 changes: 8 additions & 8 deletions cli/sync-cella/src/diverged.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function diverged({
localBranch,
}) {
const targetFolder = process.cwd()
console.log();
console.info();

// Fetch upstream changes and checkout local branch
await fetchUpstream({ localBranch });
Expand Down Expand Up @@ -104,14 +104,14 @@ export async function diverged({
await rm(divergedFile, { force: true });
}

console.log()
console.info()

// Log each diverged file line by line for clickable paths in VSCode
filteredFiles.forEach((file) => console.log(`./${file}`));
filteredFiles.forEach((file) => console.info(`./${file}`));

console.log()
console.log(`Found ${colors.blue(filteredFiles.length)} diverged files between the upstream and local branch.`);
console.log()
console.log(`${colors.green('✔')} Completed the diverged command.`);
console.log()
console.info()
console.info(`Found ${colors.blue(filteredFiles.length)} diverged files between the upstream and local branch.`);
console.info()
console.info(`${colors.green('✔')} Completed the diverged command.`);
console.info()
}
2 changes: 1 addition & 1 deletion cli/sync-cella/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { diverged } from './diverged.js'
import { mergeUpstream } from './merge-upstream.js'

async function main() {
console.log(CELLA_TITLE);
console.info(CELLA_TITLE);

const targetFolder = process.cwd()

Expand Down
8 changes: 4 additions & 4 deletions cli/sync-cella/src/merge-upstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function mergeUpstream({
localBranch,
}) {
const targetFolder = process.cwd()
console.log();
console.info();

// Fetch upstream changes and checkout local branch
await fetchUpstream({ localBranch });
Expand Down Expand Up @@ -88,7 +88,7 @@ export async function mergeUpstream({
}
} else {
ignoreSpinner.warning('No ignore list or ignore file found. Proceeding without ignoring files.');
console.log(`${colors.yellow('Skipped')} reset/checkout as no files are ignored.`);
console.info(`${colors.yellow('Skipped')} reset/checkout as no files are ignored.`);
}

// Check for merge conflicts
Expand Down Expand Up @@ -132,6 +132,6 @@ export async function mergeUpstream({
process.exit(1);
}

console.log(`${colors.green('Success')} Merged upstream changes into local branch ${localBranch}.`);
console.log()
console.info(`${colors.green('Success')} Merged upstream changes into local branch ${localBranch}.`);
console.info()
}
6 changes: 3 additions & 3 deletions info/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Quickstart
This document describes how to develop your own app based on Cella, after forking it.
This document describes how to develop your own app based on Cella.

Also read the [architecture](./ARCHITECTURE.md) info.

Expand All @@ -19,7 +19,7 @@ pnpm quick


## Cella CLI
Currently, Cella CLI is limited to creating a project (which you already used), listing diverged files and pulling upstream changes. Both commands will use your config in cella.config.js.
Currently, Cella CLI is limited to creating a cella project, listing diverged files and pulling upstream changes. Config can be found in cella.config.js.

### 1. List diverged
Receive a list of files that have diverged from cella itself. The files you have ignored in cella.config.js will not be listed.
Expand All @@ -29,7 +29,7 @@ pnpm diverged
```

### 2. Pull upstream
Pull upstream changes from cella. Changes in files that are ignored will automatically be undone, to reduce conflicts.
Pull upstream changes from cella. Changes in files that are in the cella ignore list will automatically be undone, to reduce conflicts.

```bash
pnpm run upstream:pull
Expand Down
7 changes: 6 additions & 1 deletion prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ dotenv.config({ path: './backend/.env' });
// Install lefthook as part of prepare script
if (process.env.NODE_ENV === 'development') {
console.info('Installing lefthook & Biome VSCode extension.');
execSync('lefthook install && code --install-extension biomejs.biome', { stdio: 'inherit' });

try {
execSync('lefthook install && code --install-extension biomejs.biome', { stdio: 'inherit' });
} catch (error) {
console.error('Error occurred during the prepare script:', error.message);
}
} else {
console.info('Not in development. Skipping prepare script.');
process.exit(0);
Expand Down

0 comments on commit 49b39e5

Please sign in to comment.