Browse Source

fix root npm publish operating, remove old utils/npm (#8991)

Ben Houston (Clara.io) 9 years ago
parent
commit
704e7210eb

+ 13 - 2
package.json

@@ -1,8 +1,19 @@
 {
 {
-  "name": "three.js",
-  "version": "0.77.0",
+  "name": "three",
+  "version": "0.77.1",
   "description": "JavaScript 3D library",
   "description": "JavaScript 3D library",
   "main": "build/three.js",
   "main": "build/three.js",
+  "files": [
+    "package.json",
+    "LICENSE",
+    "README.md",
+    "build/three.js",
+    "build/three.min.js",
+    "src",
+    "examples/js",
+    "examples/fonts",
+    "bower.json"
+  ],
   "directories": {
   "directories": {
     "doc": "docs",
     "doc": "docs",
     "example": "examples",
     "example": "examples",

+ 0 - 42
utils/npm/README.md

@@ -1,42 +0,0 @@
-#### Dependencies
-1. To build the npm modules you will need both `node` and `npm` installed.
-2. We can then use `npm` to resolve our remaining Javascript build dependences. These
-dependencies are specified in `utils/build/package.json`.
-3. Note that there are other dependences - in particular, the
-[closure compiler](https://developers.google.com/closure/compiler/)
-is invoked, so you will need to ensure that `java` points to a suitably
-up-to-date version of the JVM.
-
-#### Specifying the version
-
-To invoke the build script (which will build both the both the `three` and
-`three-math` node modules) we need to run a command like
-```
-> node build.js 0.54.3-dev
- ```
-in this directory. Note how we have to provide the build script with the version
-number. The version number is of the form `major.minor.fix[-dev]`.
-The major/minor version numbers of the build should be taken from the
-`REVISION` parameter in `src/Three.js` (e.g. if `REVISION: '68'` choose `0.68`).
-
-Note that the following rules should be followed to determine the full version
-identifier:
-- Increment the fix number by `1` if you are re-publishing an existing Three.js
-version. If this is a new release the fix number should be `0`.
-- Add `-dev` to the version number if this is a development branch.
-
-As an example, to build r68, checkout the `r68` tag, follow the above, and then
-run
-```
-> node build.js 0.68.0
- ```
-
-#### Publishing
-
-The built modules will be left in `node_modules` in this directory. To upload
-both `three` and `three-math` to `npm`, run
-```
-> npm publish node_modules/three
-> npm publish node_modules/three-math
-```
-in this directory.

+ 0 - 109
utils/npm/build.js

@@ -1,109 +0,0 @@
-/**
- * Builds node_modules three and three-math
- *
- * Expects a single command line argument that is the build version in the format 0.54.4-dev
- *
- * @author bhouston / http://exocortex.com
- */
-
-var fs = require( "fs" );
-var cp = require('child_process');
-
-var commandLineArguments = process.argv.splice(2);
-
-var outputRootDir = "./node_modules";
-var inputDir = "../../build";
-var readmeFileName = "../../README.md";
-
-var headerFileName = "./header.js";
-var footerFileName = "./footer.js";
-
-if( commandLineArguments.length == 0 ) {
-	throw new Error( "build version must be specified as a command line argument (e.g. 0.54.3-dev)");
-}
-var buildVersion = commandLineArguments[0];
-
-
-var concateFiles = function ( inputFileNames, outputFileName ) {
-	var buffer = [];
-	for ( var i = 0; i < inputFileNames.length; i++ ) {
-		buffer.push( 
-			fs.readFileSync( inputFileNames[i], 'utf8' )
-			);
-	}
-
-	var combinedContents = buffer.join("");
-	fs.writeFileSync( outputFileName, combinedContents, 'utf8' );   
-}
-
-var createTemplatedFile = function ( templateFileName, replaceSet, outputFileName ) {
-	var templateContents = fs.readFileSync( templateFileName, 'utf8' );
-	for( var token in replaceSet ) {
-		templateContents = templateContents.replace( "%"+token+"%", replaceSet[token] );
-	}
-	fs.writeFileSync( outputFileName, templateContents, 'utf8' );
-}
-
-var copyFile = function( sourceFileName, destinationFileName ) {
-
-	var contents = fs.readFileSync( sourceFileName, 'utf8' );
-	fs.writeFileSync( destinationFileName, contents, 'utf8' );
-
-}
-
-var buildModule = function ( name, version ) {
-
-	if( ! fs.existsSync( outputRootDir ) ) {
-		fs.mkdirSync( outputRootDir );
-	}
-
-	var outputModuleDir = outputRootDir + "/" + name;
-	if( ! fs.existsSync( outputModuleDir ) ) {
-		fs.mkdirSync( outputModuleDir );
-	}
-	// make directory moduleDir
-
-	var inputRawFileName = inputDir + "/" + name + ".js";
-	var outputRawFileName = outputModuleDir + "/" + name + ".js";
-
-	concateFiles( [ headerFileName, inputRawFileName, footerFileName ], outputRawFileName );
-
-	var inputMinifiedFileName = inputDir + "/" + name + ".min.js";
-	var outputMinifiedFileName = outputModuleDir + "/" + name + ".min.js";
-
-	concateFiles( [ headerFileName, inputMinifiedFileName, footerFileName ], outputMinifiedFileName );
-
-	var templatePackageFileName = "./" + name + ".package.json";
-	var replaceSet = {
-		"VERSION": buildVersion
-	};
-	var outputPackageFileName = outputModuleDir + "/package.json";
-	createTemplatedFile( templatePackageFileName, replaceSet, outputPackageFileName );
-
-	var outputReadmeFileName = outputModuleDir + "/README.md";
-	copyFile( readmeFileName, outputReadmeFileName );
-}
-
-var cmdExe, args;
-if (process.platform === 'win32' || process.platform === 'win64') {
-	cmdExe = "cmd.exe";
-	args = [ "/c", "build.bat" ];
-} else {
-	cmdExe = './build.sh';
-	args = [];
-}
-var opts = { "cwd": "../build" };
-var buildAll = cp.spawn( cmdExe, args, opts );
-
-buildAll.stdout.on('data', function (data) {
-  console.log('stdout: ' + data);
-});
-
-buildAll.stderr.on('data', function (data) {
-  console.log('stderr: ' + data);
-});
-
-buildAll.on( 'exit', function ( exitCode ) {
-	console.log( "exitCode: " + exitCode );
-	buildModule( "three" );
-});

+ 0 - 13
utils/npm/footer.js

@@ -1,13 +0,0 @@
-
-// Export the THREE object for **Node.js**, with
-// backwards-compatibility for the old `require()` API. If we're in
-// the browser, add `_` as a global object via a string identifier,
-// for Closure Compiler "advanced" mode.
-if (typeof exports !== 'undefined') {
-  if (typeof module !== 'undefined' && module.exports) {
-    exports = module.exports = THREE;
-  }
-  exports.THREE = THREE;
-} else {
-  this['THREE'] = THREE;
-}

+ 0 - 1
utils/npm/header.js

@@ -1 +0,0 @@
-var self = self || {};

+ 0 - 10
utils/npm/node_modules/three.js/README.md

@@ -1,10 +0,0 @@
-three.js
-========
-
-**IMPORTANT NOTE**
-
-This ```three.js``` NPM package has been deprecated in favor of the three package available here:
-
-[Three NPM Package](http://npmjs.org/packages/three/)
-
-This NPM package currently acts as a shim for the three NPM package.

+ 0 - 16
utils/npm/node_modules/three.js/package.json

@@ -1,16 +0,0 @@
-{
-  "name": "three.js",
-  "version": "0.73.2",
-  "description": "Note: 'three.js' npm package has been deprecated in favor of the 'three' npm package.",
-  "main": "shim.js",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/mrdoob/three.js.git"
-  },
-  "author": {
-    "name": "mrdoob"
-  },
-  "dependencies": {
-    "three": "0.73.0"
-  }
-}

+ 0 - 12
utils/npm/node_modules/three.js/shim.js

@@ -1,12 +0,0 @@
-var THREE = require('three');
-
-console.warn( "WARNING: The 'three.js' npm package is deprecated in favor of the 'three' npm package, please upgrade.");
-
-if (typeof exports !== 'undefined') {
-  if (typeof module !== 'undefined' && module.exports) {
-    exports = module.exports = THREE;
-  }
-  exports.THREE = THREE;
-} else {
-  this['THREE'] = THREE;
-}

+ 0 - 35
utils/npm/test.js

@@ -1,35 +0,0 @@
-/**
- * For testing whether the node modules for three and three-math work properly.
- *
- * To test the node modules:
- *  1. First build them, but don't submit them to npm, see README.md for instructions
- *  2. Run "node test.js"
- *  3. You should see a list of all of the types exposed by the two THREE modules.
- *
- * @author bhouston / http://exocortex.com
- */
-
-var threemath = function () {
-	var THREE = require( "three-math" );
-
-	var a = new THREE.Vector3( 1, 1, 1 );
-	console.log( a );
-
-	for( var i in THREE ) {
-		console.log( i );
-	}
-};
-
-var three = function () {
-	var THREE = require( "three" );
-
-	var a = new THREE.Vector3( 1, 1, 1 );
-	console.log( a );
-
-	for( var i in THREE ) {
-		console.log( i );
-	}
-};
-
-threemath();
-three();

+ 0 - 49
utils/npm/three-math.package.json

@@ -1,49 +0,0 @@
-{
-
-    "name" : "three-math",
-
-    "version" : "%VERSION%",
-
-    "description" : "JavaScript 3D Math library",
-
-    "keywords" : [
-        "3D",
-        "WebGL",
-        "Three",
-        "ThreeJS",
-        "CSS",
-        "engine",
-        "rendering",
-        "geometry",
-        "math"
-    ],
-
-    "homepage" : "http://threejs.org/",
-
-    "bugs" : {
-        "url" : "https://github.com/mrdoob/three.js/issues"
-    },
-
-    "author" : "three.js contributors",
-
-    "main" : "./three-math.js",
-
-    "repository" : {
-        "type" : "git",
-        "url" : "git://github.com/mrdoob/three.js.git"
-    },
-
-    "license" : {
-        "type" : "The MIT License",
-        "url" : "https://raw.github.com/mrdoob/three.js/master/LICENSE"
-    },
-
-    "engines" : {
-        "node" : "*"
-    },
-
-    "help" : {
-        "web" : "http://stackoverflow.com/questions/tagged/three.js"
-    }
-
-}

+ 0 - 46
utils/npm/three.package.json

@@ -1,46 +0,0 @@
-{
-
-    "name" : "three",
-
-    "version" : "%VERSION%",
-
-    "description" : "JavaScript 3D library",
-
-    "keywords" : [
-        "3D",
-        "WebGL",
-        "Three",
-        "ThreeJS",
-        "CSS",
-        "engine",
-        "rendering",
-        "geometry",
-        "math"
-    ],
-
-    "homepage" : "http://threejs.org/",
-
-    "bugs" : {
-        "url" : "https://github.com/mrdoob/three.js/issues"
-    },
-
-    "author" : "three.js contributors",
-
-    "main" : "./three.js",
-
-    "repository" : {
-        "type" : "git",
-        "url" : "git://github.com/mrdoob/three.js.git"
-    },
-
-    "license" : "MIT",
-
-    "engines" : {
-        "node" : "*"
-    },
-
-    "help" : {
-        "web" : "http://stackoverflow.com/questions/tagged/three.js"
-    }
-
-}