mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-12 21:51:40 +00:00
update
This commit is contained in:
3
node_modules/requirejs-config-file/.idea/dictionaries/psc.xml
generated
vendored
Normal file
3
node_modules/requirejs-config-file/.idea/dictionaries/psc.xml
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="psc" />
|
||||
</component>
|
4
node_modules/requirejs-config-file/.idea/encodings.xml
generated
vendored
Normal file
4
node_modules/requirejs-config-file/.idea/encodings.xml
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
6
node_modules/requirejs-config-file/.idea/inspectionProfiles/Project_Default.xml
generated
vendored
Normal file
6
node_modules/requirejs-config-file/.idea/inspectionProfiles/Project_Default.xml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
16
node_modules/requirejs-config-file/.idea/jsLinters/jshint.xml
generated
vendored
Normal file
16
node_modules/requirejs-config-file/.idea/jsLinters/jshint.xml
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JSHintConfiguration" version="2.9.5" use-config-file="true" use-custom-config-file="true" custom-config-file-path="$PROJECT_DIR$/.jshintrc">
|
||||
<option bitwise="true" />
|
||||
<option browser="true" />
|
||||
<option curly="true" />
|
||||
<option eqeqeq="true" />
|
||||
<option forin="true" />
|
||||
<option maxerr="50" />
|
||||
<option noarg="true" />
|
||||
<option noempty="true" />
|
||||
<option nonew="true" />
|
||||
<option strict="true" />
|
||||
<option undef="true" />
|
||||
</component>
|
||||
</project>
|
8
node_modules/requirejs-config-file/.idea/modules.xml
generated
vendored
Normal file
8
node_modules/requirejs-config-file/.idea/modules.xml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/requirejs-config-file.iml" filepath="$PROJECT_DIR$/.idea/requirejs-config-file.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
8
node_modules/requirejs-config-file/.idea/requirejs-config-file.iml
generated
vendored
Normal file
8
node_modules/requirejs-config-file/.idea/requirejs-config-file.iml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
node_modules/requirejs-config-file/.idea/vcs.xml
generated
vendored
Normal file
6
node_modules/requirejs-config-file/.idea/vcs.xml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
278
node_modules/requirejs-config-file/.idea/workspace.xml
generated
vendored
Normal file
278
node_modules/requirejs-config-file/.idea/workspace.xml
generated
vendored
Normal file
@ -0,0 +1,278 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="cb195ec4-857b-4547-b031-dee1c0224096" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ComposerSettings" executionDataType="PHAR" phpInterpreterId="0501ef1f-e85b-45c0-aa58-679e67f4784c" synchronizationState="SYNCHRONIZE">
|
||||
<pharPath>D:\DROPBOX\work\bin\composer.phar</pharPath>
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/Gruntfile.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="374">
|
||||
<caret line="22" column="24" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="34">
|
||||
<caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/test/config-file-test.js">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="51">
|
||||
<caret line="3" selection-start-line="3" selection-end-line="3" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/.rmt.yml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state>
|
||||
<caret lean-forward="true" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>configfile</find>
|
||||
</findStrings>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="UPDATE_TYPE" value="REBASE" />
|
||||
<option name="PUSH_AUTO_UPDATE" value="true" />
|
||||
<option name="ROOT_SYNC" value="DONT_SYNC" />
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/Gruntfile.js" />
|
||||
<option value="$PROJECT_DIR$/.travis.yml" />
|
||||
<option value="$PROJECT_DIR$/.rmt.yml" />
|
||||
<option value="$PROJECT_DIR$/package.json" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="PhpServers">
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="260" />
|
||||
<option name="y" value="20" />
|
||||
<option name="width" value="1400" />
|
||||
<option name="height" value="990" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
<expanded-state>
|
||||
<State>
|
||||
<id />
|
||||
</State>
|
||||
<State>
|
||||
<id>CSS</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>DOM issuesJavaScript</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>Internationalization issues</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>JavaScript</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>RegExp</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>XPath</id>
|
||||
</State>
|
||||
</expanded-state>
|
||||
<selected-state>
|
||||
<State>
|
||||
<id>AngularJS</id>
|
||||
</State>
|
||||
</selected-state>
|
||||
</profile-state>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="1" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="requirejs-config-file" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="requirejs-config-file" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../IWEP" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
|
||||
<property name="settings.editor.splitter.proportion" value="0.24755381" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="cb195ec4-857b-4547-b031-dee1c0224096" name="Default" comment="" />
|
||||
<created>1515344777787</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1515344777787</updated>
|
||||
<workItem from="1515344779228" duration="829000" />
|
||||
<workItem from="1544462178003" duration="1795000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="2624000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25266525" />
|
||||
<window_info id="Structure" order="1" weight="0.25" />
|
||||
<window_info id="npm" order="2" side_tool="true" />
|
||||
<window_info id="Grunt " order="3" side_tool="true" />
|
||||
<window_info id="Favorites" order="4" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Database Changes" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Docker" order="7" />
|
||||
<window_info anchor="bottom" id="Version Control" order="8" />
|
||||
<window_info anchor="bottom" id="Terminal" order="9" />
|
||||
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
|
||||
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Database" order="3" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/index.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state>
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/Gruntfile.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="374">
|
||||
<caret line="22" column="24" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/test/config-file-test.js">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="51">
|
||||
<caret line="3" selection-start-line="3" selection-end-line="3" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/.rmt.yml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state>
|
||||
<caret lean-forward="true" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="34">
|
||||
<caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="Copyright.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ScopeChooserConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
23
node_modules/requirejs-config-file/.jshintrc
generated
vendored
Normal file
23
node_modules/requirejs-config-file/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"curly": false,
|
||||
"eqeqeq": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"devel": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"sub": true,
|
||||
"trailing": false,
|
||||
"undef": true,
|
||||
"boss": true,
|
||||
"eqnull": true,
|
||||
"node": true,
|
||||
"expr": true,
|
||||
"esversion": 6,
|
||||
|
||||
"globals": {
|
||||
"requirejs": true, "define": true, "require": true,
|
||||
|
||||
"describe": true, "it": true, "beforeEach": true, "before": true
|
||||
}
|
||||
}
|
30
node_modules/requirejs-config-file/.rmt.yml
generated
vendored
Normal file
30
node_modules/requirejs-config-file/.rmt.yml
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
_default:
|
||||
|
||||
# VCS CONFIG
|
||||
vcs: git
|
||||
|
||||
# PREREQUISITES
|
||||
# Actions executed before any questions get asked to the user.
|
||||
# Custom action can be added by provided a relative path the the php script. Example:
|
||||
# - relative/path/to/your-own-sript.php
|
||||
prerequisites:
|
||||
- working-copy-check
|
||||
- display-last-changes
|
||||
|
||||
pre-release-actions:
|
||||
update-version-class:
|
||||
class: 'package.json'
|
||||
pattern: '"version": "%version%"'
|
||||
vcs-commit:
|
||||
commit-message: '%version%'
|
||||
|
||||
version-generator: semantic
|
||||
version-persister:
|
||||
vcs-tag:
|
||||
tag-prefix: 'v'
|
||||
post-release-actions:
|
||||
vcs-publish: # Publish the release to the VCS
|
||||
ask-confirmation: true
|
||||
command:
|
||||
cmd: 'npm publish'
|
||||
live-output: true
|
17
node_modules/requirejs-config-file/.travis.yml
generated
vendored
Normal file
17
node_modules/requirejs-config-file/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- '6'
|
||||
- '8'
|
||||
- '10'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
||||
- grunt --version
|
||||
|
||||
notifications:
|
||||
on_success: never
|
6
node_modules/requirejs-config-file/CHANGELOG
generated
vendored
Normal file
6
node_modules/requirejs-config-file/CHANGELOG
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
VERSION 2 ALLOW ALTERNATIVE FS IMPLEMENTATION
|
||||
==============================================
|
||||
|
||||
Version 2.1 - allow alternative fs implementation
|
||||
10/12/2018 18:30 2.1.0 initial release
|
33
node_modules/requirejs-config-file/Gruntfile.js
generated
vendored
Normal file
33
node_modules/requirejs-config-file/Gruntfile.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
/*global module:false*/
|
||||
module.exports = function(grunt) {
|
||||
|
||||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
||||
|
||||
grunt.initConfig({
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc',
|
||||
},
|
||||
libs: {
|
||||
src: ['Gruntfile.js', 'index.js', 'test/**/*.js', '!files/fixtures/parse-error-config.js']
|
||||
}
|
||||
},
|
||||
|
||||
simplemocha: {
|
||||
options: {
|
||||
timeout: 3000,
|
||||
ui: 'bdd',
|
||||
reporter: 'spec'
|
||||
},
|
||||
|
||||
all: { src: ['test/**/*.js'] }
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['jshint']);
|
||||
grunt.registerTask('test', ['jshint', 'simplemocha:all']);
|
||||
};
|
20
node_modules/requirejs-config-file/LICENSE
generated
vendored
Normal file
20
node_modules/requirejs-config-file/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 webforge-labs
|
||||
|
||||
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.
|
65
node_modules/requirejs-config-file/README.md
generated
vendored
Normal file
65
node_modules/requirejs-config-file/README.md
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
# requirejs-config-file [](https://travis-ci.org/webforge-labs/requirejs-config-file)
|
||||
|
||||
[](https://www.npmjs.org/package/requirejs-config-file)
|
||||
|
||||
A small api to read and write your requirejs config file
|
||||
|
||||
|
||||
## installation
|
||||
|
||||
```
|
||||
npm install requirejs-config-file
|
||||
```
|
||||
|
||||
## usage
|
||||
|
||||
### require the constructor
|
||||
```js
|
||||
var ConfigFile = require('requirejs-config-file').ConfigFile;
|
||||
```
|
||||
|
||||
### read
|
||||
```js
|
||||
// Read: reading the config
|
||||
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));
|
||||
|
||||
var config = configFile.read();
|
||||
|
||||
console.log(config); // is an object with the found config
|
||||
```
|
||||
|
||||
### modify (read and write)
|
||||
```js
|
||||
// Modify: reading and writing the config
|
||||
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));
|
||||
|
||||
var config = configFile.read();
|
||||
|
||||
config.baseUrl = '/new';
|
||||
|
||||
configFile.write();
|
||||
```
|
||||
|
||||
### create
|
||||
```js
|
||||
// CreateExample: creating a new config file
|
||||
var configFile = new ConfigFile('path/to/new-config.js'));
|
||||
|
||||
configFile.createIfNotExists();
|
||||
|
||||
configFile.write();
|
||||
```
|
||||
|
||||
### create or modify
|
||||
```js
|
||||
// CreateAndModifyExample: reading and writing a maybe not existing config file
|
||||
var configFile = new ConfigFile('path/to/new-config.js'));
|
||||
|
||||
configFile.createIfNotExists();
|
||||
|
||||
configFile.read();
|
||||
|
||||
config.baseUrl = '/new';
|
||||
|
||||
configFile.write();
|
||||
```
|
87
node_modules/requirejs-config-file/files/fixtures/config-with-define.js
generated
vendored
Normal file
87
node_modules/requirejs-config-file/files/fixtures/config-with-define.js
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
/* global requirejs */
|
||||
requirejs.config({
|
||||
|
||||
baseUrl: '/js-built/lib',
|
||||
urlArgs: "bust=" + (new Date()).getTime(),
|
||||
|
||||
packages: [
|
||||
{
|
||||
name: "knockout",
|
||||
location: "../node_modules/shimney-knockout"
|
||||
},
|
||||
{
|
||||
name: "jquery",
|
||||
location: "../node_modules/shimney-jquery"
|
||||
},
|
||||
{
|
||||
name: "sammy",
|
||||
location: "../node_modules/shimney-sammy"
|
||||
},
|
||||
{
|
||||
name: "twitter-bootstrap",
|
||||
location: "../node_modules/shimney-twitter-bootstrap"
|
||||
},
|
||||
{
|
||||
name: "lodash",
|
||||
location: "../node_modules/shimney-lodash"
|
||||
},
|
||||
{
|
||||
name: "hogan",
|
||||
location: "../node_modules/shimney-hogan"
|
||||
},
|
||||
{
|
||||
name: "cookie-monster",
|
||||
location: "../node_modules/shimney-cookie-monster"
|
||||
},
|
||||
{
|
||||
name: "JSON", // is a direct dependency (in package.json)
|
||||
location: "../node_modules/shimney-json"
|
||||
}
|
||||
],
|
||||
|
||||
/* set paths and vendor versions for applications
|
||||
*
|
||||
* paths are relative to lib
|
||||
* define all vendor dependencies here
|
||||
*/
|
||||
paths: {
|
||||
'img-files': '../img',
|
||||
'test-setup': '../tests/setup',
|
||||
'test-files': "../tests/files",
|
||||
'templates': "../templates",
|
||||
|
||||
'jquery-ui': "../vendor/jquery-ui/jquery-ui-1.8.24.custom.patched",
|
||||
'jquery-ui-i18n': "../vendor/jquery-ui/jquery-ui-i18n.custom",
|
||||
"qunit": "../vendor/qunit/qunit-1.10.0",
|
||||
'joose': "../vendor/joose/all",
|
||||
'ace': "../vendor/ace/lib/ace",
|
||||
'psc-tests-assert': '../vendor/qunit-assert/lib/assert',
|
||||
'qunit-assert': '../vendor/qunit-assert/lib/assert',
|
||||
'TestRunner': "../vendor/qunit-assert/lib/TestRunner",
|
||||
'jquery-form': "../vendor/jquery-form/jquery.form-3.20",
|
||||
'jquery-fileupload': "../vendor/jquery-fileupload/jquery.fileupload",
|
||||
'jquery-iframe-transport': "../vendor/jquery-fileupload/jquery.iframe-transport",
|
||||
'jquery-tmpl': "../vendor/jquery-tmpl/jquery.tmpl",
|
||||
'jqwidgets': "../vendor/jqwidgets/jqx-all.min",
|
||||
'jquery-simulate': "../vendor/jquery-simulate/jquery.simulate.patched",
|
||||
'jquery-rangyinputs': "../vendor/jquery-rangyinputs/rangyinputs_jquery.min",
|
||||
'jquerypp': "../vendor/jquerypp/1.0.0/amd/jquerypp",
|
||||
'ui-connect-morphable': "../vendor/webforge/jquery.ui.connect-morphable",
|
||||
'ui-paging': "../vendor/webforge/ui.paging",
|
||||
'placeholder': "../vendor/mths.be/placeholder-2.0.6",
|
||||
'stacktrace': "../vendor/eriwen/stacktrace-min-0.4",
|
||||
'twitter-typeahead': "../vendor/twitter/typeahead/typeahead.min",
|
||||
'knockout-mapping': "../vendor/knockout/knockout.mapping",
|
||||
'knockout-bindings': "lib/Psc/ko/bindings",
|
||||
'jquery-selectrange': "../vendor/stackoverflow/jquery-selectrange",
|
||||
'jquery-global': "../vendor/jqwidgets/globalization/jquery.global",
|
||||
'jquery-global-de-DE': "../vendor/jqwidgets/globalization/jquery.glob.de-DE",
|
||||
'html5shiv': "../vendor/afarkas/html5shiv",
|
||||
'i18next': '../vendor/i18next/i18next.amd.withJQuery-1.6.3.min',
|
||||
'gdl/master/common/ispy': 'empty-module'
|
||||
}
|
||||
});
|
||||
|
||||
define(['jquery'], function ($) {
|
||||
$.myPlugin();
|
||||
});
|
0
node_modules/requirejs-config-file/files/fixtures/empty-call-config.js
generated
vendored
Normal file
0
node_modules/requirejs-config-file/files/fixtures/empty-call-config.js
generated
vendored
Normal file
0
node_modules/requirejs-config-file/files/fixtures/empty-config.js
generated
vendored
Normal file
0
node_modules/requirejs-config-file/files/fixtures/empty-config.js
generated
vendored
Normal file
4
node_modules/requirejs-config-file/files/fixtures/modified-empty-config.js
generated
vendored
Normal file
4
node_modules/requirejs-config-file/files/fixtures/modified-empty-config.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/* globals requirejs */
|
||||
requirejs.config({
|
||||
baseUrl: './js-build/lib'
|
||||
});
|
74
node_modules/requirejs-config-file/files/fixtures/modified-normal-config.js
generated
vendored
Normal file
74
node_modules/requirejs-config-file/files/fixtures/modified-normal-config.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
/* global requirejs */
|
||||
requirejs.config({
|
||||
baseUrl: '/js-built/lib',
|
||||
packages: [
|
||||
{
|
||||
name: 'knockout',
|
||||
location: '../node_modules/shimney-knockout'
|
||||
},
|
||||
{
|
||||
name: 'jquery',
|
||||
location: '../node_modules/shimney-jquery'
|
||||
},
|
||||
{
|
||||
name: 'sammy',
|
||||
location: '../node_modules/shimney-sammy'
|
||||
},
|
||||
{
|
||||
name: 'twitter-bootstrap',
|
||||
location: '../node_modules/shimney-twitter-bootstrap'
|
||||
},
|
||||
{
|
||||
name: 'lodash',
|
||||
location: '../node_modules/shimney-lodash'
|
||||
},
|
||||
{
|
||||
name: 'hogan',
|
||||
location: '../node_modules/shimney-hogan'
|
||||
},
|
||||
{
|
||||
name: 'cookie-monster',
|
||||
location: '../node_modules/shimney-cookie-monster'
|
||||
},
|
||||
{
|
||||
name: 'JSON',
|
||||
location: '../node_modules/shimney-json'
|
||||
}
|
||||
],
|
||||
paths: {
|
||||
'img-files': '../img',
|
||||
'test-setup': '../tests/setup',
|
||||
'test-files': '../tests/files',
|
||||
templates: '../templates',
|
||||
'jquery-ui': '../vendor/jquery-ui/jquery-ui-1.8.24.custom.patched',
|
||||
'jquery-ui-i18n': '../vendor/jquery-ui/jquery-ui-i18n.custom',
|
||||
qunit: '../vendor/qunit/qunit-1.10.0',
|
||||
joose: '../vendor/joose/all',
|
||||
ace: '../vendor/ace/lib/ace',
|
||||
'psc-tests-assert': '../vendor/qunit-assert/lib/assert',
|
||||
'qunit-assert': '../vendor/qunit-assert/lib/assert',
|
||||
TestRunner: '../vendor/qunit-assert/lib/TestRunner',
|
||||
'jquery-form': '../vendor/jquery-form/jquery.form-3.20',
|
||||
'jquery-fileupload': '../vendor/jquery-fileupload/jquery.fileupload',
|
||||
'jquery-iframe-transport': '../vendor/jquery-fileupload/jquery.iframe-transport',
|
||||
'jquery-tmpl': '../vendor/jquery-tmpl/jquery.tmpl',
|
||||
jqwidgets: '../vendor/jqwidgets/jqx-all.min',
|
||||
'jquery-simulate': '../vendor/jquery-simulate/jquery.simulate.patched',
|
||||
'jquery-rangyinputs': '../vendor/jquery-rangyinputs/rangyinputs_jquery.min',
|
||||
jquerypp: '../vendor/jquerypp/1.0.0/amd/jquerypp',
|
||||
'ui-connect-morphable': '../vendor/webforge/jquery.ui.connect-morphable',
|
||||
'ui-paging': '../vendor/webforge/ui.paging',
|
||||
placeholder: '../vendor/mths.be/placeholder-2.0.6',
|
||||
stacktrace: '../vendor/eriwen/stacktrace-min-0.4',
|
||||
'twitter-typeahead': '../vendor/twitter/typeahead/typeahead.min',
|
||||
'knockout-mapping': '../vendor/knockout/knockout.mapping',
|
||||
'knockout-bindings': 'lib/Psc/ko/bindings',
|
||||
'jquery-selectrange': '../vendor/stackoverflow/jquery-selectrange',
|
||||
'jquery-global': '../vendor/jqwidgets/globalization/jquery.global',
|
||||
'jquery-global-de-DE': '../vendor/jqwidgets/globalization/jquery.glob.de-DE',
|
||||
html5shiv: '../vendor/afarkas/html5shiv',
|
||||
i18next: '../vendor/i18next/i18next.amd.withJQuery-1.6.3.min',
|
||||
'gdl/master/common/ispy': 'empty-module',
|
||||
monster: '/path/to/monster'
|
||||
}
|
||||
});
|
47
node_modules/requirejs-config-file/files/fixtures/modified-var-config.js
generated
vendored
Normal file
47
node_modules/requirejs-config-file/files/fixtures/modified-var-config.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/* global requirejs */
|
||||
var require = {
|
||||
packages: [
|
||||
{
|
||||
name: 'knockout',
|
||||
location: '../node_modules/shimney-knockout'
|
||||
},
|
||||
{
|
||||
name: 'jquery',
|
||||
location: '../node_modules/shimney-jquery'
|
||||
},
|
||||
{
|
||||
name: 'sammy',
|
||||
location: '../node_modules/shimney-sammy'
|
||||
},
|
||||
{
|
||||
name: 'twitter-bootstrap',
|
||||
location: '../node_modules/shimney-twitter-bootstrap'
|
||||
},
|
||||
{
|
||||
name: 'lodash',
|
||||
location: '../node_modules/shimney-lodash'
|
||||
},
|
||||
{
|
||||
name: 'hogan',
|
||||
location: '../node_modules/shimney-hogan'
|
||||
},
|
||||
{
|
||||
name: 'cookie-monster',
|
||||
location: '../node_modules/shimney-cookie-monster'
|
||||
},
|
||||
{
|
||||
name: 'JSON',
|
||||
location: '../node_modules/shimney-json'
|
||||
}
|
||||
],
|
||||
paths: {
|
||||
'img-files': '../img',
|
||||
tpl: '../templates',
|
||||
'some-plugin': '../vendor/some-plugin.1.0',
|
||||
lodash: '/path/to/lodash.min'
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof(requirejs) === "function") {
|
||||
requirejs.config(require);
|
||||
}
|
82
node_modules/requirejs-config-file/files/fixtures/normal-config.js
generated
vendored
Normal file
82
node_modules/requirejs-config-file/files/fixtures/normal-config.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
/* global requirejs */
|
||||
requirejs.config({
|
||||
|
||||
baseUrl: '/js-built/lib',
|
||||
|
||||
packages: [
|
||||
{
|
||||
name: "knockout",
|
||||
location: "../node_modules/shimney-knockout"
|
||||
},
|
||||
{
|
||||
name: "jquery",
|
||||
location: "../node_modules/shimney-jquery"
|
||||
},
|
||||
{
|
||||
name: "sammy",
|
||||
location: "../node_modules/shimney-sammy"
|
||||
},
|
||||
{
|
||||
name: "twitter-bootstrap",
|
||||
location: "../node_modules/shimney-twitter-bootstrap"
|
||||
},
|
||||
{
|
||||
name: "lodash",
|
||||
location: "../node_modules/shimney-lodash"
|
||||
},
|
||||
{
|
||||
name: "hogan",
|
||||
location: "../node_modules/shimney-hogan"
|
||||
},
|
||||
{
|
||||
name: "cookie-monster",
|
||||
location: "../node_modules/shimney-cookie-monster"
|
||||
},
|
||||
{
|
||||
name: "JSON", // is a direct dependency (in package.json)
|
||||
location: "../node_modules/shimney-json"
|
||||
}
|
||||
],
|
||||
|
||||
/* set paths and vendor versions for applications
|
||||
*
|
||||
* paths are relative to lib
|
||||
* define all vendor dependencies here
|
||||
*/
|
||||
paths: {
|
||||
'img-files': '../img',
|
||||
'test-setup': '../tests/setup',
|
||||
'test-files': "../tests/files",
|
||||
'templates': "../templates",
|
||||
|
||||
'jquery-ui': "../vendor/jquery-ui/jquery-ui-1.8.24.custom.patched",
|
||||
'jquery-ui-i18n': "../vendor/jquery-ui/jquery-ui-i18n.custom",
|
||||
"qunit": "../vendor/qunit/qunit-1.10.0",
|
||||
'joose': "../vendor/joose/all",
|
||||
'ace': "../vendor/ace/lib/ace",
|
||||
'psc-tests-assert': '../vendor/qunit-assert/lib/assert',
|
||||
'qunit-assert': '../vendor/qunit-assert/lib/assert',
|
||||
'TestRunner': "../vendor/qunit-assert/lib/TestRunner",
|
||||
'jquery-form': "../vendor/jquery-form/jquery.form-3.20",
|
||||
'jquery-fileupload': "../vendor/jquery-fileupload/jquery.fileupload",
|
||||
'jquery-iframe-transport': "../vendor/jquery-fileupload/jquery.iframe-transport",
|
||||
'jquery-tmpl': "../vendor/jquery-tmpl/jquery.tmpl",
|
||||
'jqwidgets': "../vendor/jqwidgets/jqx-all.min",
|
||||
'jquery-simulate': "../vendor/jquery-simulate/jquery.simulate.patched",
|
||||
'jquery-rangyinputs': "../vendor/jquery-rangyinputs/rangyinputs_jquery.min",
|
||||
'jquerypp': "../vendor/jquerypp/1.0.0/amd/jquerypp",
|
||||
'ui-connect-morphable': "../vendor/webforge/jquery.ui.connect-morphable",
|
||||
'ui-paging': "../vendor/webforge/ui.paging",
|
||||
'placeholder': "../vendor/mths.be/placeholder-2.0.6",
|
||||
'stacktrace': "../vendor/eriwen/stacktrace-min-0.4",
|
||||
'twitter-typeahead': "../vendor/twitter/typeahead/typeahead.min",
|
||||
'knockout-mapping': "../vendor/knockout/knockout.mapping",
|
||||
'knockout-bindings': "lib/Psc/ko/bindings",
|
||||
'jquery-selectrange': "../vendor/stackoverflow/jquery-selectrange",
|
||||
'jquery-global': "../vendor/jqwidgets/globalization/jquery.global",
|
||||
'jquery-global-de-DE': "../vendor/jqwidgets/globalization/jquery.glob.de-DE",
|
||||
'html5shiv': "../vendor/afarkas/html5shiv",
|
||||
'i18next': '../vendor/i18next/i18next.amd.withJQuery-1.6.3.min',
|
||||
'gdl/master/common/ispy': 'empty-module'
|
||||
}
|
||||
});
|
1
node_modules/requirejs-config-file/files/fixtures/parse-error-config.js
generated
vendored
Normal file
1
node_modules/requirejs-config-file/files/fixtures/parse-error-config.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
requirejs.config(%s);
|
54
node_modules/requirejs-config-file/files/fixtures/var-config.js
generated
vendored
Normal file
54
node_modules/requirejs-config-file/files/fixtures/var-config.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/* global requirejs */
|
||||
var require = {
|
||||
|
||||
packages: [
|
||||
{
|
||||
name: "knockout",
|
||||
location: "../node_modules/shimney-knockout"
|
||||
},
|
||||
{
|
||||
name: "jquery",
|
||||
location: "../node_modules/shimney-jquery"
|
||||
},
|
||||
{
|
||||
name: "sammy",
|
||||
location: "../node_modules/shimney-sammy"
|
||||
},
|
||||
{
|
||||
name: "twitter-bootstrap",
|
||||
location: "../node_modules/shimney-twitter-bootstrap"
|
||||
},
|
||||
{
|
||||
name: "lodash",
|
||||
location: "../node_modules/shimney-lodash"
|
||||
},
|
||||
{
|
||||
name: "hogan",
|
||||
location: "../node_modules/shimney-hogan"
|
||||
},
|
||||
{
|
||||
name: "cookie-monster",
|
||||
location: "../node_modules/shimney-cookie-monster"
|
||||
},
|
||||
{
|
||||
name: "JSON", // is a direct dependency (in package.json)
|
||||
location: "../node_modules/shimney-json"
|
||||
}
|
||||
],
|
||||
|
||||
/* set paths and vendor versions for applications
|
||||
*
|
||||
* paths are relative to src
|
||||
* define all vendor dependencies here
|
||||
*/
|
||||
paths: {
|
||||
'img-files': '../img',
|
||||
'tpl': '../templates',
|
||||
|
||||
'some-plugin': "../vendor/some-plugin.1.0"
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof(requirejs) === "function") {
|
||||
requirejs.config(require);
|
||||
}
|
157
node_modules/requirejs-config-file/index.js
generated
vendored
Normal file
157
node_modules/requirejs-config-file/index.js
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const makeDir = require('make-dir');
|
||||
const esprima = require('esprima');
|
||||
const util = require('util');
|
||||
const stringifyObject = require("stringify-object");
|
||||
|
||||
const noop = function(){};
|
||||
|
||||
function outputFileSync (filePath, contents, fileSystem = fs) {
|
||||
const dir = path.dirname(filePath);
|
||||
makeDir.sync(dir, {
|
||||
fs: fileSystem
|
||||
});
|
||||
fileSystem.writeFileSync(filePath, contents);
|
||||
}
|
||||
|
||||
class ConfigFile {
|
||||
constructor(filePath, fileSystem = fs) {
|
||||
this.filePath = filePath;
|
||||
this.fileSystem = fileSystem;
|
||||
this.config = null;
|
||||
|
||||
/**
|
||||
* null = never read
|
||||
* var = config was read with var require = {...}
|
||||
* requirejs = config was read with requirejs.config({...})
|
||||
* require = config was read with require.config({...})
|
||||
* empty = no config expression was found (but read() was called)
|
||||
* create-if-not-exists = createIfNotExists() was called so it might not have an existing file
|
||||
*/
|
||||
this.type = null;
|
||||
|
||||
/**
|
||||
* The position where the object expression should be written back to
|
||||
*/
|
||||
this.range = null;
|
||||
|
||||
this.contents = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the config object from the read file
|
||||
*/
|
||||
read() {
|
||||
try {
|
||||
const data = this.fileSystem.readFileSync(this.filePath);
|
||||
|
||||
this.contents = data.toString();
|
||||
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT' && this.type === 'create-if-not-exists') {
|
||||
return this.config;
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
let program;
|
||||
|
||||
try {
|
||||
program = esprima.parse(this.contents, {range: true});
|
||||
} catch (ex) {
|
||||
throw new Error(`could not read: ${this.filePath} because it has syntax errors: ${ex}`);
|
||||
}
|
||||
|
||||
this.type = 'empty';
|
||||
if (program.type === 'Program') {
|
||||
program.body.forEach(statement => {
|
||||
|
||||
if (statement.expression && statement.expression.type === 'CallExpression') {
|
||||
const call = statement.expression;
|
||||
|
||||
if (call.callee.type === 'MemberExpression' && (call.callee.object.name === 'requirejs' || call.callee.object.name === 'require') && call.callee.property.name === 'config') {
|
||||
this.type = call.callee.object.name === 'require' ? 'require' : 'requirejs';
|
||||
this.readObjectExpression(call.arguments[0], noop);
|
||||
return false;
|
||||
}
|
||||
} else if(statement.type === 'VariableDeclaration') {
|
||||
statement.declarations.forEach(declarator => {
|
||||
if (declarator.id.name === 'require') {
|
||||
this.type = 'var';
|
||||
this.readObjectExpression(declarator.init, noop);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (this.type === 'var') return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.type === 'empty') {
|
||||
this.config = {};
|
||||
}
|
||||
|
||||
return this.config;
|
||||
}
|
||||
|
||||
write() {
|
||||
let contents;
|
||||
|
||||
if (this.type === 'empty' || this.type === 'create-if-not-exists') {
|
||||
contents = util.format("/* globals requirejs */\nrequirejs.config(%s);\n", this.buildConfig());
|
||||
|
||||
} else {
|
||||
|
||||
if (!this.range) {
|
||||
throw new Error('The config cannot be written. Was it read() before? The config expression has to be found to allow writing. You can use createIfNotExists() to create an empty config.');
|
||||
}
|
||||
|
||||
contents = this.contents.substring(0, this.range[0]) + this.buildConfig() + this.contents.substring(this.range[1]);
|
||||
}
|
||||
|
||||
outputFileSync(this.filePath, contents, this.fileSystem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the config(File) if not already existing
|
||||
*
|
||||
* notice: you still need to write() it to have a physical existing file.
|
||||
*/
|
||||
createIfNotExists(config = {}) {
|
||||
this.config = config;
|
||||
this.type = 'create-if-not-exists';
|
||||
}
|
||||
|
||||
buildConfig() {
|
||||
return stringifyObject(
|
||||
this.config,
|
||||
{
|
||||
indent: ' '
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
readObjectExpression(objectExpression, callback) {
|
||||
/* jshint evil:true */
|
||||
if (objectExpression && objectExpression.type === 'ObjectExpression') {
|
||||
try {
|
||||
this.config = eval(`(${this.contents.substring(objectExpression.range[0], objectExpression.range[1])})`);
|
||||
|
||||
} catch (syntaxError) {
|
||||
return callback(syntaxError, null);
|
||||
}
|
||||
|
||||
this.range = objectExpression.range;
|
||||
return callback(null, this.config);
|
||||
}
|
||||
|
||||
return callback('cannot read objectExpression from '+util.inspect(objectExpression));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {ConfigFile};
|
72
node_modules/requirejs-config-file/package.json
generated
vendored
Normal file
72
node_modules/requirejs-config-file/package.json
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"requirejs-config-file@3.1.2",
|
||||
"/Users/tatiana/selfdefined"
|
||||
]
|
||||
],
|
||||
"_from": "requirejs-config-file@3.1.2",
|
||||
"_id": "requirejs-config-file@3.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-sdLWywcDuNz7EIOhenSbRfT4YF84nItDv90coN2htbokjmU2QeyQuSBZILQUKNksepl8UPVU+hgYySFaDxbJPQ==",
|
||||
"_location": "/requirejs-config-file",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "requirejs-config-file@3.1.2",
|
||||
"name": "requirejs-config-file",
|
||||
"escapedName": "requirejs-config-file",
|
||||
"rawSpec": "3.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/module-lookup-amd"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-3.1.2.tgz",
|
||||
"_spec": "3.1.2",
|
||||
"_where": "/Users/tatiana/selfdefined",
|
||||
"author": {
|
||||
"name": "Philipp Scheit",
|
||||
"email": "p.scheit@ps-webforge.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webforge-labs/requirejs-config-file/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"esprima": "^4.0.0",
|
||||
"make-dir": "^2.1.0",
|
||||
"stringify-object": "^3.2.1"
|
||||
},
|
||||
"description": "A small api to read and write your requirejs config file",
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.2",
|
||||
"fs-extra": "^7.0.1",
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-contrib-jshint": "^1.1.0",
|
||||
"grunt-simple-mocha": "~0.4.0",
|
||||
"matchdep": "^2.0.0",
|
||||
"memfs": "^2.14.1",
|
||||
"unionfs": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/webforge-labs/requirejs-config-file#readme",
|
||||
"keywords": [
|
||||
"requirejs",
|
||||
"config"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "requirejs-config-file",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/webforge-labs/requirejs-config-file.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test --stack"
|
||||
},
|
||||
"version": "3.1.2"
|
||||
}
|
226
node_modules/requirejs-config-file/test/config-file-test.js
generated
vendored
Normal file
226
node_modules/requirejs-config-file/test/config-file-test.js
generated
vendored
Normal file
@ -0,0 +1,226 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const chai = require('chai');
|
||||
const fs = require('fs-extra');
|
||||
const expect = chai.expect;
|
||||
const assert = chai.assert;
|
||||
//chai.use(require('./helpers/file'));
|
||||
|
||||
const tmpDir = "files/tmp/";
|
||||
const tmpPath = function (relativePath) {
|
||||
return (tmpDir+relativePath).split(/\//).join(path.sep);
|
||||
};
|
||||
|
||||
if (!fs.existsSync(path)) {
|
||||
fs.mkdirsSync(tmpDir);
|
||||
}
|
||||
|
||||
const fixture = function(relativePath) {
|
||||
return ('files/fixtures/'+relativePath).split(/\//).join(path.sep);
|
||||
};
|
||||
|
||||
// Class Under Test
|
||||
const ConfigFile = require('../index').ConfigFile;
|
||||
|
||||
describe("ConfigFile", function() {
|
||||
|
||||
describe("#read()", function () {
|
||||
|
||||
describe("with a non-existing file", function() {
|
||||
const nonExistingFile = fixture('non-existing-config.js');
|
||||
const configFile = new ConfigFile(nonExistingFile);
|
||||
|
||||
beforeEach(function(done) {
|
||||
if (fs.existsSync(nonExistingFile)) {
|
||||
fs.unlink(fixture('non-existing-config.js'), done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it("it throws an error if file not found", function() {
|
||||
const read = function() {
|
||||
configFile.read();
|
||||
};
|
||||
|
||||
expect(read).to.throw(/non-existing-config\.js/);
|
||||
});
|
||||
|
||||
describe("when createIfNotExists() is used before", function() {
|
||||
beforeEach(function() {
|
||||
configFile.createIfNotExists();
|
||||
});
|
||||
|
||||
it("returns a empty config", function() {
|
||||
const config = configFile.read();
|
||||
expect(config).to.exist.and.to.be.a('object').and.to.be.empty;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("with a requirejs.config() call with a define() in the file", function() {
|
||||
const configFile = new ConfigFile(fixture('config-with-define.js'));
|
||||
|
||||
it("returns all the properties in the config", function() {
|
||||
const config = configFile.read();
|
||||
|
||||
expect(config).to.include.keys('paths');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe("with a normal requirejs.config() call in the file", function() {
|
||||
const configFile = new ConfigFile(fixture('normal-config.js'));
|
||||
|
||||
it("returns the config as an object", function() {
|
||||
const config = configFile.read();
|
||||
expect(config).to.exist.and.to.be.an('object');
|
||||
});
|
||||
|
||||
it("returns all the properties in the config", function() {
|
||||
const config = configFile.read();
|
||||
|
||||
expect(config).to.be.an('object').and.to.include.keys('paths');
|
||||
});
|
||||
});
|
||||
|
||||
describe("with a var require definition", function() {
|
||||
const configFile = new ConfigFile(fixture('var-config.js'));
|
||||
|
||||
it("returns the properties from config", function() {
|
||||
const config = configFile.read();
|
||||
expect(config).to.include.keys('paths');
|
||||
});
|
||||
});
|
||||
|
||||
describe("with an parse error config", function() {
|
||||
const configFile = new ConfigFile(fixture('parse-error-config.js'));
|
||||
|
||||
it("shows an error", function () {
|
||||
const read = function() {
|
||||
configFile.read();
|
||||
};
|
||||
|
||||
expect(read).to.throw(/syntax error/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("with an empty config", function() {
|
||||
const configFile = new ConfigFile(fixture('empty-config.js'));
|
||||
|
||||
it("reads the config file and returns an empty object without notice", function() {
|
||||
const config = configFile.read();
|
||||
|
||||
expect(config).to.exist.and.to.be.a('object').and.to.be.empty;
|
||||
});
|
||||
});
|
||||
|
||||
describe("with an alternative fs implementation", function() {
|
||||
|
||||
const volumeDir = 'app';
|
||||
const fileName = 'in-memory-config.js';
|
||||
const filePath = `${volumeDir}/${fileName}`;
|
||||
|
||||
const unionfs = require('unionfs');
|
||||
const memfs = require('memfs');
|
||||
var memFiles = { };
|
||||
var contents = fs.readFileSync(fixture('normal-config.js'), 'utf8');
|
||||
memFiles[fileName] = contents;
|
||||
var vol = memfs.Volume.fromJSON(memFiles, volumeDir);
|
||||
var ufs = unionfs.ufs.use(vol);
|
||||
|
||||
const configFile = new ConfigFile(filePath, ufs);
|
||||
|
||||
it("returns the config as an object", function() {
|
||||
const config = configFile.read();
|
||||
expect(config).to.exist.and.to.be.a('object').and.not.to.be.empty;
|
||||
});
|
||||
|
||||
it("returns all the properties in the config", function() {
|
||||
const config = configFile.read();
|
||||
expect(config).to.be.an('object').and.to.include.keys('paths');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe("#write()", function() {
|
||||
const testModify = function(configName, modify, done) {
|
||||
const configFilePath = tmpPath(configName);
|
||||
fs.copy(fixture(configName), configFilePath, function (err) {
|
||||
expect(err).to.not.exist;
|
||||
|
||||
const configFile = new ConfigFile(configFilePath);
|
||||
|
||||
const config = configFile.read();
|
||||
|
||||
modify(config);
|
||||
|
||||
configFile.write();
|
||||
|
||||
const expectedContents = fs.readFileSync(fixture('modified-'+configName)).toString();
|
||||
const actualContents = fs.readFileSync(configFilePath).toString();
|
||||
|
||||
assert.equal(actualContents, expectedContents);
|
||||
done();
|
||||
});
|
||||
};
|
||||
|
||||
it('writes the file with the modified config for a normal config', function (done) {
|
||||
testModify(
|
||||
'normal-config.js',
|
||||
function (config) {
|
||||
config.paths['monster'] = '/path/to/monster';
|
||||
},
|
||||
done
|
||||
);
|
||||
});
|
||||
|
||||
it('writes the file with the modified config for a var config', function (done) {
|
||||
testModify(
|
||||
'var-config.js',
|
||||
function (config) {
|
||||
config.paths['lodash'] = '/path/to/lodash.min';
|
||||
},
|
||||
done
|
||||
);
|
||||
});
|
||||
|
||||
it("writes an empty read config with a requirejs.config call", function(done) {
|
||||
testModify(
|
||||
'empty-config.js',
|
||||
function (config) {
|
||||
return config.baseUrl = './js-build/lib';
|
||||
},
|
||||
done
|
||||
);
|
||||
});
|
||||
|
||||
describe('with a non existing file which is createIfNotExists() before', function () {
|
||||
const nonExistingFile = fixture('non-existing-config.js');
|
||||
const configFile = new ConfigFile(nonExistingFile);
|
||||
|
||||
beforeEach(function(done) {
|
||||
if (fs.existsSync(nonExistingFile)) {
|
||||
fs.unlink(fixture('non-existing-config.js'), done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it("writes the file", function() {
|
||||
configFile.createIfNotExists();
|
||||
configFile.write();
|
||||
});
|
||||
|
||||
it("writes the file and creates directories", function() {
|
||||
const nonExistingFile = tmpPath('in/directory/non-existing-config.js');
|
||||
const configFile = new ConfigFile(nonExistingFile);
|
||||
|
||||
configFile.createIfNotExists();
|
||||
configFile.write();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user