Skip to content

Commit

Permalink
tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaiking committed Dec 2, 2023
1 parent 5792bef commit 093f59a
Show file tree
Hide file tree
Showing 42 changed files with 16,300 additions and 16,224 deletions.
24 changes: 12 additions & 12 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
env:
node: true
commonjs: true
jest: true
es6: true
node: true
commonjs: true
jest: true
es6: true
extends: "eslint:recommended"
overrides:
- env:
node: true
files:
- ".eslintrc.{js,cjs}"
parserOptions:
sourceType: "script"
- env:
node: true
files:
- ".eslintrc.{js,cjs}"
parserOptions:
sourceType: "script"
parserOptions:
ecmaVersion: "latest"
ecmaVersion: "latest"
ignorePatterns:
- "examples/*"
- "examples/*"
70 changes: 35 additions & 35 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
name: Lint Code Base

on:
pull_request:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
lint:
name: Lint Code Base
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
statuses: write
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile
- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile

- name: Lint Code Base
id: super-linter
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.yml
VALIDATE_JSCPD: false
VALIDATE_ALL_CODEBASE: false
VALIDATE_CSS: false
- name: Lint Code Base
id: super-linter
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.yml
VALIDATE_JSCPD: false
VALIDATE_ALL_CODEBASE: false
VALIDATE_CSS: false
46 changes: 23 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Publish Package to npmjs
on:
release:
types: [published]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
registry-url: "https://registry.npmjs.org"
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile
- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile

- name: Publish to npm
id: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish to npm
id: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
38 changes: 19 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Run Tests

on:
- push
- push

jobs:
test:
name: Execute Tests
runs-on: ubuntu-latest
test:
name: Execute Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn

- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile
- name: Install Dependencies
id: install
run: yarn install --frozen-lockfile

- name: Execute Test Tools
run: yarn test
- name: Execute Test Tools
run: yarn test
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tabWidth: 4
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Then, create a new folder with the following structure:
- (any folder structure)
```

- The `apps` folder is where you store your apps. Each app has its own folder, and each app folder has a `bos.config.json` file.
- The `apps/{appname}/widget` folder is where you store your widgets. You can have any folder structure inside the `widget` folder.
- The `jsonc` files under `apps/{appname}` folder are used to create a data.json, that is used to store data under SocialDB.
- The `modules` folder is where you store your modules. You can have any folder structure inside the `modules` folder.
- The `apps` folder is where you store your apps. Each app has its own folder, and each app folder has a `bos.config.json` file.
- The `apps/{appname}/widget` folder is where you store your widgets. You can have any folder structure inside the `widget` folder.
- The `jsonc` files under `apps/{appname}` folder are used to create a data.json, that is used to store data under SocialDB.
- The `modules` folder is where you store your modules. You can have any folder structure inside the `modules` folder.

### Commands

Expand Down Expand Up @@ -73,8 +73,8 @@ For example:

Replacements:

- `/*__@replace:something__*/` to `abc`
- `<Widget src="/*__@replace:nui__*//widget/Button" />` to `<Widget src="nui.sking.near/widget/Button" />`
- `/*__@replace:something__*/` to `abc`
- `<Widget src="/*__@replace:nui__*//widget/Button" />` to `<Widget src="nui.sking.near/widget/Button" />`

### 3. **Module Importing**

Expand Down Expand Up @@ -105,15 +105,15 @@ The `data.json` file will appear as follows:

```json
{
"something": "unchanged content of something.txt",
"types": {
"ui": {
"imageType": "Stringified JSON content of imageType.jsonc"
"something": "unchanged content of something.txt",
"types": {
"ui": {
"imageType": "Stringified JSON content of imageType.jsonc"
}
},
"widget": {
"Button.metadata": "Stringified JSON content of Button.metadata.jsonc"
}
},
"widget": {
"Button.metadata": "Stringified JSON content of Button.metadata.jsonc"
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions bin/bos-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
const { run_cli } = require("..");

run_cli({}).catch((error) => {
console.error(error);
process.exitCode = 1;
console.error(error);
process.exitCode = 1;
});
8 changes: 4 additions & 4 deletions examples/HelloWorld/apps/Hello/bos.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"appAccount": "dummy.near",
"aliases": {
"hello": "<h1>Hello, world! Have a nice day!</h1>"
}
"appAccount": "dummy.near",
"aliases": {
"hello": "<h1>Hello, world! Have a nice day!</h1>"
}
}
2 changes: 1 addition & 1 deletion examples/HelloWorld/apps/Hello/dummydata/dummy.jsonc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*__@noStringify__*/
{
"dummy": "dummy goes here from dummy land, dummy"
"dummy": "dummy goes here from dummy land, dummy"
}
4 changes: 2 additions & 2 deletions examples/HelloWorld/modules/hello.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hello = () => {
console.log("Hello!");
console.log("Hello!");

return "Hello!";
return "Hello!";
};
2 changes: 1 addition & 1 deletion gateway/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["@babel/env", "@babel/preset-react"]
"presets": ["@babel/env", "@babel/preset-react"]
}
6 changes: 3 additions & 3 deletions gateway/config/flags.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const flags = {
bosLoaderUrl: process.env.BOS_LOADER_URL || "http://127.0.0.1:4040",
bosLoaderWs: process.env.BOS_LOADER_WS || "ws://127.0.0.1:4040",
enableHotReload: process.env.ENABLE_HOT_RELOAD ?? true,
bosLoaderUrl: process.env.BOS_LOADER_URL || "http://127.0.0.1:4040",
bosLoaderWs: process.env.BOS_LOADER_WS || "ws://127.0.0.1:4040",
enableHotReload: process.env.ENABLE_HOT_RELOAD ?? true,
};
8 changes: 4 additions & 4 deletions gateway/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const publicPath = path.resolve(__dirname, "../public");
const nodeModulesPath = path.resolve(__dirname, "../node_modules");

module.exports = {
srcPath,
distPath,
publicPath,
nodeModulesPath,
srcPath,
distPath,
publicPath,
nodeModulesPath,
};
14 changes: 7 additions & 7 deletions gateway/config/presets/loadPreset.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { merge } = require("webpack-merge");

const loadPresets = (env = { presets: [] }) => {
const presets = env.presets || [];
/** @type {string[]} */
const mergedPresets = [].concat(...[presets]);
const mergedConfigs = mergedPresets.map((presetName) =>
require(`./webpack.${presetName}.js`)(env),
);
const presets = env.presets || [];
/** @type {string[]} */
const mergedPresets = [].concat(...[presets]);
const mergedConfigs = mergedPresets.map((presetName) =>
require(`./webpack.${presetName}.js`)(env),
);

return merge({}, ...mergedConfigs);
return merge({}, ...mergedConfigs);
};
module.exports = loadPresets;
4 changes: 2 additions & 2 deletions gateway/config/presets/webpack.analyze.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const WebpackBundleAnalyzer =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

module.exports = () => ({
plugins: [new WebpackBundleAnalyzer()],
plugins: [new WebpackBundleAnalyzer()],
});
Loading

0 comments on commit 093f59a

Please sign in to comment.