tar-dependency 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 20
package/README.md CHANGED
@@ -15,7 +15,7 @@ We created this tool to replace [Bower](https://bower.io/), where packages are n
15
15
 
16
16
  ## Requirements
17
17
 
18
- This library needs at least NodeJS >= 12.20.0
18
+ This library needs at least NodeJS >= 20
19
19
 
20
20
  ## Installation
21
21
 
@@ -91,4 +91,16 @@ and then install them with
91
91
 
92
92
  `tar-dependency install`
93
93
 
94
- (c) 2017-2021 alex@alexi.ch
94
+ ## Changelog
95
+
96
+ ### 0.2.0 - Feb 2025
97
+
98
+ * [breaking] Updated to NodeJS >= 20 with ES Modules
99
+ * [breaking] You need a NodeJS version that supports ES Modules (~ V.14.0)
100
+ * Updated dependant packages
101
+
102
+ ### 0.1.0
103
+
104
+ Initial release
105
+
106
+ (c) 2017-2025 alex@alexi.ch
package/bin/cmd.js CHANGED
@@ -4,13 +4,14 @@
4
4
  *
5
5
  * It assumes a package.json in the actual working directory.
6
6
  *
7
- * (c) 2017 alex@alexi.ch
7
+ * (c) 2017-2025 alex@alexi.ch
8
8
  */
9
9
 
10
- const lib = require('../index.js');
11
- const jsonfile = require('jsonfile');
12
- const path = require('path');
13
- const program = require('commander');
10
+ import process from 'node:process';
11
+ import lib from '../index.js';
12
+ import jsonfile from 'jsonfile';
13
+ import path from 'path';
14
+ import { program } from 'commander';
14
15
 
15
16
  function setWorkingDir(dir) {
16
17
  process.chdir(dir);
@@ -0,0 +1,46 @@
1
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
2
+ import json from 'eslint-plugin-json';
3
+
4
+ // eslint.config.js
5
+ export default [
6
+ eslintPluginPrettierRecommended,
7
+ {
8
+ files: ["**/*.json"],
9
+ ...json.configs["recommended"]
10
+ },
11
+ {
12
+ // extends: ['prettier', 'plugin:json/recommended'],
13
+ languageOptions: {
14
+ ecmaVersion: 2017
15
+ },
16
+ // env: {
17
+ // node: true
18
+ // },
19
+ // plugins: ['prettier', 'json'],
20
+ rules: {
21
+ 'prettier/prettier': [
22
+ 'error',
23
+ {
24
+ singleQuote: true,
25
+ tabWidth: 4,
26
+ printWidth: 120
27
+ }
28
+ ],
29
+ 'no-unused-vars': [
30
+ 'error',
31
+ {
32
+ vars: 'all',
33
+ args: 'none'
34
+ }
35
+ ],
36
+ semi: ['error', 'always'],
37
+ curly: 'error',
38
+ eqeqeq: 'error',
39
+ 'no-eval': 'error',
40
+ 'no-loop-func': 'error',
41
+ radix: 'error',
42
+ 'comma-dangle': 'error',
43
+ 'no-undef': 'error'
44
+ }
45
+ }
46
+ ];
package/index.js CHANGED
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * tar-dependency module
3
3
  *
4
- * (c) 2017 alex@alexi.ch
4
+ * (c) 2017-2025 alex@alexi.ch
5
5
  */
6
- const path = require('path'),
7
- jsonfile = require('jsonfile'),
8
- rimraf = require('rimraf'),
9
- mkdirp = require('mkdirp'),
10
- tar = require('tar'),
11
- fetch = require('node-fetch'),
12
- util = require('util');
6
+ import process from 'node:process';
7
+ import console from 'node:console';
8
+ import path from 'path';
9
+ import jsonfile from 'jsonfile';
10
+ import { rimraf } from 'rimraf';
11
+ import { mkdirp } from 'mkdirp';
12
+ import * as tar from 'tar';
13
+ import fetch from 'node-fetch';
13
14
 
14
15
  function normalizePathKey(str) {
15
16
  return (str || '').replace(/(^\/)|(\/$)/g, ''); // remove leading/trailing slashes)
@@ -44,7 +45,7 @@ async function installTarDependencies(config, destKey) {
44
45
  const strip = deps[key].strip === undefined ? 1 : Number(deps[key].strip);
45
46
 
46
47
  console.log('tar package: ' + url + ' => ' + key);
47
- await util.promisify(rimraf)(fullOutdir);
48
+ await rimraf(fullOutdir);
48
49
  await mkdirp(fullOutdir);
49
50
 
50
51
  const response = await fetch(url);
@@ -96,7 +97,7 @@ async function removeArchive(config, destDir) {
96
97
  }
97
98
 
98
99
  const fullOutdir = path.join(process.cwd(), destDir);
99
- await util.promisify(rimraf)(fullOutdir);
100
+ await rimraf(fullOutdir);
100
101
  }
101
102
 
102
103
  /*
@@ -107,10 +108,10 @@ async function removeArchive(config, destDir) {
107
108
  */
108
109
  async function saveConf(config, file) {
109
110
  config = config || {};
110
- await util.promisify(jsonfile.writeFileSync)(file, config, { spaces: 2 });
111
+ await jsonfile.writeFile(file, config, { spaces: 2 });
111
112
  }
112
113
 
113
- module.exports = {
114
+ export default {
114
115
  install: installTarDependencies,
115
116
  add: addArchive,
116
117
  remove: removeArchive,
package/package.json CHANGED
@@ -1,83 +1,49 @@
1
1
  {
2
- "name": "tar-dependency",
3
- "version": "0.1.0",
4
- "description": "Fetches .tar(.gz) archives defined in package.json and extracts them to a specific location.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
2
+ "name": "tar-dependency",
3
+ "version": "0.2.0",
4
+ "description": "Fetches .tar(.gz) archives defined in package.json and extracts them to a specific location.",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "Alexander Schenkel",
11
+ "email": "alex@alexi.ch",
12
+ "license": "MIT",
13
+ "dependencies": {
14
+ "commander": "^13.1.0",
15
+ "jsonfile": "^6.1.0",
16
+ "mkdirp": "^3.0.1",
17
+ "node-fetch": "^2.6.5",
18
+ "rimraf": "^6.0.1",
19
+ "tar": "^7.4.3"
20
+ },
21
+ "devDependencies": {
22
+ "eslint": "^9.20.0",
23
+ "eslint-config-prettier": "^10.0.1",
24
+ "eslint-plugin-json": "^4.0.1",
25
+ "eslint-plugin-prettier": "^5.2.3",
26
+ "prettier": "^3.5.0"
27
+ },
28
+ "bin": {
29
+ "tar-dependency": "bin/cmd.js"
30
+ },
31
+ "prettier": {
32
+ "printWidth": 120,
33
+ "tabWidth": 4,
34
+ "useTabs": false,
35
+ "semi": true,
36
+ "singleQuote": true,
37
+ "trailingComma": "none"
38
+ },
39
+ "tarDependencies": {
40
+ "packages/fontawesome": {
41
+ "url": "http://reposerver.kp.local/lib/fontawesome-pro-6.7.2-web.tar.gz",
42
+ "strip": 1
8
43
  },
9
- "author": "Alexander Schenkel",
10
- "email": "alex@alexi.ch",
11
- "license": "MIT",
12
- "dependencies": {
13
- "commander": "^8.2.0",
14
- "jsonfile": "^6.1.0",
15
- "mkdirp": "^1.0.4",
16
- "node-fetch": "^2.6.5",
17
- "rimraf": "^3.0.2",
18
- "tar": "^6.1.11"
19
- },
20
- "devDependencies": {
21
- "eslint": "^7.32.0",
22
- "eslint-config-prettier": "^8.3.0",
23
- "eslint-plugin-json": "^3.1.0",
24
- "eslint-plugin-prettier": "^4.0.0",
25
- "prettier": "^2.4.1"
26
- },
27
- "bin": {
28
- "tar-dependency": "bin/cmd.js"
29
- },
30
- "eslintConfig": {
31
- "root": true,
32
- "parserOptions": {
33
- "ecmaVersion": 2017
34
- },
35
- "extends": [
36
- "prettier",
37
- "plugin:json/recommended"
38
- ],
39
- "env": {
40
- "node": true
41
- },
42
- "plugins": [
43
- "prettier",
44
- "json"
45
- ],
46
- "rules": {
47
- "prettier/prettier": [
48
- "error",
49
- {
50
- "singleQuote": true,
51
- "tabWidth": 4,
52
- "printWidth": 120
53
- }
54
- ],
55
- "no-unused-vars": [
56
- "error",
57
- {
58
- "vars": "all",
59
- "args": "none"
60
- }
61
- ],
62
- "semi": [
63
- "error",
64
- "always"
65
- ],
66
- "curly": "error",
67
- "eqeqeq": "error",
68
- "no-eval": "error",
69
- "no-loop-func": "error",
70
- "radix": "error",
71
- "comma-dangle": "error",
72
- "no-undef": "error"
73
- }
74
- },
75
- "prettier": {
76
- "printWidth": 120,
77
- "tabWidth": 4,
78
- "useTabs": false,
79
- "semi": true,
80
- "singleQuote": true,
81
- "trailingComma": "none"
44
+ "packages/php-injector": {
45
+ "url": "https://github.com/bylexus/php-injector/archive/0.0.8.tar.gz",
46
+ "strip": 1
82
47
  }
48
+ }
83
49
  }