├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ ├── npm-publish-canary.yml │ ├── npm-publish-stable.yml │ ├── tests.yml │ ├── trunk-nightly.yml │ └── trunk-pr.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .trunk ├── .gitignore ├── config │ ├── .markdownlint.yaml │ └── svgo.config.js └── trunk.yaml ├── LICENSE ├── README.md ├── babel.config.js ├── bun.lockb ├── cli ├── .gitignore ├── .npmignore ├── README.md ├── lib │ └── postbuild.js ├── out │ └── bin.js ├── package.json ├── rollup.config.js ├── src │ ├── fsManagement.ts │ ├── helpers.ts │ ├── lib │ │ ├── templates.ts │ │ └── types.ts │ ├── main.ts │ ├── templates.ts │ └── update.ts ├── yarn-error.log └── yarn.lock ├── docs ├── .gitignore ├── README.md ├── babel.config.js ├── blog │ ├── 04-05-2022_first-release.mdx │ └── authors.yml ├── docs │ ├── api-reference │ │ ├── ApiInstance.mdx │ │ ├── CollectionData.mdx │ │ ├── CollectionGroup.mdx │ │ ├── CollectionInstance.mdx │ │ ├── CollectionSelector.mdx │ │ ├── ComputedStateInstance.mdx │ │ ├── ControllerInstance.mdx │ │ ├── EventInstance.mdx │ │ ├── PlexusActionHelpers.mdx │ │ ├── PlexusController.mdx │ │ ├── PlexusInstance.mdx │ │ ├── Plugin.mdx │ │ ├── Scope.mdx │ │ ├── StateInstance.mdx │ │ ├── _category_.json │ │ ├── action.mdx │ │ ├── api.mdx │ │ ├── batch.mdx │ │ ├── batchAction.mdx │ │ ├── collection.mdx │ │ ├── computed.mdx │ │ ├── event.mdx │ │ ├── getInstanceName.mdx │ │ ├── getPlexusInstance.mdx │ │ ├── getPlexusMasterInstance.mdx │ │ ├── gql.mdx │ │ ├── instance.mdx │ │ ├── onCatch.mdx │ │ ├── preaction.mdx │ │ ├── state.mdx │ │ ├── storage.mdx │ │ ├── useDeposit.mdx │ │ ├── usePlexus.mdx │ │ └── usePlexusState.mdx │ ├── getting-started │ │ ├── _category_.json │ │ ├── concepts.mdx │ │ ├── installation.mdx │ │ └── states.mdx │ ├── intro.mdx │ ├── plexus-api │ │ ├── _category_.json │ │ └── usage.mdx │ ├── style-guides │ │ ├── _category_.json │ │ ├── basic.mdx │ │ ├── examples │ │ │ ├── _category_.json │ │ │ └── ex_preactions.mdx │ │ └── scalable.mdx │ └── use-cases │ │ ├── _category_.json │ │ ├── api-requests.mdx │ │ ├── data-persistance.mdx │ │ ├── events.mdx │ │ └── ssot.mdx ├── docusaurus.config.js ├── package.json ├── postcss.config.js ├── sidebars.js ├── src │ ├── components │ │ ├── Badges.tsx │ │ ├── Collapse.tsx │ │ ├── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── MenuOption.tsx │ │ ├── ScrollContainer.tsx │ │ └── TypescriptInfo.tsx │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.module.css │ │ ├── index.tsx │ │ └── markdown-page.md ├── static │ ├── .nojekyll │ ├── font │ │ ├── silka │ │ │ ├── generator_config.txt │ │ │ ├── silka-black-webfont.eot │ │ │ ├── silka-black-webfont.ttf │ │ │ ├── silka-black-webfont.woff │ │ │ ├── silka-black-webfont.woff2 │ │ │ ├── silka-bold-webfont.eot │ │ │ ├── silka-bold-webfont.ttf │ │ │ ├── silka-bold-webfont.woff │ │ │ ├── silka-bold-webfont.woff2 │ │ │ ├── silka-extralight-webfont.eot │ │ │ ├── silka-extralight-webfont.ttf │ │ │ ├── silka-extralight-webfont.woff │ │ │ ├── silka-extralight-webfont.woff2 │ │ │ ├── silka-light-webfont.eot │ │ │ ├── silka-light-webfont.ttf │ │ │ ├── silka-light-webfont.woff │ │ │ ├── silka-light-webfont.woff2 │ │ │ ├── silka-medium-webfont.eot │ │ │ ├── silka-medium-webfont.ttf │ │ │ ├── silka-medium-webfont.woff │ │ │ ├── silka-medium-webfont.woff2 │ │ │ ├── silka-regular-webfont.eot │ │ │ ├── silka-regular-webfont.ttf │ │ │ ├── silka-regular-webfont.woff │ │ │ ├── silka-regular-webfont.woff2 │ │ │ ├── silka-semibold-webfont.eot │ │ │ ├── silka-semibold-webfont.ttf │ │ │ ├── silka-semibold-webfont.woff │ │ │ ├── silka-semibold-webfont.woff2 │ │ │ ├── silka-thin-webfont.eot │ │ │ ├── silka-thin-webfont.ttf │ │ │ ├── silka-thin-webfont.woff │ │ │ ├── silka-thin-webfont.woff2 │ │ │ ├── specimen_files │ │ │ │ ├── grid_12-825-55-15.css │ │ │ │ └── specimen_stylesheet.css │ │ │ └── stylesheet.css │ │ └── strawford │ │ │ ├── generator_config.txt │ │ │ ├── strawford-black-webfont.eot │ │ │ ├── strawford-black-webfont.ttf │ │ │ ├── strawford-black-webfont.woff │ │ │ ├── strawford-black-webfont.woff2 │ │ │ ├── strawford-bold-webfont.eot │ │ │ ├── strawford-bold-webfont.ttf │ │ │ ├── strawford-bold-webfont.woff │ │ │ ├── strawford-bold-webfont.woff2 │ │ │ ├── strawford-extralight-webfont.eot │ │ │ ├── strawford-extralight-webfont.ttf │ │ │ ├── strawford-extralight-webfont.woff │ │ │ ├── strawford-extralight-webfont.woff2 │ │ │ ├── strawford-light-webfont.eot │ │ │ ├── strawford-light-webfont.ttf │ │ │ ├── strawford-light-webfont.woff │ │ │ ├── strawford-light-webfont.woff2 │ │ │ ├── strawford-medium-webfont.eot │ │ │ ├── strawford-medium-webfont.ttf │ │ │ ├── strawford-medium-webfont.woff │ │ │ ├── strawford-medium-webfont.woff2 │ │ │ ├── strawford-regular-webfont.eot │ │ │ ├── strawford-regular-webfont.ttf │ │ │ ├── strawford-regular-webfont.woff │ │ │ ├── strawford-regular-webfont.woff2 │ │ │ ├── strawford-thin-webfont.eot │ │ │ ├── strawford-thin-webfont.ttf │ │ │ ├── strawford-thin-webfont.woff │ │ │ ├── strawford-thin-webfont.woff2 │ │ │ └── stylesheet.css │ ├── img │ │ ├── Grayscale Transparent.png │ │ ├── GrayscaleTransparent.svg │ │ ├── OriginalLogo.png │ │ ├── OriginalLogo.svg │ │ ├── OriginalLogoSymbol.png │ │ ├── TransparentLogo.png │ │ ├── TransparentLogo.svg │ │ ├── TransparentLogo_thin.svg │ │ ├── favicon.ico │ │ ├── favicon_backup.ico │ │ └── tutorial │ │ │ ├── docsVersionDropdown.png │ │ │ └── localeDropdown.png │ └── robots.txt ├── tailwind.config.js ├── tsconfig.json └── yarn.lock ├── jsdoc2md.json ├── lerna.json ├── nodemon.json ├── nx.json ├── package.json ├── packages ├── plexus-api │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── api.ts │ │ ├── index.ts │ │ └── types.ts │ └── tsconfig.json ├── plexus-core │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── action.ts │ │ ├── collection │ │ │ ├── collection.ts │ │ │ ├── data.ts │ │ │ ├── group.ts │ │ │ ├── index.ts │ │ │ └── selector.ts │ │ ├── computed.ts │ │ ├── event.ts │ │ ├── gql.ts │ │ ├── helpers.ts │ │ ├── index.ts │ │ ├── instance │ │ │ ├── controller.ts │ │ │ ├── engine.ts │ │ │ ├── index.ts │ │ │ ├── instance.ts │ │ │ └── runtime.ts │ │ ├── plugin.ts │ │ ├── preaction.ts │ │ ├── scheduler │ │ │ ├── index.ts │ │ │ ├── scheduler.ts │ │ │ └── task.ts │ │ ├── scope.ts │ │ ├── state.ts │ │ ├── storage.ts │ │ ├── types.ts │ │ └── watchable.ts │ ├── tsconfig.json │ └── v2 │ │ ├── README.md │ │ ├── index.ts │ │ └── types.ts ├── plexus-napi │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── plexus-next │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── plexus-react │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── useDeposit.ts │ │ ├── useEvent.ts │ │ ├── useLoader.ts │ │ ├── usePlexus.ts │ │ ├── usePlexusElementEffect.ts │ │ ├── usePlexusQuery.tsx │ │ ├── usePlexusState.ts │ │ ├── useWatcher.ts │ │ └── utils.ts │ └── tsconfig.json ├── plexus-solid │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── plexus-utils │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── client │ │ │ ├── error.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── server │ │ │ ├── extractenv.ts │ │ │ └── index.ts │ │ ├── shared │ │ │ ├── index.ts │ │ │ └── itemManipulation.ts │ │ └── types.ts │ └── tsconfig.json ├── plexus-vue │ └── .npmignore └── tsconfig.shared.json ├── project.json ├── scripts └── templates │ ├── all-docs │ ├── all-docs.hbs │ └── docs │ │ ├── body │ │ ├── access.hbs │ │ ├── augments.hbs │ │ ├── authors.hbs │ │ ├── body.hbs │ │ ├── category.hbs │ │ ├── chainable.hbs │ │ ├── copyright.hbs │ │ ├── customTags.hbs │ │ ├── default.hbs │ │ ├── deprecated.hbs │ │ ├── description.hbs │ │ ├── examples.hbs │ │ ├── fires.hbs │ │ ├── implements.hbs │ │ ├── license.hbs │ │ ├── mixes.hbs │ │ ├── overrides.hbs │ │ ├── params │ │ │ ├── param-table-name.hbs │ │ │ ├── params-list.hbs │ │ │ ├── params-table-html.hbs │ │ │ ├── params-table.hbs │ │ │ └── params.hbs │ │ ├── properties │ │ │ ├── properties-list.hbs │ │ │ ├── properties-table-html.hbs │ │ │ ├── properties-table.hbs │ │ │ └── properties.hbs │ │ ├── readOnly.hbs │ │ ├── requires.hbs │ │ ├── returns.hbs │ │ ├── scope.hbs │ │ ├── see.hbs │ │ ├── since.hbs │ │ ├── summary.hbs │ │ ├── this.hbs │ │ ├── throws.hbs │ │ ├── todo.hbs │ │ └── version.hbs │ │ ├── docs.hbs │ │ ├── header.hbs │ │ ├── member-index │ │ ├── member-index-grouped.hbs │ │ ├── member-index-list.hbs │ │ └── member-index.hbs │ │ └── members.hbs │ ├── fn.hbs │ ├── main-index │ ├── global-index │ │ ├── global-index-dl.hbs │ │ ├── global-index-grouped.hbs │ │ ├── global-index-kinds.hbs │ │ ├── global-index-table.hbs │ │ └── global-index.hbs │ ├── main-index.hbs │ └── module-index │ │ ├── module-index-dl.hbs │ │ ├── module-index-grouped.hbs │ │ ├── module-index-table.hbs │ │ └── module-index.hbs │ ├── main.hbs │ ├── ref.hbs │ └── shared │ ├── heading-indent.hbs │ ├── index-indent.hbs │ ├── separator.hbs │ ├── signature │ ├── sig-link-html.hbs │ ├── sig-link-parent.hbs │ ├── sig-link.hbs │ └── sig-name.hbs │ └── value │ ├── defaultvalue.hbs │ ├── link.hbs │ └── linked-type-list.hbs ├── tests ├── action.test.ts ├── api.test.ts ├── basic.test.ts ├── collection.test.ts ├── computed.test.ts ├── controller.test.ts ├── edgecases.test.tsx ├── efficiency.test.ts ├── engine.test.ts ├── event.test.ts ├── instance.test.ts ├── objectUtils.test.ts ├── preactions.test.ts ├── react.test.tsx ├── scope.test.ts ├── state.test.ts ├── storage.test.ts ├── test-utils.tsx ├── timed.test.ts ├── tsconfig.json └── utils.tests.tsx ├── tsconfig.test.json ├── vite.config.ts ├── vitest.config.ts ├── webpack.config.js ├── write-documentation.ts └── yarn.lock /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'yarn' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'weekly' 12 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_dispatch: 4 | workflow_call: 5 | jobs: 6 | build: 7 | name: Build 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: oven-sh/setup-bun@v1 12 | with: 13 | bun-version: latest 14 | - uses: actions/setup-node@v3 15 | with: 16 | node-version: 18 17 | 18 | - name: 💾 Fetch Cache 19 | id: cache-yarn 20 | uses: actions/cache@v3 21 | env: 22 | cache-name: cache-node-modules 23 | with: 24 | path: | 25 | ~/.cache/yarn 26 | node_modules 27 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }} 28 | restore-keys: | 29 | ${{ runner.os }}-yarn- 30 | - if: steps.cache-yarn.outputs.cache-hit != 'true' 31 | name: 📦 Install Dependencies 32 | env: 33 | NO_YARN_POSTINSTALL: 1 34 | run: bun install --frozen-lockfile 35 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish-canary.yml: -------------------------------------------------------------------------------- 1 | name: NPM Package Publish - Canary 2 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 3 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 4 | 5 | on: 6 | release: 7 | types: [created] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | uses: PlexusJS/plexus/.github/workflows/build.yml@canary 13 | 14 | publish-gpr: 15 | needs: build 16 | runs-on: ubuntu-latest 17 | permissions: 18 | contents: read 19 | packages: write 20 | steps: 21 | - uses: actions/checkout@v3 22 | - uses: oven-sh/setup-bun@v1 23 | with: 24 | bun-version: latest 25 | - uses: actions/setup-node@v3 26 | with: 27 | node-version: 16 28 | registry-url: https://npm.pkg.github.com/ 29 | - name: Cache node modules 30 | id: cache-yarn 31 | uses: actions/cache@v3 32 | env: 33 | cache-name: cache-node-modules 34 | with: 35 | path: | 36 | ~/.cache/yarn 37 | node_modules 38 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }} 39 | restore-keys: | 40 | ${{ runner.os }}-yarn- 41 | - if: steps.cache-yarn.outputs.cache-hit != 'true' 42 | name: 📦 Install Dependencies 43 | env: 44 | NO_YARN_POSTINSTALL: 1 45 | run: yarn install --frozen-lockfile --ignore-scripts 46 | 47 | - run: yarn publish-canary 48 | env: 49 | NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}} 50 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | concurrency: 3 | group: ${{ github.head_ref || github.run_id }} 4 | cancel-in-progress: false 5 | on: 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | test: 11 | name: 🧪 Test 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: oven-sh/setup-bun@v1 16 | with: 17 | bun-version: latest 18 | - uses: actions/setup-node@v3 19 | with: 20 | node-version: 18 21 | - name: Cache node modules 22 | id: cache-yarn 23 | uses: actions/cache@v2 24 | env: 25 | cache-name: cache-node-modules 26 | with: 27 | path: | 28 | ~/.cache/yarn 29 | node_modules 30 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }} 31 | restore-keys: | 32 | ${{ runner.os }}-yarn- 33 | - if: steps.cache-yarn.outputs.cache-hit != 'true' 34 | name: 📦 Install Dependencies 35 | run: yarn install --frozen-lockfile 36 | 37 | - name: 🔨 Build 38 | run: yarn build 39 | 40 | - name: 🧪 Test 41 | run: yarn test 42 | -------------------------------------------------------------------------------- /.github/workflows/trunk-nightly.yml: -------------------------------------------------------------------------------- 1 | name: Trunk Nightly 2 | concurrency: 3 | group: ${{ github.head_ref || github.run_id }} 4 | cancel-in-progress: false 5 | 6 | on: 7 | schedule: 8 | - cron: 0 8 * * 1-5 9 | workflow_dispatch: {} 10 | 11 | jobs: 12 | trunk_check: 13 | name: Trunk Check Runner 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v3 19 | - uses: oven-sh/setup-bun@v1 20 | with: 21 | bun-version: latest 22 | 23 | - name: Cache node modules 24 | id: cache-yarn 25 | uses: actions/cache@v3 26 | env: 27 | cache-name: cache-node-modules 28 | with: 29 | path: | 30 | ~/.cache/yarn 31 | node_modules 32 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }} 33 | restore-keys: | 34 | ${{ runner.os }}-yarn- 35 | 36 | - if: steps.cache-yarn.outputs.cache-hit != 'true' 37 | name: 📦 Install Dependencies 38 | env: 39 | NOYARNPOSTINSTALL: 1 40 | run: yarn install --frozen-lockfile 41 | 42 | - name: Trunk Check 43 | uses: trunk-io/trunk-action@v1 44 | with: 45 | trunk-token: ${{ secrets.TRUNK_TOKEN }} 46 | -------------------------------------------------------------------------------- /.github/workflows/trunk-pr.yml: -------------------------------------------------------------------------------- 1 | name: Trunk - Pull Request 2 | concurrency: 3 | group: ${{ github.head_ref || github.run_id }} 4 | cancel-in-progress: false 5 | 6 | jobs: 7 | trunk_check: 8 | name: Trunk Check Runner 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | - uses: oven-sh/setup-bun@v1 15 | with: 16 | bun-version: latest 17 | 18 | - name: Cache node modules 19 | id: cache-yarn 20 | uses: actions/cache@v3 21 | env: 22 | cache-name: cache-node-modules 23 | with: 24 | path: | 25 | ~/.cache/yarn 26 | node_modules 27 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }} 28 | restore-keys: | 29 | ${{ runner.os }}-yarn- 30 | - if: steps.cache-yarn.outputs.cache-hit != 'true' 31 | name: 📦 Install Dependencies 32 | run: yarn install --frozen-lockfile 33 | 34 | - name: Trunk Check 35 | uses: trunk-io/trunk-action@v1 36 | with: 37 | trunk-token: ${{ secrets.TRUNK_TOKEN }} 38 | 39 | on: 40 | [pull_request] 41 | # branches: 42 | # - main 43 | # - dev 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | .turbo 4 | .vscode 5 | dist 6 | packages/*.js 7 | __snapshots__ 8 | *.tsbuildinfo 9 | *.tgz 10 | *.log 11 | .DS_Store 12 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | 2 | public 3 | *.hbs 4 | node_modules 5 | .docusaurus 6 | out 7 | dist -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": false, 5 | "singleQuote": true, 6 | "jsxSingleQuote": true, 7 | "useTabs": true, 8 | "overrides": [ 9 | { 10 | "files": ["*.yml", "*.yaml"], 11 | "options": { 12 | "tabWidth": 2, 13 | "useTabs": false 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.trunk/.gitignore: -------------------------------------------------------------------------------- 1 | *out 2 | *logs 3 | *actions 4 | *notifications 5 | *tools 6 | plugins 7 | user_trunk.yaml 8 | user.yaml 9 | -------------------------------------------------------------------------------- /.trunk/config/.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Autoformatter friendly markdownlint config (all formatting rules disabled) 2 | default: true 3 | blank_lines: false 4 | bullet: false 5 | html: false 6 | indentation: false 7 | line_length: false 8 | spaces: false 9 | url: false 10 | whitespace: false 11 | -------------------------------------------------------------------------------- /.trunk/config/svgo.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | { 4 | name: 'preset-default', 5 | params: { 6 | overrides: { 7 | removeViewBox: false, // https://github.com/svg/svgo/issues/1128 8 | sortAttrs: true, 9 | removeOffCanvasPaths: true, 10 | }, 11 | }, 12 | }, 13 | ], 14 | } 15 | -------------------------------------------------------------------------------- /.trunk/trunk.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | cli: 3 | version: 1.17.1 4 | plugins: 5 | sources: 6 | - id: trunk 7 | ref: v1.2.1 8 | uri: https://github.com/trunk-io/plugins 9 | lint: 10 | threshold: 11 | - linters: [ALL] 12 | level: high 13 | enabled: 14 | - git-diff-check 15 | - markdownlint@0.35.0 16 | - gitleaks@8.17.0 17 | - prettier@3.0.0 18 | - actionlint@1.6.25 19 | ignore: 20 | - linters: [ALL] 21 | paths: 22 | - packages/**/dist/**/* 23 | - node_modules 24 | - .docusaurus/**/* 25 | runtimes: 26 | enabled: 27 | - go@1.19.5 28 | - node@18.12.1 29 | actions: 30 | disabled: 31 | - trunk-fmt-pre-commit 32 | enabled: 33 | - trunk-announce 34 | - trunk-check-pre-push 35 | - trunk-upgrade-available 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 PlexusJS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PlexusJS - A state orchestrator library for reactive applications 2 | 3 | [![npm version](https://badge.fury.io/js/@plexusjs%2Fcore.svg)](https://badge.fury.io/js/@plexusjs%2Fcore) 4 | ![npm monthly downloads](https://img.shields.io/npm/dw/@plexusjs/core?style=flat) 5 | ![npm total downloads](https://img.shields.io/npm/dt/@plexusjs/core?style=flat) 6 | ![bundle size](https://img.shields.io/bundlephobia/min/@plexusjs/core?style=flat) 7 | ![License](https://img.shields.io/npm/l/@plexusjs/core?style=flat) 8 | 9 | [![Join the Plexus Discord](https://discordapp.com/api/guilds/941858479793123358/embed.png)](https://discord.gg/kWJ2kVnykH) 10 | [![Follow Plexus on Twitter](https://img.shields.io/twitter/follow/plexusjs?color=%09%231DA1F2&logo=Twitter&logoColor=%09%231DA1F2&style=flat)](https://twitter.com/plexusjs) 11 | 12 | ## Getting Started 🚀 13 | 14 | - [Documentation](https://plexusjs.org) 15 | - [Official Discord Server](https://discord.gg/m2VmArU6WP) 16 | 17 | ## Sponsors 🫀 18 | 19 | 20 | 21 | 22 | 23 | ## Used by 🤝 24 | 25 | > overhaul of this section in progress 26 | 27 | ## Links & Socials 🔗 28 | 29 | - [Npm Org](https://www.npmjs.com/org/plexusjs) 30 | - [Official Discord Server](https://discord.gg/m2VmArU6WP) 31 | - [Twitter](https://twitter.com/plexusjs) 32 | 33 | # Core 34 | 35 | ## Quick Setup 36 | 37 | With Yarn 38 | 39 | ```bash prefix="$" 40 | yarn create plexus-core --typescript --next --template=scalable 41 | ``` 42 | 43 | With NPX 44 | 45 | ```bash 46 | npx create-plexus-core --typescript --next --template=scalable 47 | ``` 48 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | ['@babel/preset-env', { targets: { node: 'current' }, loose: false }], 4 | '@babel/preset-typescript', 5 | '@babel/preset-react', 6 | ], 7 | } 8 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlexusJS/plexus/bfc3c08321afca69242f0e82043c3b4483722302/bun.lockb -------------------------------------------------------------------------------- /cli/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | core -------------------------------------------------------------------------------- /cli/.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | lib -------------------------------------------------------------------------------- /cli/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlexusJS/plexus/bfc3c08321afca69242f0e82043c3b4483722302/cli/README.md -------------------------------------------------------------------------------- /cli/lib/postbuild.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import chalk from 'chalk' 3 | import fs from 'fs' 4 | 5 | const upperScriptTag = '#!/usr/bin/env node' 6 | 7 | const path = './out/bin.js' 8 | if (fs.existsSync(path)) { 9 | console.log(chalk.green('Found bin.js file...')) 10 | 11 | const binContent = fs.readFileSync(path, 'utf8') 12 | 13 | if (binContent.includes(upperScriptTag)) { 14 | console.log( 15 | chalk.green('bin.js file already has the correct script tag...') 16 | ) 17 | } else { 18 | console.log( 19 | chalk.yellow('bin.js file does not have the correct script tag...') 20 | ) 21 | console.log(chalk.green('Adding script tag to bin.js file...')) 22 | fs.writeFileSync(path, upperScriptTag + '\n' + binContent) 23 | console.log(chalk.green('bin.js file updated!')) 24 | } 25 | } else { 26 | console.log(chalk.red('bin.js file not found...')) 27 | } 28 | -------------------------------------------------------------------------------- /cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plexus-cli", 3 | "author": "Philippe Clesca ", 4 | "license": "MIT", 5 | "version": "1.8.0", 6 | "bin": "./out/bin.js", 7 | "main": "./out/bin.js", 8 | "type": "module", 9 | "private": false, 10 | "scripts": { 11 | "precli:build": "rm -rf ./out/bin.js", 12 | "build": "rollup --config ./rollup.config.js", 13 | "postbuild": "bun ./lib/postbuild.js", 14 | "preexecute": "bun build", 15 | "execute": "bunx .", 16 | "prepublish": "bun build", 17 | "publish-stable": "yarn publish", 18 | "local-install": "bun build && npm link" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/PlexusJS/plexus.git", 23 | "directory": "cli" 24 | }, 25 | "dependencies": { 26 | "@plexusjs/core": "^1.7.4", 27 | "chalk": "^5.0.1", 28 | "glob": "^10.2.6", 29 | "yargs": "^17.4.1" 30 | }, 31 | "devDependencies": { 32 | "@rollup/plugin-typescript": "^10.0.1", 33 | "@types/node": "^20.2.5", 34 | "rollup": "^2.72.1", 35 | "tslib": "^2.4.1" 36 | }, 37 | "gitHead": "1c75ea589f9be8be7cf0886875c89f3dce6c00f3" 38 | } 39 | -------------------------------------------------------------------------------- /cli/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from '@rollup/plugin-typescript' 2 | 3 | export default { 4 | input: 'src/main.ts', 5 | output: { 6 | file: 'out/bin.js', 7 | format: 'es', 8 | }, 9 | plugins: [typescript()], 10 | } 11 | -------------------------------------------------------------------------------- /cli/src/fsManagement.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk' 2 | import { lookForCore, tryIt } from './helpers' 3 | import { mkdirSync, writeFileSync } from 'fs' 4 | import { TEMPLATES } from './lib/templates' 5 | import yArgs from 'yargs' 6 | const yargs = yArgs(process.argv) 7 | const __dirname = process.cwd() 8 | 9 | export const genFileOrDir = (arr, path = '/core') => { 10 | if (!Array.isArray(arr)) { 11 | return false 12 | } 13 | if (typeof path !== 'string') { 14 | return false 15 | } 16 | 17 | for (let obj of arr) { 18 | const fileName = `${obj.name}.${obj.ext || 'js'}` 19 | let filePath = `${path}/${fileName}` 20 | let status = 'writing...' 21 | // if we are creating a file 22 | if (obj.type === 'file') { 23 | process.stdout.write( 24 | `Creating ${chalk.cyan(`"${path}/${fileName}"`)}... ::` 25 | ) 26 | tryIt(() => writeFileSync(`${__dirname}${filePath}`, obj.content)) 27 | ? process.stdout.write(chalk.green(`Success!\n`)) 28 | : process.stdout.write(chalk.yellow(`Failure!\n`)) 29 | } 30 | // if we are creating a directory 31 | else if (obj.type === 'dir') { 32 | process.stdout.write( 33 | `Creating ${chalk.cyan(`"${path}/${obj.name}/"`)}... ::` 34 | ) 35 | tryIt(() => mkdirSync(`${__dirname}${path}/${obj.name}`)) 36 | ? process.stdout.write(chalk.green(`Success\n`)) 37 | : process.stdout.write(chalk.yellow(`Failed\n`)) 38 | // recurse into the directory 39 | genFileOrDir(obj.content, `${path}/${obj.name}`) 40 | } 41 | } 42 | return true 43 | } 44 | 45 | export const genFiles = (template = 'basic') => { 46 | // check if the template string is one of the available templates 47 | if (![...Object.keys(TEMPLATES)].includes(template)) { 48 | console.error(`Template ${template} not found.`) 49 | return false 50 | } 51 | // make the core directory in the root folder 52 | lookForCore() 53 | 54 | // copy the core files to the core directory 55 | // const structRaw = fs.readFileSync(`./data/${template}.json`, { encoding: 'utf8' }) 56 | 57 | // const struct = JSON.parse(structRaw) 58 | const struct = TEMPLATES[template] 59 | 60 | if (yargs.argv.typescript || yargs.argv.ts) { 61 | console.log(chalk.bgWhite.black('Creating TS Files...')) 62 | genFileOrDir(struct?.$schema?.ts) 63 | } else { 64 | console.log(chalk.bgWhite.black('Creating JS Files...')) 65 | genFileOrDir(struct?.$schema?.js) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /cli/src/helpers.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from 'child_process' 2 | import * as fs from 'fs' 3 | const __dirname = process.cwd() 4 | 5 | export function tryIt(fn: (...args: any[]) => T): T | boolean { 6 | try { 7 | if (fn instanceof Function) { 8 | const val = fn() 9 | if (val !== undefined && val !== null) { 10 | return val 11 | } 12 | } 13 | return true 14 | } catch (e) { 15 | return false 16 | } 17 | } 18 | // make the core directory in the root folder 19 | export const lookForCore = () => 20 | tryIt( 21 | () => 22 | !fs.existsSync(`${__dirname}/core`) && fs.mkdirSync(`${__dirname}/core`) 23 | ) 24 | export const lookForCoreModules = () => 25 | tryIt( 26 | () => 27 | !fs.existsSync(`${__dirname}/core/modules`) && 28 | fs.mkdirSync(`${__dirname}/core/modules`) 29 | ) 30 | 31 | // fetch the most recent version of the packages given the tag using the cli command `npm view @plexusjs/core version` 32 | export const fetchLatestVersion = (tag: 'canary' | 'latest') => 33 | execSync(`npm view @plexusjs/core@${tag} version`, { 34 | encoding: 'utf8', 35 | }).trim() 36 | -------------------------------------------------------------------------------- /cli/src/lib/types.ts: -------------------------------------------------------------------------------- 1 | export interface PackageJson { 2 | name: string 3 | version: string 4 | description?: string 5 | keywords?: string[] 6 | homepage?: string 7 | bugs?: { 8 | url: string 9 | email?: string 10 | } 11 | license?: string 12 | author?: 13 | | string 14 | | { 15 | name: string 16 | email?: string 17 | url?: string 18 | } 19 | contributors?: 20 | | string[] 21 | | { 22 | name: string 23 | email?: string 24 | url?: string 25 | }[] 26 | files?: string[] 27 | main?: string 28 | browser?: string 29 | types?: string 30 | module?: string 31 | exports?: { 32 | [key: string]: 33 | | string 34 | | { 35 | [key: string]: string 36 | } 37 | } 38 | scripts?: { 39 | [key: string]: string 40 | } 41 | dependencies?: { 42 | [key: string]: string 43 | } 44 | devDependencies?: { 45 | [key: string]: string 46 | } 47 | peerDependencies?: { 48 | [key: string]: string 49 | } 50 | peerDependenciesMeta?: { 51 | [key: string]: { 52 | optional?: boolean 53 | } 54 | } 55 | optionalDependencies?: { 56 | [key: string]: string 57 | } 58 | engines?: { 59 | node?: string 60 | npm?: string 61 | } 62 | os?: string[] 63 | cpu?: string[] 64 | private?: boolean 65 | publishConfig?: { 66 | access?: 'public' | 'restricted' 67 | registry?: string 68 | tag?: string 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /cli/src/main.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk' 2 | import yArgs from 'yargs' 3 | import * as fs from 'fs' 4 | // import { execSync } from 'child_process' 5 | // import { TEMPLATES } from './lib/templates' 6 | // import { fetchLatestVersion, lookForCore, tryIt } from './helpers' 7 | // import { updatePackageJsons } from './update' 8 | import { genFiles } from './fsManagement' 9 | import { installPlexus } from './update' 10 | // import { genFileOrDir } from './fsManagement' 11 | 12 | const yargs = yArgs(process.argv) 13 | const __dirname = process.cwd() 14 | 15 | const helpString = ` 16 | Usage: 17 | $ npx plexus-cli 18 | 19 | Commands: 20 | 21 | module Create a new module in your plexus core 22 | update Update your plexus install 23 | 24 | Options: 25 | --yarn Use Yarn as the package manager 26 | --bun Use Bun as the package manager 27 | --canary Use the canary version of plexus 28 | --dev Use the dev version of plexus 29 | --skip-install Skip the install of the PlexusJS packages 30 | --typescript Create TypeScript files 31 | --react Install the React package 32 | --next Install the Next package 33 | --template=