@civ-clone/library-unit 0.1.4 → 0.1.5

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.
@@ -6,9 +6,34 @@ jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v1
10
- - uses: actions/setup-node@v1
9
+ - uses: actions/checkout@v4
10
+ - uses: pnpm/action-setup@v4
11
11
  with:
12
- node-version: 18
13
- - run: npm i
14
- - run: npm run prettier:check
12
+ version: 11
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: 22
16
+ # No lock file, so this tests what a consumer resolves. The settings match
17
+ # web-renderer's pnpm-workspace.yaml: several @civ-clone packages depend on
18
+ # each other as `github:` URLs, this project's own releases are often only
19
+ # minutes old, and nothing here needs a dependency's build script.
20
+ - run: >-
21
+ pnpm install --no-frozen-lockfile
22
+ --config.block-exotic-subdeps=false
23
+ --config.minimum-release-age=0
24
+ --config.strict-dep-builds=false
25
+ - run: npm run --if-present prettier:check
26
+ # The tests load the committed `.js`, so compile to prove the source
27
+ # type-checks, and fail if the committed output is stale. `--force`
28
+ # because a fresh checkout's timestamps can make `tsc --build` treat the
29
+ # committed output as up to date and skip the compile entirely.
30
+ - run: npm run --if-present ts:compile -- --force
31
+ - run: npm run --if-present prettier:format
32
+ # Stale *or never committed* output fails: `git diff` alone misses a new
33
+ # module whose `.js` was never added, which the published package would
34
+ # then omit. Only the compiled extensions, so the lock file the install
35
+ # writes cannot fail it; `node_modules` is ignored, so it stays out.
36
+ - run: |
37
+ git status --short --untracked-files=all -- '*.js' '*.d.ts' '*.js.map'
38
+ test -z "$(git status --porcelain --untracked-files=all -- '*.js' '*.d.ts' '*.js.map')"
39
+ - run: npm run --if-present test
@@ -0,0 +1,3 @@
1
+ import { JoinCity } from '@civ-clone/base-unit-action-join-city/JoinCity';
2
+ export { JoinCity } from '@civ-clone/base-unit-action-join-city/JoinCity';
3
+ export default JoinCity;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JoinCity = void 0;
4
+ const JoinCity_1 = require("@civ-clone/base-unit-action-join-city/JoinCity");
5
+ var JoinCity_2 = require("@civ-clone/base-unit-action-join-city/JoinCity");
6
+ Object.defineProperty(exports, "JoinCity", { enumerable: true, get: function () { return JoinCity_2.JoinCity; } });
7
+ exports.default = JoinCity_1.JoinCity;
8
+ //# sourceMappingURL=JoinCity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JoinCity.js","sourceRoot":"","sources":["JoinCity.ts"],"names":[],"mappings":";;;AAAA,6EAA0E;AAE1E,2EAA0E;AAAjE,oGAAA,QAAQ,OAAA;AAEjB,kBAAe,mBAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { JoinCity } from '@civ-clone/base-unit-action-join-city/JoinCity';
2
+
3
+ export { JoinCity } from '@civ-clone/base-unit-action-join-city/JoinCity';
4
+
5
+ export default JoinCity;
package/Actions.d.ts CHANGED
@@ -13,6 +13,7 @@ export { Embark } from './Actions/Embark';
13
13
  export { Fortify } from './Actions/Fortify';
14
14
  export { FoundCity } from './Actions/FoundCity';
15
15
  export { GoTo } from './Actions/GoTo';
16
+ export { JoinCity } from './Actions/JoinCity';
16
17
  export { Move } from './Actions/Move';
17
18
  export { NoOrders } from './Actions/NoOrders';
18
19
  export { Pillage } from './Actions/Pillage';
package/Actions.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Unload = exports.SneakCaptureCity = exports.SneakAttack = exports.Sleep = exports.SetHomeCity = exports.PlantForest = exports.Pillage = exports.NoOrders = exports.Move = exports.GoTo = exports.FoundCity = exports.Fortify = exports.Embark = exports.Disembark = exports.Disband = exports.ClearSwamp = exports.ClearJungle = exports.ClearForest = exports.CaptureCity = exports.BuildRoad = exports.BuildRailroad = exports.BuildMine = exports.BuildIrrigation = exports.Attack = void 0;
3
+ exports.Unload = exports.SneakCaptureCity = exports.SneakAttack = exports.Sleep = exports.SetHomeCity = exports.PlantForest = exports.Pillage = exports.NoOrders = exports.Move = exports.JoinCity = exports.GoTo = exports.FoundCity = exports.Fortify = exports.Embark = exports.Disembark = exports.Disband = exports.ClearSwamp = exports.ClearJungle = exports.ClearForest = exports.CaptureCity = exports.BuildRoad = exports.BuildRailroad = exports.BuildMine = exports.BuildIrrigation = exports.Attack = void 0;
4
4
  var Attack_1 = require("./Actions/Attack");
5
5
  Object.defineProperty(exports, "Attack", { enumerable: true, get: function () { return Attack_1.Attack; } });
6
6
  var BuildIrrigation_1 = require("./Actions/BuildIrrigation");
@@ -31,6 +31,8 @@ var FoundCity_1 = require("./Actions/FoundCity");
31
31
  Object.defineProperty(exports, "FoundCity", { enumerable: true, get: function () { return FoundCity_1.FoundCity; } });
32
32
  var GoTo_1 = require("./Actions/GoTo");
33
33
  Object.defineProperty(exports, "GoTo", { enumerable: true, get: function () { return GoTo_1.GoTo; } });
34
+ var JoinCity_1 = require("./Actions/JoinCity");
35
+ Object.defineProperty(exports, "JoinCity", { enumerable: true, get: function () { return JoinCity_1.JoinCity; } });
34
36
  var Move_1 = require("./Actions/Move");
35
37
  Object.defineProperty(exports, "Move", { enumerable: true, get: function () { return Move_1.Move; } });
36
38
  var NoOrders_1 = require("./Actions/NoOrders");
package/Actions.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sourceRoot":"","sources":["Actions.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAAjC,gGAAA,MAAM,OAAA;AACf,6DAA4D;AAAnD,kHAAA,eAAe,OAAA;AACxB,iDAAgD;AAAvC,sGAAA,SAAS,OAAA;AAClB,yDAAwD;AAA/C,8GAAA,aAAa,OAAA;AACtB,iDAAgD;AAAvC,sGAAA,SAAS,OAAA;AAClB,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,qD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M,OAAA;AACf,6CAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,iDAAgD;AAAvC,sGAAA,SAAS,OAAA;AAClB,uCAAsC;AAA7B,4FAAA,IAAI,OAAA;AACb,+CAA8C;AAArC,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,4FAAA,IAAI,OAAA;AACb,+CAA8C;AAArC,oGAAA,QAAQ,OAAA;AACjB,6CAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,yCAAwC;AAA/B,8FAAA,KAAK,OAAA;AACd,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AACzB,2CAA0C;AAAjC,gGAAA,MAAM,OAAA"}
package/Actions.ts CHANGED
@@ -13,6 +13,7 @@ export { Embark } from './Actions/Embark';
13
13
  export { Fortify } from './Actions/Fortify';
14
14
  export { FoundCity } from './Actions/FoundCity';
15
15
  export { GoTo } from './Actions/GoTo';
16
+ export { JoinCity } from './Actions/JoinCity';
16
17
  export { Move } from './Actions/Move';
17
18
  export { NoOrders } from './Actions/NoOrders';
18
19
  export { Pillage } from './Actions/Pillage';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civ-clone/library-unit",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "repository": "git@github.com:civ-clone/library-unit.git",
5
5
  "keywords": [
6
6
  "typescript",
@@ -10,13 +10,19 @@
10
10
  "license": "MIT",
11
11
  "scripts": {
12
12
  "build": "npm run ts:compile && npm run prettier:format",
13
- "prettier:check": "prettier --config .prettierrc '**/*.ts'",
13
+ "prettier:check": "prettier --config .prettierrc --check '**/*.ts'",
14
14
  "prettier:format": "prettier --config .prettierrc '**/*.ts' --write",
15
+ "test": "ts-mocha ./tests/*.test.ts",
15
16
  "ts:compile": "tsc --build tsconfig.json"
16
17
  },
17
18
  "devDependencies": {
19
+ "@types/chai": "^4.0",
20
+ "@types/mocha": "^9.0",
18
21
  "@types/node": "^14.0.0",
22
+ "chai": "^4.0",
23
+ "mocha": "^9.0",
19
24
  "prettier": "^2.0.0",
25
+ "ts-mocha": "^9.0",
20
26
  "typescript": "^4.0.0"
21
27
  },
22
28
  "dependencies": {
@@ -37,6 +43,7 @@
37
43
  "@civ-clone/base-unit-action-fortify": "^0.1.0",
38
44
  "@civ-clone/base-unit-action-found-city": "^0.1.0",
39
45
  "@civ-clone/base-unit-action-goto": "^0.1.0",
46
+ "@civ-clone/base-unit-action-join-city": "^0.1.0",
40
47
  "@civ-clone/base-unit-action-move": "^0.1.0",
41
48
  "@civ-clone/base-unit-action-no-orders": "^0.1.0",
42
49
  "@civ-clone/base-unit-action-pillage": "^0.1.0",
@@ -80,6 +87,8 @@
80
87
  "@civ-clone/base-unit-type-worker": "^0.1.0",
81
88
  "@civ-clone/base-unit-warrior": "^0.1.0",
82
89
  "@civ-clone/core-city": "^0.1.0",
90
+ "@civ-clone/core-player": "^0.1.0",
91
+ "@civ-clone/core-rule": "^0.1.0",
83
92
  "@civ-clone/core-unit": "^0.1.0",
84
93
  "@civ-clone/core-unit-transport": "^0.1.0",
85
94
  "@civ-clone/core-world": "^0.1.0"
@@ -0,0 +1,32 @@
1
+ import * as Actions from '../Actions';
2
+ import * as PlayerActions from '../PlayerActions';
3
+ import * as Types from '../Types';
4
+ import * as UnitImprovements from '../UnitImprovements';
5
+ import * as Units from '../Units';
6
+ import { expect } from 'chai';
7
+ import { JoinCity } from '@civ-clone/base-unit-action-join-city/JoinCity';
8
+
9
+ describe('library-unit', (): void => {
10
+ (
11
+ [
12
+ ['Actions', Actions],
13
+ ['PlayerActions', PlayerActions],
14
+ ['Types', Types],
15
+ ['UnitImprovements', UnitImprovements],
16
+ ['Units', Units],
17
+ ] as [string, { [key: string]: unknown }][]
18
+ ).forEach(([moduleName, exports]): void =>
19
+ it(`should export a class under its own name from \`${moduleName}\``, (): void => {
20
+ expect(Object.keys(exports)).not.empty;
21
+
22
+ Object.entries(exports).forEach(([name, value]): void => {
23
+ expect(value, name).to.be.a('function');
24
+ expect((value as Function).name, name).to.equal(name);
25
+ });
26
+ })
27
+ );
28
+
29
+ it('should re-export `JoinCity` from base-unit-action-join-city', (): void => {
30
+ expect(Actions.JoinCity).to.equal(JoinCity);
31
+ });
32
+ });