Skip to content

Commit

Permalink
Merge pull request #953 from 3YOURMIND/have-tarball-support
Browse files Browse the repository at this point in the history
chore(build): add support to export packages as tarballs
  • Loading branch information
Isokaeder authored Jun 21, 2024
2 parents f99db54 + 745f864 commit f7a0ce7
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
packages/kotti-ui/report.*.html
packages/yoco/fonts/
*.log
packages/*/package.tar.gz

# vite config gets transpiled in-place for a short moment
vite.config.ts.timestamp*
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,31 @@ In case this does not work as expected, you want to check out the [publish scrip
yarn run build
```

## Debugging

### Creating tarballs

For all packages that are published you can also create a tarball by running

```bash
# Create tarballs for all relevant packages
yarn run tarball

# Create tarball for a specific package
yarn run tarball --filter @3yourmind/yoco

# Can be combined with other commands
yarn run build tarball

# How the created tarballs can be installed in another project (yarn@1)
yarn cache clean && yarn remove @3yourmind/yoco && yarn add ../path/to/kotti/packages/yoco/package.tar.gz
```

See more:

- https://docs.npmjs.com/cli/v6/commands/npm-pack
- https://classic.yarnpkg.com/en/docs/cli/add

## Internals

### Important Folders
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"fix:stylelint": "turbo run fix:stylelint",
"prepare": "husky install",
"prepublishOnly": "turbo run check build",
"tarball": "turbo run tarball",
"test": "turbo run test",
"watch": "nodemon -e css,js,json,scss,ts,vue --watch packages/vue-use-tippy/source --watch packages/yoco/source --exec \"turbo run watch\""
},
Expand Down
17 changes: 17 additions & 0 deletions packages/documentation/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
"$schema": "https://turbo.build/schema.v1.json",
"extends": ["//"],
"pipeline": {
"build": {
"inputs": [
"assets/**",
"components/**",
"data/**",
"hooks/**",
"layouts/**",
"pages/**",
"plugins/**",
"styles/**",
"utilities/**",
"nuxt.config.ts",
"package.json",
"shims-*.d.ts",
"tsconfig.json"
]
},
"check:publint": {
"dependsOn": []
},
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"check:publint": "publint",
"fix:eslint": "yarn run check:eslint --fix",
"fix:prettier": "yarn run check:prettier --write",
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public"
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public",
"tarball": "npm pack && mv *.tgz package.tar.gz"
},
"type": "module",
"types": "./dist/mjs/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/kotti-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"fix:prettier": "yarn run check:prettier --write",
"fix:stylelint": "yarn run check:stylelint --fix",
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public",
"tarball": "npm pack && mv *.tgz package.tar.gz",
"test": "vitest --run --typecheck",
"watch": "vite build --watch"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vue-use-tippy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"check:publint": "publint",
"fix:eslint": "yarn run check:eslint --fix",
"fix:prettier": "yarn run check:prettier --write",
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public"
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public",
"tarball": "npm pack && mv *.tgz package.tar.gz"
},
"type": "module",
"types": "./dist/mjs/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/yoco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"check:stylelint": "stylelint style.css",
"fix:eslint": "yarn run check:eslint --fix",
"fix:prettier": "yarn run check:prettier --write",
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public"
"publish-package": "yarn publish --no-git-tag-version --verbose --non-interactive --access public",
"tarball": "npm pack && mv *.tgz package.tar.gz"
},
"style": "./style.css",
"type": "module",
Expand Down
4 changes: 3 additions & 1 deletion packages/yoco/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"pipeline": {
"build": {
"inputs": ["scripts/**", "source/**", "svg/**", "tsconfig.*"],
"outputMode": "new-only",
"outputs": ["dist/**", "fonts/**"]
},
"tarball": {
"inputs": ["fonts/**", "dist/**", "svg/**", "style.css"]
}
}
}
6 changes: 6 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
"cache": false,
"dependsOn": ["build", "check", "test"]
},
"tarball": {
"dependsOn": ["build"],
"inputs": ["dist/**", "package.json"],
"outputMode": "new-only",
"outputs": ["./package.tar.gz"]
},
"test": {},
"watch": {
"cache": false,
Expand Down

0 comments on commit f7a0ce7

Please sign in to comment.