Skip to content

Commit

Permalink
Merge pull request #1 from alexwine36/creating-node-packages
Browse files Browse the repository at this point in the history
Creating-node-packages
  • Loading branch information
alexwine36 authored Aug 21, 2024
2 parents 95e42f1 + ecca937 commit 9ea12e3
Show file tree
Hide file tree
Showing 97 changed files with 4,390 additions and 3,716 deletions.
8 changes: 8 additions & 0 deletions .cargo/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[profile.ci]
fail-fast = false
failure-output = "immediate-final"
retries = 1
test-threads = 2

# [profile.default]
# test-threads = 8
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
name: "Pipeline"
name: 'Pipeline'

permissions:
pull-requests: write

on:
push:
branches:
- "main"
- 'main'
pull_request:
jobs:
ci:
name: "CI"
runs-on: "ubuntu-latest"
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: "actions/checkout@v4"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- uses: "moonrepo/setup-toolchain@v0"
- run: "moon ci"
- uses: 'moonrepo/setup-toolchain@v0'
# with:
# auto-install: true
# cache: false

- run: 'moon ci --color'
- uses: appthrust/moon-ci-retrospect@v1
if: success() || failure()
- uses: 'moonrepo/run-report-action@v1'
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# dependencies
/node_modules
node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
Expand Down
24 changes: 24 additions & 0 deletions .moon/tasks/tag-node-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

extends: "./tag-node.yml"

tasks:
# https://moonrepo.dev/docs/guides/examples/packemon
# build:
# command:
# - 'packemon'
# - 'pack'
# - '--addEngines'
# - '--addExports'
# - '--declaration'
# inputs:
# - '@globs(sources)'
# - 'package.json'
# - 'tsconfig.*.json'
build:
command: 'tsup'
inputs:
- '@globs(sources)'
- 'package.json'
- 'tsconfig.*.json'
- 'tsup.config.ts'
49 changes: 26 additions & 23 deletions .moon/node.yml → .moon/tasks/tag-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,30 @@ tasks:
local: true

# https://moonrepo.dev/docs/guides/examples/eslint
# lint:
# command:
# - 'eslint'
# - '--ext'
# - '.ts,.tsx,.cts,.mts,.js,.jsx,.cjs,.mjs'
# - '--fix'
# - '--report-unused-disable-directives'
# - '--no-error-on-unmatched-pattern'
# - '--exit-on-fatal-error'
# - '--ignore-path'
# - '@in(2)'
# - '.'
# inputs:
# - '*.config.*'
# - '**/.eslintrc.*'
# - '/.eslintignore'
# - '/.eslintrc.*'
# - 'tsconfig.json'
# - '/tsconfig.eslint.json'
# - '/tsconfig.options.json'
# - '@group(app)'
# - '@globs(sources)'
# - '@globs(tests)'
lint:
command:
- 'eslint'
# - '--ext'
# - '.ts,.tsx,.cts,.mts,.js,.jsx,.cjs,.mjs'
# - '--fix'
# - '--report-unused-disable-directives'
# - '--no-error-on-unmatched-pattern'
# - '--exit-on-fatal-error'
# - '--ignore-path'
# - '@in(2)'
# - "-c"
# - "eslint.config.mjs"
- '.'
inputs:
- '*.config.*'
- '**/.eslintrc.*'
- '/.eslintrc.*'
- 'tsconfig.json'
# - '/tsconfig.eslint.json'
- '/tsconfig.options.json'
- '@group(app)'
- '@globs(sources)'
- '@globs(tests)'

# https://moonrepo.dev/docs/guides/examples/jest
test:
Expand All @@ -103,6 +104,8 @@ tasks:
command:
- "tsc"
- "--build"
deps:
- '^:build'
inputs:
- "@group(app)"
- "@globs(sources)"
Expand Down
11 changes: 7 additions & 4 deletions .moon/tasks/tag-rust-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ $schema: 'https://moonrepo.dev/schemas/tasks.json'
implicitInputs:
- 'Cargo.toml'

implicitDeps:
- "^:build"

fileGroups:
cargo:
- 'Cargo.toml'
- 'crates/*/src/**/*'
- 'src/**/*'
- 'crates/*/Cargo.toml'
# - '/.cargo/config.toml'

- '/rust-toolchain.toml'
sources: []
tests:
- 'crates/*/benches/**/*'
- 'crates/*/tests/**/*'
- 'benches/**/*'
- 'tests/**/*'

tasks:
cargo:
Expand Down
31 changes: 28 additions & 3 deletions .moon/tasks/tag-rust-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ extends: './tag-rust-base.yml'


tasks:
build: &build
build:
command: 'wasm-pack build'
inputs:
- '@group(cargo)'
- '@group(sources)'
env: &env
CARGO_TERM_COLOR: 'always'

deps:
- "~:build-no-modules"
build-no-modules:
command: 'wasm-pack build --target web --scope no-modules --out-dir no-modules'
inputs:
- '@group(cargo)'
- '@group(sources)'
env: &env
CARGO_TERM_COLOR: 'always'
test-web:
command: 'wasm-pack test --firefox --headless'
inputs:
Expand All @@ -20,6 +28,8 @@ tasks:
- '@group(tests)'
- '/.config/nextest.*'
env: *env
options:
runInCI: false

test-node:
command: "wasm-pack test --node"
Expand All @@ -29,14 +39,29 @@ tasks:
- '@group(tests)'
- '/.config/nextest.*'
env: *env
options:
runInCI: false

test:
command: "noop"
command: 'nextest run'
inputs:
- '@group(cargo)'
- '@group(sources)'
- '@group(tests)'
- '/.config/nextest.*'
env: *env
deps:
- "~:test-web"
- "~:test-node"
options:
runDepsInParallel: false
# test:
# command: "noop"
# deps:
# - "~:test-web"
# - "~:test-node"
# options:
# runDepsInParallel: false

# implicitInputs:
# - 'Cargo.toml'
Expand Down
66 changes: 4 additions & 62 deletions .moon/tasks/tag-rust.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

implicitInputs:
- 'Cargo.toml'

fileGroups:
cargo:
- 'Cargo.toml'
- 'crates/*/src/**/*'
- 'crates/*/Cargo.toml'
# - '/.cargo/config.toml'
- '/rust-toolchain.toml'
sources: []
tests:
- 'crates/*/benches/**/*'
- 'crates/*/tests/**/*'
extends: "./tag-rust-base.yml"

tasks:
cargo:
command: 'cargo'
local: true

tasks:

build: &build
command: 'cargo build'
inputs:
Expand All @@ -33,52 +19,8 @@ tasks:
command: 'cargo build --release'
local: true

check:
command: 'cargo check --workspace --all-targets'
inputs:
- '@group(cargo)'
- '@group(sources)'
- '@group(tests)'
env: *env

dev:
command: 'cargo run'
inputs:
- '@group(cargo)'
- '@group(sources)'
local: true
env: *env

format: &format
command: 'cargo fmt --all --check'
inputs:
- '@group(cargo)'
- '@group(sources)'
- '@group(tests)'
- '/rustfmt.toml'
env: *env

format-write:
<<: *format
command: 'cargo fmt --all -- --emit=files'
local: true

lint: &lint
command: 'cargo clippy --workspace --all-targets'
inputs:
- '@group(cargo)'
- '@group(sources)'
- '@group(tests)'
- '/clippy.toml'
env: *env

lint-fix:
<<: *lint
command: 'cargo clippy --workspace --all-targets --fix --allow-dirty --allow-staged'
local: true

test:
command: 'cargo test --workspace'
command: 'nextest run'
inputs:
- '@group(cargo)'
- '@group(sources)'
Expand Down
12 changes: 9 additions & 3 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ rust:
version: "1.79.0"

# List of Cargo binaries to install globally and make available.
bins: []
bins:
- cargo-insta
- cargo-nextest
- wasm-pack

# List of rustup toolchain components to install and make available.
components: []
components:
- clippy
- rustfmt

# Sync the configured version above as a channel to the root `rust-toolchain.toml` config.
syncToolchainConfig: true

# List of rustup toolchain targets to install and make available.
targets: []
targets:
- wasm32-unknown-unknown
7 changes: 7 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ projects:
vcs:
manager: "git"
defaultBranch: "main"

runner:
archivableTargets:
- ':lint'
- ':test'
- ':typecheck'
logRunningCommand: true
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
coverage/

# Build folders
coverage/
build/
cjs/
dts/
esm/
lib/
mjs/
umd/

.next/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Alex Wine

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Moon Test Repo


3 changes: 3 additions & 0 deletions apps/sample-nextjs/.ereslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next"
}
Loading

0 comments on commit 9ea12e3

Please sign in to comment.