Skip to content

Commit

Permalink
Merge pull request #16 from neuralinterfaces/v0.0.54
Browse files Browse the repository at this point in the history
0.0.54 Release
  • Loading branch information
garrettmflynn authored Dec 1, 2024
2 parents 5e96640 + 250f1e2 commit 8f790e1
Show file tree
Hide file tree
Showing 33 changed files with 507 additions and 251 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
node_modules

_site

.commoners
.site

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Follow the prompts to select your favorite framework and features.
After running `npm install`, add Commoners as a dependency:

```bash
npm install -D [email protected].53
npm install -D [email protected].54
```

## Configuring the `package.json` File
Expand Down
14 changes: 8 additions & 6 deletions docs/guide/build-automation.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Build Automation
Using GitHub Actions, you can automatically build and publish your application to web, desktop, and mobile platforms.

## Web
A template workflow for publishing your application to GitHub Pages is provided in the [Commoners Starter Kit](https://github.com/neuralinterfaces/commoners-starter-kit/blob/main/.github/workflows/Build-and-deploy-pwa.yml) repository.

## Desktop
To allow `electron-builder` to publish to a private repository, add the following entry to the relevant `.github/workflows` files:
A set of template workflow for publishing your application to GitHub Releases is provided in the [Commoners Starter Kit](https://github.com/neuralinterfaces/commoners-starter-kit/blob/main/.github/workflows) repository.

This includes separate workflows for Windows, macOS, and Linux.

```yaml
permissions:
contents: write

```
## Mobile
Coming soon...
210 changes: 206 additions & 4 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,207 @@
# Config
Coming soon...
# Configuration
> **Note:** A `commoners.config.[ts|js]` file is required for proper resolution of [Plugins](../guide/plugins), which cannot be used with an inline configuration file loaded into the `@commoners/solidarity` API.
> **Note:** A `commoners.config.[ts|js]` file is required for proper resolution of [Plugins](../guide/plugins), which cannot be used purely with the `@commoners/solidarity` API.
The `commoners.config` file is used to configure your application's services, plugins, and more.

This is merged with the `package.json` file (e.g. `name`, `version`, etc.) to resolve the final configuration of your application.

## Common Configuration Options
### Name
The `name` property defines the name of your application. This value is used as the default `<title>` of your application and as the Electron application name.

```js
export default {
name: 'My App',
}
```

### Icon
The `icon` property defines the path to the icon of your application. This value is used as the default `<link rel="shortcut icon">` of your application and as the Electron application icon.

```js
export default {
icon: './assets/vite.png',
}
```

### Pages
The `pages` property defines the pages of your application. This value is a proxy for `vite.build.rollupOptions.input` and specifies which HTML files in your application should be built.

```js
export default {
pages: {
index: './src/index.html',
about: './src/about.html',
},
}
```


### Plugins
The `plugins` property defines the plugins of your application. This value is used to configure the plugins of your application.

```js
export default {
plugins: {
'commoners-plugin': {
load: () => {
console.log('Plugin loaded!')
}
},
},
}
```

More information on plugins can be found in the [Plugins](../guide/plugins) documentation.

### Services
The `services` property defines the services of your application. This value is used to configure the services of your application.

```js
export default {
services: {
node: './src/services/server.ts',
},
}
```

More information on services can be found in the [Services](../guide/services) documentation.

### Target
The `target` property defines the target of your application. This value is used to **change the default type of application** for the development and build commands.

```js
export default {
target: 'desktop',
}
```

## Additional Properties
### Output Directory
The `outDir` property defines the output directory of your application. This value is used as the immediate location for any build artifacts.

> **Note:** Left unspecified, the application output directory is automatically defined as a `target`-specific subdirectory in the `.commoners` directory.
```js
export default {
outDir: 'dist',
}
```

The `outDir` property can also be specified for each build using the `--outDir` flag in the `build` command.

```sh
commoners build --outDir dist
```

### App ID
The `appId` property defines the unique identifier of your application. This value is used as the default `appId` of your application and as the Electron application identifier.

```js
export default {
appId: 'com.example.myapp',
}
```

If not specified, the `appId` is generated from the `name` property.

### Port
The `port` property defines the port of your application when using the `start` or `launch` command for the `web` target.

```js
export default {
target: 'desktop',
outDir: 'dist',
port: 3000
}
```

### Build
The `build` property defines the build options of your application that aren't covered by the standard configuration.

```js
export default {
target: 'desktop',
outDir: 'dist',
build: {
publish: true,
sign: false
},
}
```

These can also be specified for each build using the `--publish` and `--sign` flags in the `build` command.

```sh
commoners build --publish --no-sign
```


### Electron
The `electron` property defines the Electron options of your application. This value is used to configure the Electron options of your application.

```js
export default {
electron: {
nodeIntegration: true
window: {
width: 800,
height: 600,
}
},
}
```

### Vite
The `vite` property defines the Vite options of your application. This value is used to configure the Vite options of your application.

```js
export default {
vite: {
server: {
port: 3000,
},
},
}
```

This can also be specified using a `vite.config.js` file in the root of your project, or an alternative configuration file using the `vite` property.

```js
export default {
vite: './config.vite.js',
}
```


<!-- ## PWA
The `pwa` property defines the PWA options of your application. This value is used to configure the PWA options of your application.
```js
export default {
pwa: {
includeAssets: ['favicon.ico'],
manifest: {
name: 'My App',
short_name: 'My App',
theme_color: '#ffffff',
background_color: '#ffffff',
display: 'standalone',
start_url: '/',
icons: [
{
src: '/assets/icons/icon-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/assets/icons/icon-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
}
}
``` -->
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"@commoners/bluetooth": "0.0.52",
"@commoners/custom-protocol": "0.0.52",
"@commoners/serial": "0.0.52",
"@commoners/solidarity": "0.0.53",
"@commoners/solidarity": "0.0.54",
"@commoners/splash-screen": "0.0.52",
"@commoners/testing": "0.0.53",
"@commoners/windows": "0.0.53",
"@commoners/testing": "0.0.54",
"@commoners/windows": "0.0.54",
"@vitest/coverage-v8": "^2.0.3",
"search-insights": "^2.15.0",
"commoners": "0.0.53",
"commoners": "0.0.54",
"vite": "^5.3.4",
"vitepress": "^1.3.1",
"vitest": "^2.0.3"
Expand Down
Loading

0 comments on commit 8f790e1

Please sign in to comment.