Skip to content

Commit 2a01427

Browse files
basic setup with a publish-components.js script
1 parent b87f50b commit 2a01427

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

package-lock.json

Lines changed: 13 additions & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "dsg",
3+
"version": "0.1.0",
4+
"description": "This is intended to be the package for the project starter to use that houses scss etc.",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"publish-components": "node publish-components.js"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/DCODE-GROUP/dsg.git"
12+
},
13+
"keywords": [
14+
"dsg"
15+
],
16+
"author": "Dcode Group",
17+
"license": "ISC",
18+
"bugs": {
19+
"url": "https://github.com/DCODE-GROUP/dsg/issues"
20+
},
21+
"homepage": "https://github.com/DCODE-GROUP/dsg#readme"
22+
}

publish-components.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
3+
const sourcePath = __dirname + "/src/components";
4+
// --path flag also can be used to define the end path for the copying components
5+
const destinationPath = process.env.npm_config_path || process.cwd() + "/resources/js/vue/components/dsg";
6+
7+
if (!fs.existsSync(destinationPath)) {
8+
fs.mkdirSync(destinationPath, {recursive: true})
9+
}
10+
11+
console.log("Publishing components to " + destinationPath + " ..." );
12+
fs.cpSync(sourcePath, destinationPath, { recursive: true });
13+
14+
console.log("Components published successfully");

0 commit comments

Comments
 (0)