Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 1576 again #1617

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib
dist
umd
storybook-static
local-pack.sh

# Config files
.npmrc
Expand Down Expand Up @@ -65,3 +66,8 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

#local build artifacts
carbon-vue-*.tgz
local-dev/npm-registry/storage/*
!local-dev/npm-registry/storage/.gitkeep
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ If you just want to build an individual package you can limit the scope:

To start the storybook in a local server use `yarn start`.

## Test publish

To test publishing to a npm registry:

```shell
cd local-dev
docker-compose up
# open a new terminal
yarn build
npm add-user --registry http://0.0.0.0:4873/
# any username, password, & email will work
# try: carbon, vue, & carbon-vue@example.com
yarn test:publish
# maybe change some things and try again
yarn build
yarn test:unpublish
yarn test:publish
```

## How to run the storybook

Just follow the steps listed below and you will be able to run the storybook.
Expand Down
14 changes: 14 additions & 0 deletions local-dev/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
npm-registry:
# npm add-user --registry http://0.0.0.0:4873/
# carbon
# vue
# carbon-vue@example.com
image: docker.io/verdaccio/verdaccio:nightly-master
ports:
- '4873:4873'
volumes:
- './npm-registry/storage:/verdaccio/storage'
volumes:
verdaccio:
driver: local
Empty file.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
"main": "dist/carbon-vue-3.umd.min.js",
"types": "src/index.d.ts",
"web-types": "dist/web-types.json",
"packrat": {
"prod_setup": "npx ibmtelemetry --config=telemetry.yml || true"
},
"scripts": {
"postinstall": "node devPreinstall.js && node .storybook/postinstall.js",
"prepack": "node packrat.js --disable",
"postpack": "node packrat.js --enable",
"postinstall": "node postinstall.js",
"build": "vue-cli-service build --target lib --name carbon-vue-3 ./src/index.js --no-clean",
"lint": "vue-cli-service lint",
"build-web-types": "vue-docgen-web-types --outFile dist/web-types.json",
Expand All @@ -26,6 +21,8 @@
"lint:es": "eslint src/**/*.{js,vue}",
"lint:style": "vue-cli-service lint:style",
"serve:storybook": "cd ./storybook && yarn run serve",
"test:publish": "npm publish --registry http://0.0.0.0:4873",
"test:unpublish": "rm -rf local-dev/npm-registry/storage/data/@carbon/vue",
"test": "vue-cli-service test:unit --no-coverage"
},
"workspaces": [
Expand Down Expand Up @@ -163,6 +160,7 @@
"files": [
"/dist",
"/src",
"postinstall.js",
"telemetry.yml"
],
"commitlint": {
Expand Down
51 changes: 0 additions & 51 deletions packrat.js

This file was deleted.

9 changes: 9 additions & 0 deletions postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const fs = require('fs');
const { spawnSync } = require('child_process');

if (fs.existsSync('./devPreinstall.js')) {
require('./devPreinstall.js');
require('./.storybook/postinstall.js');
} else {
spawnSync('npx', ['ibmtelemetry', '--config=telemetry.yml']);
}
Loading