Skip to content

Commit 499c4e0

Browse files
claudemikebroberts
authored andcommitted
Restructure project to use NPM workspaces
- Create packages/dynamodb-entity-store/ for main package - Add root package.json with workspace configuration - Update examples to reference workspace package - Update GitHub Actions workflows for new structure - All scripts now delegate to workspace packages This prepares the project for adding the testutils package while maintaining the ability to publish the main package.
1 parent 333615a commit 499c4e0

File tree

83 files changed

+227
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+227
-118
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ jobs:
5151

5252
- run: npm install
5353

54-
# Modify package.json, inserting version attribute
55-
- run: npm version $RELEASE_VERSION --no-git-tag-version
54+
# Modify package.json, inserting version attribute in the main package
55+
- run: npm version $RELEASE_VERSION --no-git-tag-version --workspace=@symphoniacloud/dynamodb-entity-store
5656

5757
# Perform publish with appropriate tag and provenance, which will also run prepublishOnly
5858
# Uses npm provenance (OIDC) instead of long-lived token for security
59-
- run: npm publish --access public --provenance --tag ${{ steps.dist-tag.outputs.tag }}
59+
- run: npm publish --access public --provenance --tag ${{ steps.dist-tag.outputs.tag }} --workspace=@symphoniacloud/dynamodb-entity-store
6060

6161
# Only generate and deploy docs for stable releases
6262
- name: Generate docs
6363
if: steps.dist-tag.outputs.tag == 'latest'
64-
run: npm run generate-docs
64+
run: npm run generate-docs --workspace=@symphoniacloud/dynamodb-entity-store
6565

6666
- name: Upload docs artifact
6767
if: steps.dist-tag.outputs.tag == 'latest'

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"local-checks": "tsc"
1616
},
1717
"dependencies": {
18-
"@symphoniacloud/dynamodb-entity-store": "1.x"
18+
"@symphoniacloud/dynamodb-entity-store": "*"
1919
},
2020
"devDependencies": {
2121
"@aws-sdk/types": "3.x",

package-lock.json

Lines changed: 127 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,41 @@
11
{
2-
"name": "@symphoniacloud/dynamodb-entity-store",
3-
"description": "A lightly opinionated DynamoDB library for TypeScript & JavaScript applications",
2+
"name": "@symphoniacloud/dynamodb-entity-store-workspace",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "Workspace for DynamoDB Entity Store packages",
46
"license": "MIT",
57
"author": {
68
"email": "[email protected]",
79
"name": "Mike Roberts",
810
"url": "https://symphonia.io"
911
},
10-
"keywords": [
11-
"dynamodb"
12+
"workspaces": [
13+
"packages/*",
14+
"examples"
1215
],
13-
"homepage": "https://github.com/symphoniacloud/dynamodb-entity-store",
14-
"repository": {
15-
"type": "git",
16-
"url": "git+https://github.com/symphoniacloud/dynamodb-entity-store.git"
17-
},
18-
"bugs": {
19-
"url": "https://github.com/symphoniacloud/dynamodb-entity-store/issues"
20-
},
21-
"type": "module",
2216
"scripts": {
23-
"lint": "eslint --max-warnings=0 --fix-dry-run \"{src,test}/**/*.{js,ts}\"",
24-
"format": "prettier --check \"{src,test}/**/*.{js,ts}\"",
25-
"unit-tests": "npx vitest run --dir test/unit",
26-
"local-checks": "tsc && npm run lint && npm run unit-tests",
27-
"integration-tests": "npx vitest run --dir test/integration --config ./test/integration/vitest.config.ts",
28-
"all-checks": "npm run local-checks && npm run integration-tests",
29-
"deploy": "cd test/examples && aws cloudformation deploy --template-file template.yaml --stack-name \"${STACK_NAME-entity-store-test-stack}\" --no-fail-on-empty-changeset",
30-
"deploy-and-all-checks": "npm run deploy && npm run all-checks",
31-
"build": "rm -rf dist && tsc -p tsconfig.json",
32-
"prepublishOnly": "npm run local-checks && npm run build",
33-
"check-examples": "cd examples && npm run local-checks",
34-
"generate-docs": "typedoc src/lib/index.ts"
17+
"build": "npm run build --workspace=@symphoniacloud/dynamodb-entity-store",
18+
"test": "npm run unit-tests --workspace=@symphoniacloud/dynamodb-entity-store && npm run integration-tests --workspace=@symphoniacloud/dynamodb-entity-store",
19+
"unit-tests": "npm run unit-tests --workspace=@symphoniacloud/dynamodb-entity-store",
20+
"integration-tests": "npm run integration-tests --workspace=@symphoniacloud/dynamodb-entity-store",
21+
"lint": "npm run lint --workspaces --if-present",
22+
"format": "npm run format --workspaces --if-present",
23+
"local-checks": "npm run local-checks --workspace=@symphoniacloud/dynamodb-entity-store",
24+
"all-checks": "npm run all-checks --workspace=@symphoniacloud/dynamodb-entity-store",
25+
"deploy": "npm run deploy --workspace=@symphoniacloud/dynamodb-entity-store",
26+
"deploy-and-all-checks": "npm run deploy-and-all-checks --workspace=@symphoniacloud/dynamodb-entity-store",
27+
"check-examples": "npm run local-checks --workspace=@symphoniacloud/dynamodb-entity-store-examples",
28+
"generate-docs": "npm run generate-docs --workspace=@symphoniacloud/dynamodb-entity-store"
3529
},
3630
"engines": {
3731
"node": ">=22.0.0"
3832
},
39-
"dependencies": {
40-
"@aws-sdk/client-dynamodb": "3.x",
41-
"@aws-sdk/lib-dynamodb": "3.x",
42-
"@aws-sdk/util-dynamodb": "3.x"
43-
},
4433
"devDependencies": {
4534
"@aws-sdk/client-cloudformation": "3.x",
35+
"@aws-sdk/client-dynamodb": "3.x",
36+
"@aws-sdk/lib-dynamodb": "3.x",
4637
"@aws-sdk/types": "3.x",
38+
"@aws-sdk/util-dynamodb": "3.x",
4739
"@eslint/js": "9.x",
4840
"@types/deep-equal": "1.x",
4941
"@types/node": "22.x",
@@ -58,17 +50,5 @@
5850
"typescript": "5.x",
5951
"typescript-eslint": "8.x",
6052
"vitest": "3.x"
61-
},
62-
"files": [
63-
"package.json",
64-
"README.md",
65-
"LICENSE",
66-
"dist/"
67-
],
68-
"exports": {
69-
".": {
70-
"types": "./dist/index.d.ts",
71-
"import": "./dist/index.js"
72-
}
7353
}
7454
}
File renamed without changes.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"name": "@symphoniacloud/dynamodb-entity-store",
3+
"description": "A lightly opinionated DynamoDB library for TypeScript & JavaScript applications",
4+
"license": "MIT",
5+
"author": {
6+
"email": "[email protected]",
7+
"name": "Mike Roberts",
8+
"url": "https://symphonia.io"
9+
},
10+
"keywords": [
11+
"dynamodb"
12+
],
13+
"homepage": "https://github.com/symphoniacloud/dynamodb-entity-store",
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/symphoniacloud/dynamodb-entity-store.git"
17+
},
18+
"bugs": {
19+
"url": "https://github.com/symphoniacloud/dynamodb-entity-store/issues"
20+
},
21+
"type": "module",
22+
"scripts": {
23+
"lint": "eslint --max-warnings=0 --fix-dry-run \"{src,test}/**/*.{js,ts}\"",
24+
"format": "prettier --check \"{src,test}/**/*.{js,ts}\"",
25+
"unit-tests": "npx vitest run --dir test/unit",
26+
"local-checks": "tsc && npm run lint && npm run unit-tests",
27+
"integration-tests": "npx vitest run --dir test/integration --config ./test/integration/vitest.config.ts",
28+
"all-checks": "npm run local-checks && npm run integration-tests",
29+
"deploy": "cd test/examples && aws cloudformation deploy --template-file template.yaml --stack-name \"${STACK_NAME-entity-store-test-stack}\" --no-fail-on-empty-changeset",
30+
"deploy-and-all-checks": "npm run deploy && npm run all-checks",
31+
"build": "rm -rf dist && tsc -p tsconfig.json",
32+
"prepublishOnly": "npm run local-checks && npm run build",
33+
"generate-docs": "typedoc src/lib/index.ts"
34+
},
35+
"engines": {
36+
"node": ">=22.0.0"
37+
},
38+
"dependencies": {
39+
"@aws-sdk/client-dynamodb": "3.x",
40+
"@aws-sdk/lib-dynamodb": "3.x",
41+
"@aws-sdk/util-dynamodb": "3.x"
42+
},
43+
"devDependencies": {
44+
"@aws-sdk/client-cloudformation": "3.x",
45+
"@aws-sdk/types": "3.x",
46+
"@eslint/js": "9.x",
47+
"@types/deep-equal": "1.x",
48+
"@types/node": "22.x",
49+
"@typescript-eslint/eslint-plugin": "8.x",
50+
"@typescript-eslint/parser": "8.x",
51+
"deep-equal": "2.x",
52+
"eslint": "9.x",
53+
"eslint-config-prettier": "9.x",
54+
"prettier": "3.x",
55+
"ts-node": "10.x",
56+
"typedoc": "^0.26.0",
57+
"typescript": "5.x",
58+
"typescript-eslint": "8.x",
59+
"vitest": "3.x"
60+
},
61+
"files": [
62+
"package.json",
63+
"../../README.md",
64+
"../../LICENSE",
65+
"dist/"
66+
],
67+
"exports": {
68+
".": {
69+
"types": "./dist/index.d.ts",
70+
"import": "./dist/index.js"
71+
}
72+
}
73+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)