Skip to content

Commit

Permalink
ci(monorepo): Resolve issue with invalid pnpm version parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Sep 13, 2024
1 parent 3ebd79a commit 20632a0
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.14.0
22.4.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
tag: ${{ inputs.tag }}
packageManager: pnpm
packageManagerVersion: 9.6.0
packageManagerVersion: 9.10.0
stormBot: Stormie-Bot
githubToken: ${{ github.token }}
secrets: inherit
24 changes: 15 additions & 9 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ pre-commit:
# stage_fixed: true
lint-toml:
glob: "**/*.toml"
run: 'pnpm exec taplo format --check
run:
'pnpm exec taplo format --check
--config="./node_modules/@storm-software/linting-tools/taplo/.taplo.toml"'
lint-filename:
glob: "**/*.*"
run: 'pnpm exec ls-lint
run:
'pnpm exec ls-lint
--config="./node_modules/@storm-software/linting-tools/ls-lint/ls-lint.yml"'

commit-msg:
commands:
validate:
run: 'pnpm exec commitlint
run:
'pnpm exec commitlint
--config="./node_modules/@storm-software/git-tools/commitlint/commitlint.config.cjs"
--edit {1}'

Expand All @@ -63,21 +66,24 @@ pre-push:
stage_fixed: true
format-prettier:
glob: "!packages/workspace-tools/src/generators/*/files/**/*"
run: "pnpm exec prettier {staged_files} --write --ignore-unknown
run:
"pnpm exec prettier {staged_files} --write --ignore-unknown
--no-error-on-unmatched-pattern --cache && git update-index"
stage_fixed: true
format-toml:
glob: "**/*.toml"
run: 'pnpm exec taplo format
--config="./node_modules/@storm-software/linting-tools/taplo/.taplo.toml" && git
update-index'
run:
'pnpm exec taplo format
--config="./node_modules/@storm-software/linting-tools/taplo/.taplo.toml"
&& git update-index'
format-readme:
glob: "**/{README.md,package.json,executors.json,generators.json}"
run: 'pnpm exec storm-git readme-gen --templates="./tools/readme-templates"'
run:
'pnpm exec storm-git readme-gen --templates="./tools/readme-templates"'
stage_fixed: true
build:
glob: "**/*.*"
run: "pnpm build"
run: "pnpm build-all"
stage_fixed: true
validate:
glob: "**/*.*"
Expand Down
6 changes: 6 additions & 0 deletions packages/errors/src/storm-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Serializable } from "@storm-stack/serialization";
import {
EMPTY_STRING,
type Indexable,
MessageType,
NEWLINE_STRING,
isError,
isFunction,
Expand Down Expand Up @@ -169,6 +170,11 @@ export class StormError<TCode extends string = string> extends Error {
*/
public data?: any;

/**
* The type of error message
*/
public type: MessageType = MessageType.ERROR;

/**
* Creates a new StormError instance
*
Expand Down
23 changes: 20 additions & 3 deletions packages/unique-identifier/src/cuid.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*-------------------------------------------------------------------
⚡ Storm Software - Storm Stack
This code was released as part of the Storm Stack project. Storm Stack
is maintained by Storm Software under the Apache-2.0 License, and is
free for commercial and private use. For more information, please visit
our licensing page.
Website: https://stormsoftware.com
Repository: https://github.com/storm-software/storm-stack
Documentation: https://stormsoftware.com/projects/storm-stack/docs
Contact: https://stormsoftware.com/contact
License: https://stormsoftware.com/projects/storm-stack/license
-------------------------------------------------------------------*/

import { hash } from "@storm-stack/hashing";
import { randomLetter } from "./random";

Expand Down Expand Up @@ -33,9 +50,9 @@ function createEntropy(length = 4, random = Math.random) {
let entropy = "";

while (entropy.length < length) {
entropy =
entropy +
Math.floor(random() * CUID_LARGE_LENGTH).toString(CUID_LARGE_LENGTH);
entropy += Math.floor(random() * CUID_LARGE_LENGTH).toString(
CUID_LARGE_LENGTH
);
}
return entropy;
}
Expand Down
17 changes: 17 additions & 0 deletions packages/unique-identifier/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*-------------------------------------------------------------------
⚡ Storm Software - Storm Stack
This code was released as part of the Storm Stack project. Storm Stack
is maintained by Storm Software under the Apache-2.0 License, and is
free for commercial and private use. For more information, please visit
our licensing page.
Website: https://stormsoftware.com
Repository: https://github.com/storm-software/storm-stack
Documentation: https://stormsoftware.com/projects/storm-stack/docs
Contact: https://stormsoftware.com/contact
License: https://stormsoftware.com/projects/storm-stack/license
-------------------------------------------------------------------*/

export * from "./cuid";
export * from "./random";
export * from "./snowflake";
Expand Down
17 changes: 17 additions & 0 deletions packages/unique-identifier/src/random.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*-------------------------------------------------------------------
⚡ Storm Software - Storm Stack
This code was released as part of the Storm Stack project. Storm Stack
is maintained by Storm Software under the Apache-2.0 License, and is
free for commercial and private use. For more information, please visit
our licensing page.
Website: https://stormsoftware.com
Repository: https://github.com/storm-software/storm-stack
Documentation: https://stormsoftware.com/projects/storm-stack/docs
Contact: https://stormsoftware.com/contact
License: https://stormsoftware.com/projects/storm-stack/license
-------------------------------------------------------------------*/

const alphabet = Array.from({ length: 26 }, (_x, i) =>
String.fromCodePoint(i + 97)
);
Expand Down
21 changes: 19 additions & 2 deletions packages/unique-identifier/src/snowflake.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*-------------------------------------------------------------------
⚡ Storm Software - Storm Stack
This code was released as part of the Storm Stack project. Storm Stack
is maintained by Storm Software under the Apache-2.0 License, and is
free for commercial and private use. For more information, please visit
our licensing page.
Website: https://stormsoftware.com
Repository: https://github.com/storm-software/storm-stack
Documentation: https://stormsoftware.com/projects/storm-stack/docs
Contact: https://stormsoftware.com/contact
License: https://stormsoftware.com/projects/storm-stack/license
-------------------------------------------------------------------*/

/**
* Options passed to the `generate` function to create a snowflake identifier.
*/
Expand Down Expand Up @@ -145,8 +162,8 @@ export function snowflake({
: new Date(timestamp).valueOf();

let result = (BigInt(timestamp) - BigInt(epoch)) << BigInt(22);
result = result | (BigInt(shardId % 1024) << BigInt(12));
result = result | BigInt(sequence++ % 4096);
result |= BigInt(shardId % 1024) << BigInt(12);
result |= BigInt(sequence++ % 4096);

return result.toString();
}
Expand Down
17 changes: 17 additions & 0 deletions packages/unique-identifier/src/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*-------------------------------------------------------------------
⚡ Storm Software - Storm Stack
This code was released as part of the Storm Stack project. Storm Stack
is maintained by Storm Software under the Apache-2.0 License, and is
free for commercial and private use. For more information, please visit
our licensing page.
Website: https://stormsoftware.com
Repository: https://github.com/storm-software/storm-stack
Documentation: https://stormsoftware.com/projects/storm-stack/docs
Contact: https://stormsoftware.com/contact
License: https://stormsoftware.com/projects/storm-stack/license
-------------------------------------------------------------------*/

let index = 256;
const hex = [] as string[];
let buffer!: number[];
Expand Down

0 comments on commit 20632a0

Please sign in to comment.