diff --git a/node/.gitignore b/node/.gitignore index 065022b1..aa43a141 100644 --- a/node/.gitignore +++ b/node/.gitignore @@ -4,6 +4,6 @@ .venv/ _build/ __pycache__/ -./node_modules/ +node_modules/ npm-cache-*/ yarn-mirror/ diff --git a/node/tests/data/packages/name-as-dep/node_modules/.package-lock.json b/node/tests/data/packages/name-as-dep/node_modules/.package-lock.json deleted file mode 100644 index 900c06a2..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/.package-lock.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@flatpak-node-generator-tests/name-as-dep", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "engines": { - "node": ">=0.10.0" - } - } - } -} diff --git a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/LICENSE b/node/tests/data/packages/name-as-dep/node_modules/word-wrap/LICENSE deleted file mode 100644 index d734237b..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/README.md b/node/tests/data/packages/name-as-dep/node_modules/word-wrap/README.md deleted file mode 100644 index 88b96840..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/README.md +++ /dev/null @@ -1,182 +0,0 @@ -# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) - -> Wrap words to a specified length. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save word-wrap -``` - -## Usage - -```js -var wrap = require('word-wrap'); - -wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); -``` - -Results in: - -``` - Lorem ipsum dolor sit amet, consectetur adipiscing - elit, sed do eiusmod tempor incididunt ut labore - et dolore magna aliqua. Ut enim ad minim veniam, - quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. -``` - -## Options - -![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) - -### options.width - -Type: `Number` - -Default: `50` - -The width of the text before wrapping to a new line. - -**Example:** - -```js -wrap(str, {width: 60}); -``` - -### options.indent - -Type: `String` - -Default: `` (two spaces) - -The string to use at the beginning of each line. - -**Example:** - -```js -wrap(str, {indent: ' '}); -``` - -### options.newline - -Type: `String` - -Default: `\n` - -The string to use at the end of each line. - -**Example:** - -```js -wrap(str, {newline: '\n\n'}); -``` - -### options.escape - -Type: `function` - -Default: `function(str){return str;}` - -An escape function to run on each line after splitting them. - -**Example:** - -```js -var xmlescape = require('xml-escape'); -wrap(str, { - escape: function(string){ - return xmlescape(string); - } -}); -``` - -### options.trim - -Type: `Boolean` - -Default: `false` - -Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. - -**Example:** - -```js -wrap(str, {trim: true}); -``` - -### options.cut - -Type: `Boolean` - -Default: `false` - -Break a word between any two letters when the word is longer than the specified width. - -**Example:** - -```js -wrap(str, {cut: true}); -``` - -## About - -### Related projects - -* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") -* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") -* [unique-words](https://www.npmjs.com/package/unique-words): Return the unique words in a string or array. | [homepage](https://github.com/jonschlinkert/unique-words "Return the unique words in a string or array.") -* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 43 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [lordvlad](https://github.com/lordvlad) | -| 2 | [hildjj](https://github.com/hildjj) | -| 1 | [danilosampaio](https://github.com/danilosampaio) | -| 1 | [2fd](https://github.com/2fd) | -| 1 | [toddself](https://github.com/toddself) | -| 1 | [wolfgang42](https://github.com/wolfgang42) | -| 1 | [zachhale](https://github.com/zachhale) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._ \ No newline at end of file diff --git a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.d.ts b/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.d.ts deleted file mode 100644 index 54ee5f26..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Wrap words to a specified length. - */ -export = wrap; - -declare function wrap(str: string, options?: wrap.IOptions): string; - -declare namespace wrap { - export interface IOptions { - - /** - * The width of the text before wrapping to a new line. - * @default ´50´ - */ - width?: number; - - /** - * The string to use at the beginning of each line. - * @default ´ ´ (two spaces) - */ - indent?: string; - - /** - * The string to use at the end of each line. - * @default ´\n´ - */ - newline?: string; - - /** - * An escape function to run on each line after splitting them. - * @default (str: string) => string; - */ - escape?: (str: string) => string; - - /** - * Trim trailing whitespace from the returned string. - * This option is included since .trim() would also strip - * the leading indentation from the first line. - * @default true - */ - trim?: boolean; - - /** - * Break a word between any two letters when the word is longer - * than the specified width. - * @default false - */ - cut?: boolean; - } -} \ No newline at end of file diff --git a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.js b/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.js deleted file mode 100644 index 45373c6d..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/index.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * word-wrap - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -module.exports = function(str, options) { - options = options || {}; - if (str == null) { - return str; - } - - var width = options.width || 50; - var indent = (typeof options.indent === 'string') - ? options.indent - : ' '; - - var newline = options.newline || '\n' + indent; - var escape = typeof options.escape === 'function' - ? options.escape - : identity; - - var regexString = '.{1,' + width + '}'; - if (options.cut !== true) { - regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; - } - - var re = new RegExp(regexString, 'g'); - var lines = str.match(re) || []; - var result = indent + lines.map(function(line) { - if (line.slice(-1) === '\n') { - line = line.slice(0, line.length - 1); - } - return escape(line); - }).join(newline); - - if (options.trim === true) { - result = result.replace(/[ \t]*$/gm, ''); - } - return result; -}; - -function identity(str) { - return str; -} diff --git a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/package.json b/node/tests/data/packages/name-as-dep/node_modules/word-wrap/package.json deleted file mode 100644 index 6f8f633c..00000000 --- a/node/tests/data/packages/name-as-dep/node_modules/word-wrap/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "word-wrap", - "description": "Wrap words to a specified length.", - "version": "1.2.3", - "homepage": "https://github.com/jonschlinkert/word-wrap", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Danilo Sampaio (localhost:8080)", - "Fede Ramirez (https://2fd.github.io)", - "Joe Hildebrand (https://twitter.com/hildjj)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Todd Kennedy (https://tck.io)", - "Waldemar Reusch (https://github.com/lordvlad)", - "Wolfgang Faust (http://www.linestarve.com)", - "Zach Hale (http://zachhale.com)" - ], - "repository": "jonschlinkert/word-wrap", - "bugs": { - "url": "https://github.com/jonschlinkert/word-wrap/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "index.d.ts" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.2.0" - }, - "keywords": [ - "break", - "carriage", - "line", - "new-line", - "newline", - "return", - "soft", - "text", - "word", - "word-wrap", - "words", - "wrap" - ], - "typings": "index.d.ts", - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "common-words", - "shuffle-words", - "unique-words", - "wordcount" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - } -} diff --git a/node/tests/data/packages/name-as-dep/package-lock.v1.json b/node/tests/data/packages/name-as-dep/package-lock.v1.json deleted file mode 100644 index 1414148e..00000000 --- a/node/tests/data/packages/name-as-dep/package-lock.v1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "word-wrap": { - "version": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" - } - } -} diff --git a/node/tests/data/packages/name-as-dep/package-lock.v2.json b/node/tests/data/packages/name-as-dep/package-lock.v2.json deleted file mode 100644 index b42201bb..00000000 --- a/node/tests/data/packages/name-as-dep/package-lock.v2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "dependencies": { - "word-wrap": "^1.2.3" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - } - }, - "dependencies": { - "word-wrap": { - "version": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" - } - } -} diff --git a/node/tests/data/packages/name-as-dep/package-lock.v3.json b/node/tests/data/packages/name-as-dep/package-lock.v3.json deleted file mode 100644 index b3c0473a..00000000 --- a/node/tests/data/packages/name-as-dep/package-lock.v3.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "dependencies": { - "word-wrap": "^1.2.3" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - } - } -} diff --git a/node/tests/data/packages/name-as-dep/package.json b/node/tests/data/packages/name-as-dep/package.json deleted file mode 100644 index 7a578853..00000000 --- a/node/tests/data/packages/name-as-dep/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@flatpak-node-generator-tests/name-as-dep", - "version": "1.0.0", - "dependencies": { - "word-wrap": "^1.2.3" - } -} diff --git a/node/tests/test_providers.py b/node/tests/test_providers.py index d141a062..3d29c815 100644 --- a/node/tests/test_providers.py +++ b/node/tests/test_providers.py @@ -123,31 +123,6 @@ async def test_missing_resolved_field( assert word_wrap_package_json.exists() -async def test_name_as_dep( - flatpak_builder: FlatpakBuilder, - npm_provider_factory_spec: ProviderFactorySpec, - node_version: int, -) -> None: - with ManifestGenerator() as gen: - await npm_provider_factory_spec.generate_modules( - 'name-as-dep', gen, node_version - ) - - flatpak_builder.build( - sources=gen.ordered_sources(), - commands=[ - npm_provider_factory_spec.install_command, - f"""node -e 'require("word-wrap")'""", - ], - use_node=node_version, - ) - - word_wrap_package_json = ( - flatpak_builder.module_dir / 'node_modules' / 'word-wrap' / 'package.json' - ) - assert word_wrap_package_json.exists() - - async def test_url_as_dep( flatpak_builder: FlatpakBuilder, npm_provider_factory_spec: ProviderFactorySpec,