-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from neuralinterfaces/v0.0.54
0.0.54 Release
- Loading branch information
Showing
33 changed files
with
507 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.DS_Store | ||
node_modules | ||
|
||
_site | ||
|
||
.commoners | ||
.site | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
], | ||
}, | ||
} | ||
} | ||
``` --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.